Skip to content

Commit a7f9da8

Browse files
committed
TabGroup: Simpler underline style
1 parent 060a988 commit a7f9da8

File tree

2 files changed

+13
-30
lines changed

2 files changed

+13
-30
lines changed

assets/css/v2/style.css

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ textarea:not([rows]) {
212212
--details-margin: 0.5rem 0rem;
213213

214214
/* Tab Group */
215-
--magrin-tab-group: 1rem 0 0 0;
215+
--margin-tab-group: 1rem -1rem 0 -1rem;
216216

217217
--overflow-gutter-extension: 1rem;
218218

@@ -1856,9 +1856,10 @@ li:has(> div > blockquote) {
18561856

18571857
/* MARK: Tabs
18581858
*/
1859+
1860+
/* NOTE: :checked selectors defined in layouts/shortcodes/tabs.html */
18591861
.tabs-container {
18601862
width: calc(100% + 2rem);
1861-
margin-inline-start: -1rem;
18621863
margin: var(--margin-tab-group);
18631864

18641865
input[type="radio"] {
@@ -1873,18 +1874,12 @@ li:has(> div > blockquote) {
18731874
scrollbar-width: none;
18741875
white-space: nowrap;
18751876
margin: 0;
1876-
padding-inline-start: 2rem;
1877-
1878-
> :not(:last-child) {
1879-
border-right: none;
1880-
}
1877+
padding-inline-start: 1rem;
18811878

18821879
li {
18831880
list-style: none;
1884-
border: 1px solid oklch(var(--color-tabs-inactive-border));
1885-
border-bottom: 1px solid oklch(var(--color-foreground));
1886-
color: oklch(var(--color-brand));
1887-
padding: 10px;
1881+
border-bottom: 1px solid oklch(var(--color-tabs-inactive-border));
1882+
padding: 0.25rem 0.75rem;
18881883
margin: 0;
18891884
position: relative;
18901885

@@ -1900,8 +1895,8 @@ li:has(> div > blockquote) {
19001895
display: block;
19011896
bottom: 0;
19021897
left: 0;
1903-
width: 2rem;
1904-
border-bottom: 1px solid oklch(var(--color-foreground));
1898+
width: 1rem;
1899+
border-bottom: 1px solid oklch(var(--color-tabs-inactive-border));
19051900
}
19061901

19071902
&::after {
@@ -1912,18 +1907,17 @@ li:has(> div > blockquote) {
19121907
left: 0;
19131908
right: 0;
19141909
width: 100%;
1915-
border-bottom: 1px solid oklch(var(--color-foreground));
1910+
border-bottom: 1px solid oklch(var(--color-tabs-inactive-border));
19161911
}
19171912
}
19181913

19191914
.tab-contents {
19201915
padding-block: 1rem;
1921-
border-bottom: 1px solid oklch(var(--color-foreground));
19221916

19231917
.tab-content {
19241918
display: none;
19251919
width: 100%;
1926-
padding: 1rem;
1920+
padding: 0.5rem 1rem;
19271921

19281922
--flow-gap: 2rem;
19291923

layouts/shortcodes/tabs.html

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<input type="radio" name="{{$tab_set_id}}" id="{{$id}}" aria-hidden="true" checked="checked">
1010
{{- else -}}
1111
<input type="radio" name="{{$tab_set_id}}" id="{{$id}}" aria-hidden="true">
12-
{{- end -}}
12+
{{- end -}}
1313
{{- end -}}
1414
<ul class="tab-labels" role="tablist" id="{{ $tab_set_id }}" data-testid="labels-{{ $tab_set_id }}">
1515
{{- range $i, $e := $tabs -}}
@@ -42,19 +42,8 @@
4242
<style>
4343
{{- range $i, $e := $tabs -}}
4444
.tabs-container input[type="radio"]:checked:nth-of-type({{ add $i 1 }}) ~ .tab-labels li:nth-of-type({{ add $i 1 }}) {
45-
border: none;
46-
border-top: 1px solid oklch(var(--color-foreground));
47-
border-left: 1px solid oklch(var(--color-foreground));
48-
border-bottom: none;
49-
color: oklch(var(--color-foreground));
50-
51-
+ li {
52-
border-left: 1px solid oklch(var(--color-foreground));
53-
}
54-
55-
&:last-of-type {
56-
border-right: 1px solid oklch(var(--color-foreground));
57-
}
45+
border-bottom: 2px solid oklch(var(--color-brand));
46+
color: oklch(var(--color-brand));
5847
}
5948

6049
.tabs-container input[type="radio"]:checked:nth-of-type({{ add $i 1 }}) ~ .tab-contents div:nth-of-type({{ add $i 1 }}) {

0 commit comments

Comments
 (0)