diff --git a/docs/index.html.ejs b/docs/index.html.ejs index 2073dbf..9568d56 100644 --- a/docs/index.html.ejs +++ b/docs/index.html.ejs @@ -41,6 +41,7 @@
+ A tab control is analogous to a divider in a file cabinet or notebook. + You can use this control to define multiple logical pages or sections of information within the same window. + + ++ +
+ To render a tab list, use a menu element with the
+ [role=tablist] attribute. The children of this menu (li
+ elements), should get a [role=tab] attribute.
+
+ Tabs should be managed by adding custom javascript code.
+ All you need is to add the [aria-selected=true] attribute to the active tab.
+
Hello, world!
+ + +the tab content
+
+ To create multirows tabs, add a multirows
+ class to the menu tag.
+
Hello, world!
+ + + +the tab content
+diff --git a/style.css b/style.css index f222a15..12cf871 100644 --- a/style.css +++ b/style.css @@ -69,6 +69,12 @@ --border-field: inset -1px -1px var(--button-highlight), inset 1px 1px var(--button-shadow), inset -2px -2px var(--button-face), inset 2px 2px var(--window-frame); + + /* Tabs */ + --border-tab: inset -1px 0 var(--window-frame), + inset 1px 1px var(--button-face), + inset -2px 0 var(--button-shadow), + inset 2px 2px var(--button-highlight) } @font-face { @@ -792,6 +798,53 @@ summary:focus { background-image: svg-load("./icon/button-right.svg"); } +.window[role=tabpanel] { + position: relative; + z-index: 2; +} + +menu[role=tablist] { + position: relative; + margin: 0 0 -2px 0; + text-indent: 0; + list-style-type: none; + display: flex; + padding-left: 3px; +} + +menu[role=tablist] > li { + border-top-left-radius: 3px; + border-top-right-radius: 3px; + box-shadow: var(--border-tab); + z-index: 1; +} + +menu[role=tablist] > li[aria-selected=true] { + padding-bottom: 2px; + margin-top: -2px; + background-color: var(--surface); + position: relative; + z-index: 8; + margin-left: -3px; +} + +menu[role=tablist] > li > a { + display: block; + color: #222; + margin: 6px; + text-decoration: none; +} +menu[role=tablist] > li[aria-selected=true] > a:focus { + outline: none; +} +menu[role=tablist] > li > a:focus { + outline: 1px dotted #222; +} + +menu[role=tablist].multirows > li { + flex-grow: 1; + text-align: center; +} .sunken-panel { box-sizing: border-box; border: 2px groove transparent; @@ -831,4 +884,4 @@ table > tbody > tr.highlighted { table > tbody > tr > * { padding: 0 var(--grouped-element-spacing); height: 14px; -} \ No newline at end of file +}