Skip to content

Commit

Permalink
Fix tabs' borders (#386)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
alphapapa and pre-commit-ci[bot] authored Nov 6, 2023
1 parent c6f6827 commit cd0b62a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 20 deletions.
35 changes: 16 additions & 19 deletions assets/theme-css/tabs.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
}

[role="tab"] {
box-sizing: border-box;
padding: 2px 2px 4px;
background-color: var(--pst-color-background);
border-color: transparent transparent var(--pst-color-primary);
border: none;
color: var(--pst-color-text);
outline: none;
font-weight: bold;
Expand All @@ -25,31 +26,27 @@
font-size: 1rem;
}

[role="tab"]:hover {
[role="tab"]:hover,
[role="tab"][aria-selected="true"]:hover {
color: var(--pst-color-secondary);
border-color: var(--pst-color-secondary) transparent
var(--pst-color-secondary);
border-bottom-color: var(--pst-color-secondary);
border-bottom-size: 2px;
border-bottom-style: solid;
border-top-color: var(--pst-color-secondary);
border-top-size: 2px;
border-top-style: solid;
}

[role="tab"][aria-selected="true"] {
border-color: transparent transparent var(--pst-color-primary);
border-bottom-color: var(--pst-color-primary);
border-bottom-style: solid;
border-bottom-size: 2px;
border-top-color: transparent;
border-top-style: solid;
border-top-size: 2px;
color: var(--pst-color-primary);
}

[role="tab"][aria-selected="true"]:hover {
border-color: var(--pst-color-secondary) transparent
var(--pst-color-secondary);
color: var(--pst-color-secondary);
}

[role="tab"][aria-selected="false"] {
border-bottom: 0rem solid;
}

[role="tab"][aria-selected="false"]:hover {
border-bottom: 0.0625rem solid var(--pst-color-secondary);
}

[role="tab"] span.focus {
display: inline-block;
margin: 2px;
Expand Down
3 changes: 2 additions & 1 deletion layouts/shortcodes/tabs.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
<div role="tablist" class="automatic">
{{- range $idx, $tab := .Scratch.Get "tabs" }}
<button id="{{ $groupId }}-tab-{{ $idx }}" type="button" role="tab" aria-selected="{{ cond (eq $idx 0) "true" "false" }}" aria-controls="{{ $groupId }}-tabpanel-{{ $idx }}">
<span class="focus">{{ .name }}</span>
<span class="focus">{{ .name }}</span>
</button>
{{- end }}
</div>
{{- range $idx, $tab := .Scratch.Get "tabs" }}
Expand Down

0 comments on commit cd0b62a

Please sign in to comment.