Skip to content

Commit f5ea6ef

Browse files
authored
fix: Tabs not working due to z-index (#185)
1 parent 601c6a7 commit f5ea6ef

File tree

2 files changed

+32
-41
lines changed

2 files changed

+32
-41
lines changed

assets/css/v2/style.css

Lines changed: 30 additions & 41 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 {
@@ -906,16 +905,33 @@ blockquote.side-callout {
906905
}
907906

908907
/* Tabs */
909-
910908
.tabs-container {
911-
position: relative;
912-
z-index: -1;
913-
border-bottom: 1px solid black;
909+
/* border-bottom: 1px solid black; */
914910
white-space: nowrap;
915911

916912
/* Lines extend 1rem into gutter on both sides */
917913
width: calc(100% + 2rem);
918914
margin-left: -1rem;
915+
916+
display: flex;
917+
flex-direction: row;
918+
align-items: end;
919+
920+
* {
921+
flex-grow: 0;
922+
}
923+
924+
& > :last-child {
925+
/* Extend the last child */
926+
flex-grow: 1;
927+
}
928+
}
929+
930+
.tabs-line {
931+
display: block;
932+
background-color: white;
933+
border-bottom: 1px solid black;
934+
width: 2rem;
919935
}
920936

921937
.nav-tabs {
@@ -927,7 +943,7 @@ blockquote.side-callout {
927943
list-style: none;
928944
display: flex;
929945
justify-content: start;
930-
margin: 0 1rem;
946+
margin: 0;
931947
padding: 0;
932948

933949
> :not(:last-child) {
@@ -937,9 +953,8 @@ blockquote.side-callout {
937953

938954
.nav-item {
939955
border: 1px solid var(--color-tabs-divider);
940-
border-bottom: none;
956+
border-bottom: 1px solid black;
941957
padding: 10px;
942-
position: relative;
943958

944959
a {
945960
text-decoration: none;
@@ -954,22 +969,12 @@ blockquote.side-callout {
954969
/* Change the border colors of li that is has a child with a class "active" */
955970
border-top: 1px solid black;
956971
border-left: 1px solid black;
972+
border-bottom: none;
957973

958974
/* Change the border of next child */
959975
+ li {
960976
border-left: 1px solid black;
961977
}
962-
963-
&::after {
964-
content: "";
965-
position: absolute;
966-
display: block;
967-
border-bottom: 1px solid white;
968-
bottom: 0;
969-
left: 0;
970-
width: 100%;
971-
z-index: 9999;
972-
}
973978
}
974979

975980
.nav-item:last-child:has(.active) {
@@ -978,7 +983,8 @@ blockquote.side-callout {
978983
}
979984

980985
.tab-content {
981-
position: relative;
986+
border-bottom: 1px solid black;
987+
margin-left: calc(-1 * var(--overflow-gutter-extension));
982988

983989
.tab-pane {
984990
display: none;
@@ -992,16 +998,6 @@ blockquote.side-callout {
992998
}
993999
}
9941000

995-
.tab-content::after {
996-
/* Bottom Horizontal Line for Tabs */
997-
content: "";
998-
position: absolute;
999-
border-bottom: 1px solid black;
1000-
left: calc(-1 * var(--overflow-gutter-extension));
1001-
bottom: 0;
1002-
width: calc(100% + (2 * var(--overflow-gutter-extension)));
1003-
}
1004-
10051001
/* Codeblocks */
10061002
.highlight {
10071003
padding: 0 1rem 0 1rem;
@@ -1014,11 +1010,8 @@ blockquote.side-callout {
10141010
}
10151011
}
10161012

1017-
.code-container {
1018-
grid-column: 1;
1019-
display: flex;
1020-
flex-direction: row;
1021-
position: relative;
1013+
.code-block {
1014+
position: static;
10221015
}
10231016

10241017
.code-block .code-header:not(:has(.code-type)) {
@@ -1036,13 +1029,13 @@ li .code-block {
10361029
border-bottom: 1px solid #cccccc;
10371030
overflow-x: scroll;
10381031
scrollbar-width: none;
1039-
width: calc(100% + var(--overflow-gutter-extension));
10401032
}
10411033

10421034
.highlight-v2.single-line {
10431035
display: flex;
10441036
align-items: center;
10451037
border: 1px solid #cccccc;
1038+
overflow-x: scroll;
10461039
}
10471040

10481041
.code-header {
@@ -1078,13 +1071,9 @@ li .code-block {
10781071
font-family: "JetBrains Mono", monospace;
10791072
font-size: 12px;
10801073
color: #000;
1081-
order: 2;
10821074
display: none;
1083-
}
1084-
1085-
.code-copy-button {
10861075
position: absolute;
1087-
right: 8px;
1076+
right: calc(25% + 2rem);
10881077
margin-top: 8px;
10891078
}
10901079

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)