Skip to content

Commit cd0b62a

Browse files
Fix tabs' borders (#386)
* Fix: (tabs.html) Close BUTTON tag * Fix: (tabs.css) borders * '[pre-commit.ci 🤖] Apply code format tools to PR' --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent c6f6827 commit cd0b62a

2 files changed

Lines changed: 18 additions & 20 deletions

File tree

assets/theme-css/tabs.css

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
}
1313

1414
[role="tab"] {
15+
box-sizing: border-box;
1516
padding: 2px 2px 4px;
1617
background-color: var(--pst-color-background);
17-
border-color: transparent transparent var(--pst-color-primary);
18+
border: none;
1819
color: var(--pst-color-text);
1920
outline: none;
2021
font-weight: bold;
@@ -25,31 +26,27 @@
2526
font-size: 1rem;
2627
}
2728

28-
[role="tab"]:hover {
29+
[role="tab"]:hover,
30+
[role="tab"][aria-selected="true"]:hover {
2931
color: var(--pst-color-secondary);
30-
border-color: var(--pst-color-secondary) transparent
31-
var(--pst-color-secondary);
32+
border-bottom-color: var(--pst-color-secondary);
33+
border-bottom-size: 2px;
34+
border-bottom-style: solid;
35+
border-top-color: var(--pst-color-secondary);
36+
border-top-size: 2px;
37+
border-top-style: solid;
3238
}
3339

3440
[role="tab"][aria-selected="true"] {
35-
border-color: transparent transparent var(--pst-color-primary);
41+
border-bottom-color: var(--pst-color-primary);
42+
border-bottom-style: solid;
43+
border-bottom-size: 2px;
44+
border-top-color: transparent;
45+
border-top-style: solid;
46+
border-top-size: 2px;
3647
color: var(--pst-color-primary);
3748
}
3849

39-
[role="tab"][aria-selected="true"]:hover {
40-
border-color: var(--pst-color-secondary) transparent
41-
var(--pst-color-secondary);
42-
color: var(--pst-color-secondary);
43-
}
44-
45-
[role="tab"][aria-selected="false"] {
46-
border-bottom: 0rem solid;
47-
}
48-
49-
[role="tab"][aria-selected="false"]:hover {
50-
border-bottom: 0.0625rem solid var(--pst-color-secondary);
51-
}
52-
5350
[role="tab"] span.focus {
5451
display: inline-block;
5552
margin: 2px;

layouts/shortcodes/tabs.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
<div role="tablist" class="automatic">
77
{{- range $idx, $tab := .Scratch.Get "tabs" }}
88
<button id="{{ $groupId }}-tab-{{ $idx }}" type="button" role="tab" aria-selected="{{ cond (eq $idx 0) "true" "false" }}" aria-controls="{{ $groupId }}-tabpanel-{{ $idx }}">
9-
<span class="focus">{{ .name }}</span>
9+
<span class="focus">{{ .name }}</span>
10+
</button>
1011
{{- end }}
1112
</div>
1213
{{- range $idx, $tab := .Scratch.Get "tabs" }}

0 commit comments

Comments
 (0)