Skip to content

Commit 7e5425a

Browse files
committed
fix: Tabs not working due to z-index
1 parent e8de09c commit 7e5425a

File tree

2 files changed

+23
-36
lines changed

2 files changed

+23
-36
lines changed

assets/css/v2/style.css

Lines changed: 21 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,6 @@ atomic-search-layout atomic-layout-section[section="search"] {
502502
background-color: white;
503503
border: black 1px solid;
504504
box-shadow: 3px 3px 0px var(--color-shadow);
505-
z-index: 9999;
506505
}
507506

508507
.product-selector p {
@@ -901,16 +900,24 @@ blockquote.side-callout {
901900
}
902901

903902
/* Tabs */
904-
905903
.tabs-container {
906-
position: relative;
907-
z-index: -1;
908-
border-bottom: 1px solid black;
904+
/* border-bottom: 1px solid black; */
909905
white-space: nowrap;
910906

911907
/* Lines extend 1rem into gutter on both sides */
912908
width: calc(100% + 2rem);
913909
margin-left: -1rem;
910+
911+
display: flex;
912+
flex-direction: row;
913+
align-items: end;
914+
}
915+
916+
.tabs-line {
917+
display: block;
918+
background-color: white;
919+
border-bottom: 1px solid black;
920+
width: 2rem;
914921
}
915922

916923
.nav-tabs {
@@ -922,7 +929,7 @@ blockquote.side-callout {
922929
list-style: none;
923930
display: flex;
924931
justify-content: start;
925-
margin: 0 1rem;
932+
margin: 0;
926933
padding: 0;
927934

928935
> :not(:last-child) {
@@ -932,9 +939,8 @@ blockquote.side-callout {
932939

933940
.nav-item {
934941
border: 1px solid var(--color-tabs-divider);
935-
border-bottom: none;
942+
border-bottom: 1px solid black;
936943
padding: 10px;
937-
position: relative;
938944

939945
a {
940946
text-decoration: none;
@@ -949,22 +955,12 @@ blockquote.side-callout {
949955
/* Change the border colors of li that is has a child with a class "active" */
950956
border-top: 1px solid black;
951957
border-left: 1px solid black;
958+
border-bottom: none;
952959

953960
/* Change the border of next child */
954961
+ li {
955962
border-left: 1px solid black;
956963
}
957-
958-
&::after {
959-
content: "";
960-
position: absolute;
961-
display: block;
962-
border-bottom: 1px solid white;
963-
bottom: 0;
964-
left: 0;
965-
width: 100%;
966-
z-index: 9999;
967-
}
968964
}
969965

970966
.nav-item:last-child:has(.active) {
@@ -973,7 +969,9 @@ blockquote.side-callout {
973969
}
974970

975971
.tab-content {
976-
position: relative;
972+
border-bottom: 1px solid black;
973+
width: calc(100% + (2 * var(--overflow-gutter-extension)));
974+
margin-left: calc(-1 * var(--overflow-gutter-extension));
977975

978976
.tab-pane {
979977
display: none;
@@ -987,16 +985,6 @@ blockquote.side-callout {
987985
}
988986
}
989987

990-
.tab-content::after {
991-
/* Bottom Horizontal Line for Tabs */
992-
content: "";
993-
position: absolute;
994-
border-bottom: 1px solid black;
995-
left: calc(-1 * var(--overflow-gutter-extension));
996-
bottom: 0;
997-
width: calc(100% + (2 * var(--overflow-gutter-extension)));
998-
}
999-
1000988
/* Codeblocks */
1001989
.highlight {
1002990
padding: 0 1rem 0 1rem;
@@ -1010,7 +998,7 @@ blockquote.side-callout {
1010998
}
1011999

10121000
.code-block {
1013-
grid-column: 1;
1001+
position: static;
10141002
}
10151003

10161004
.code-block .code-header:not(:has(.code-type)) {
@@ -1039,7 +1027,6 @@ li .code-block {
10391027
border-bottom: 1px solid #cccccc;
10401028
overflow-x: scroll;
10411029
scrollbar-width: none;
1042-
width: calc(100% + var(--overflow-gutter-extension));
10431030

10441031
background-image: linear-gradient(to right, white, white),
10451032
linear-gradient(to right, white, white),
@@ -1056,7 +1043,6 @@ li .code-block {
10561043
align-items: center;
10571044
border: 1px solid #cccccc;
10581045
overflow-x: scroll;
1059-
width: calc(100% + var(--overflow-gutter-extension));
10601046
}
10611047

10621048
.code-header {
@@ -1072,9 +1058,8 @@ li .code-block {
10721058
text-transform: uppercase;
10731059
border: 1px solid #cccccc;
10741060
border-bottom: 1px solid white;
1075-
padding: .25rem 1rem; /* Padding for button content */
1076-
font-size: 12px; /* Font size */
1077-
z-index: 9999;
1061+
padding: .25rem 1rem;
1062+
font-size: 12px;
10781063
margin-bottom: -1px;
10791064
}
10801065

layouts/shortcodes/tabs.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
{{- $tabs := .Scratch.Get "tabs" -}}
44
{{- if .Inner -}}{{- /* We don't use the inner content, but Hugo will complain if we don't reference it. */ -}}{{- end -}}
55
<div class="tabs-container">
6+
<span class="tabs-line"></span>
67
<ul class="nav nav-tabs" id="{{ $tab_set_id }}" role="tablist">
78
{{- range $i, $e := $tabs -}}
89
{{- $id := printf "%s-%d" $tab_set_id $i -}}
@@ -13,6 +14,7 @@
1314
{{- end -}}
1415
{{- end -}}
1516
</ul>
17+
<span class="tabs-line"></span>
1618
</div>
1719
<div class="tab-content" id="{{ $tab_set_id }}">
1820
{{- range $i, $e := $tabs -}}

0 commit comments

Comments
 (0)