Skip to content

Commit 58fe42f

Browse files
committed
fix: Tabs not working due to z-index
1 parent 601c6a7 commit 58fe42f

File tree

2 files changed

+36
-42
lines changed

2 files changed

+36
-42
lines changed

assets/css/v2/style.css

Lines changed: 34 additions & 42 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,24 @@ 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+
.tabs-line {
922+
display: block;
923+
background-color: white;
924+
border-bottom: 1px solid black;
925+
width: 2rem;
919926
}
920927

921928
.nav-tabs {
@@ -927,7 +934,7 @@ blockquote.side-callout {
927934
list-style: none;
928935
display: flex;
929936
justify-content: start;
930-
margin: 0 1rem;
937+
margin: 0;
931938
padding: 0;
932939

933940
> :not(:last-child) {
@@ -937,9 +944,8 @@ blockquote.side-callout {
937944

938945
.nav-item {
939946
border: 1px solid var(--color-tabs-divider);
940-
border-bottom: none;
947+
border-bottom: 1px solid black;
941948
padding: 10px;
942-
position: relative;
943949

944950
a {
945951
text-decoration: none;
@@ -954,22 +960,12 @@ blockquote.side-callout {
954960
/* Change the border colors of li that is has a child with a class "active" */
955961
border-top: 1px solid black;
956962
border-left: 1px solid black;
963+
border-bottom: none;
957964

958965
/* Change the border of next child */
959966
+ li {
960967
border-left: 1px solid black;
961968
}
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-
}
973969
}
974970

975971
.nav-item:last-child:has(.active) {
@@ -978,7 +974,8 @@ blockquote.side-callout {
978974
}
979975

980976
.tab-content {
981-
position: relative;
977+
border-bottom: 1px solid black;
978+
margin-left: calc(-1 * var(--overflow-gutter-extension));
982979

983980
.tab-pane {
984981
display: none;
@@ -992,16 +989,6 @@ blockquote.side-callout {
992989
}
993990
}
994991

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-
1005992
/* Codeblocks */
1006993
.highlight {
1007994
padding: 0 1rem 0 1rem;
@@ -1014,11 +1001,8 @@ blockquote.side-callout {
10141001
}
10151002
}
10161003

1017-
.code-container {
1018-
grid-column: 1;
1019-
display: flex;
1020-
flex-direction: row;
1021-
position: relative;
1004+
.code-block {
1005+
position: static;
10221006
}
10231007

10241008
.code-block .code-header:not(:has(.code-type)) {
@@ -1036,13 +1020,22 @@ li .code-block {
10361020
border-bottom: 1px solid #cccccc;
10371021
overflow-x: scroll;
10381022
scrollbar-width: none;
1039-
width: calc(100% + var(--overflow-gutter-extension));
1023+
1024+
background-image: linear-gradient(to right, white, white),
1025+
linear-gradient(to right, white, white),
1026+
linear-gradient(to right, rgba(165, 165, 165, 0.25), rgba(255, 255, 255, 0)),
1027+
linear-gradient(to left, rgba(165, 165, 165, 0.25), rgba(255, 255, 255, 0));
1028+
background-position: left center, right center, left center, right center;
1029+
background-repeat: no-repeat;
1030+
background-size: 12px 100%, 12px 100%, 10px 100%, 10px 100%;
1031+
background-attachment: local, local, scroll, scroll;
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 {
@@ -1056,12 +1049,11 @@ li .code-block {
10561049

10571050
.code-type {
10581051
text-transform: uppercase;
1059-
padding: .25rem 0.25rem; /* Padding for button content */
1060-
font-size: 12px; /* Font size */
1061-
z-index: 9999;
1062-
position: absolute;
1063-
background-color: white;
1064-
margin: -12px 0 0 1rem;
1052+
border: 1px solid #cccccc;
1053+
border-bottom: 1px solid white;
1054+
padding: .25rem 1rem;
1055+
font-size: 12px;
1056+
margin-bottom: -1px;
10651057
}
10661058

10671059
.code-container:hover {

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)