Skip to content

Commit 67dcaeb

Browse files
authored
Merge branch 'main' into remove-comments-oncopy
2 parents 9fe221f + f5ea6ef commit 67dcaeb

File tree

3 files changed

+76
-60
lines changed

3 files changed

+76
-60
lines changed

assets/css/v2/style.css

Lines changed: 65 additions & 47 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 {
@@ -707,7 +706,10 @@ atomic-search-layout atomic-layout-section[section="search"] {
707706
position: relative;
708707
}
709708

710-
.sidebar .sidebar-navigation .parent-collapsible-content::before {
709+
.sidebar
710+
.sidebar-navigation
711+
.parent-collapsible-content
712+
li:not(:only-child)::before {
711713
content: "";
712714
position: absolute;
713715
border-left: black 1px solid;
@@ -717,7 +719,11 @@ atomic-search-layout atomic-layout-section[section="search"] {
717719
}
718720

719721
/* First Sidebar Nav Horizontal Lines */
720-
.sidebar .sidebar-navigation .parent-collapsible-content .parent-box::before {
722+
.sidebar
723+
.sidebar-navigation
724+
.parent-collapsible-content
725+
li:not(:only-child)
726+
.parent-box::before {
721727
content: "";
722728
display: block;
723729
border-top: black 1px solid;
@@ -767,7 +773,12 @@ p {
767773
.breadcrumb ol {
768774
list-style: none;
769775
padding: 0;
770-
display: flex;
776+
display: block;
777+
778+
> * {
779+
display: inline;
780+
line-height: 25px;
781+
}
771782
}
772783

773784
.breadcrumb li:after {
@@ -894,16 +905,33 @@ blockquote.side-callout {
894905
}
895906

896907
/* Tabs */
897-
898908
.tabs-container {
899-
position: relative;
900-
z-index: -1;
901-
border-bottom: 1px solid black;
909+
/* border-bottom: 1px solid black; */
902910
white-space: nowrap;
903911

904912
/* Lines extend 1rem into gutter on both sides */
905913
width: calc(100% + 2rem);
906914
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;
907935
}
908936

909937
.nav-tabs {
@@ -915,7 +943,7 @@ blockquote.side-callout {
915943
list-style: none;
916944
display: flex;
917945
justify-content: start;
918-
margin: 0 1rem;
946+
margin: 0;
919947
padding: 0;
920948

921949
> :not(:last-child) {
@@ -925,9 +953,8 @@ blockquote.side-callout {
925953

926954
.nav-item {
927955
border: 1px solid var(--color-tabs-divider);
928-
border-bottom: none;
956+
border-bottom: 1px solid black;
929957
padding: 10px;
930-
position: relative;
931958

932959
a {
933960
text-decoration: none;
@@ -942,22 +969,12 @@ blockquote.side-callout {
942969
/* Change the border colors of li that is has a child with a class "active" */
943970
border-top: 1px solid black;
944971
border-left: 1px solid black;
972+
border-bottom: none;
945973

946974
/* Change the border of next child */
947975
+ li {
948976
border-left: 1px solid black;
949977
}
950-
951-
&::after {
952-
content: "";
953-
position: absolute;
954-
display: block;
955-
border-bottom: 1px solid white;
956-
bottom: 0;
957-
left: 0;
958-
width: 100%;
959-
z-index: 9999;
960-
}
961978
}
962979

963980
.nav-item:last-child:has(.active) {
@@ -967,10 +984,7 @@ blockquote.side-callout {
967984

968985
.tab-content {
969986
border-bottom: 1px solid black;
970-
971-
/* Lines extend 1rem into gutter on both sides */
972-
width: calc(100% + 2rem);
973-
margin-left: -1rem;
987+
margin-left: calc(-1 * var(--overflow-gutter-extension));
974988

975989
.tab-pane {
976990
display: none;
@@ -979,10 +993,6 @@ blockquote.side-callout {
979993
margin-left: 1rem;
980994
}
981995

982-
.tab-pane * {
983-
margin-left: 0;
984-
}
985-
986996
.active {
987997
display: block !important;
988998
}
@@ -1001,22 +1011,20 @@ blockquote.side-callout {
10011011
}
10021012

10031013
.code-block {
1004-
grid-column: 1;
1014+
position: static;
10051015
}
10061016

1007-
.icon-code-copy {
1008-
background-color: #f2f2f2;
1009-
border: none;
1010-
padding: 5px 10px;
1011-
cursor: pointer;
1012-
font-family: "JetBrains Mono", monospace;
1013-
font-size: 12px;
1014-
color: #000;
1017+
.code-block .code-header:not(:has(.code-type)) {
1018+
/* Remove margin for codeblocks without a type */
1019+
margin-top: -1.5rem;
1020+
}
1021+
1022+
li .code-block {
1023+
/* For indented code blocks, move 1rem back to align code with text from heading */
1024+
margin-left: -1rem;
10151025
}
10161026

10171027
.highlight-v2 {
1018-
padding: 0 1rem 0 0;
1019-
margin: 0 -1rem 1rem -1rem;
10201028
border-top: 1px solid #cccccc;
10211029
border-bottom: 1px solid #cccccc;
10221030
overflow-x: scroll;
@@ -1026,10 +1034,8 @@ blockquote.side-callout {
10261034
.highlight-v2.single-line {
10271035
display: flex;
10281036
align-items: center;
1029-
padding: 0 1rem 0 0;
10301037
border: 1px solid #cccccc;
10311038
overflow-x: scroll;
1032-
width: calc(100% + (2 * var(--overflow-gutter-extension)));
10331039
}
10341040

10351041
.code-header {
@@ -1043,12 +1049,18 @@ blockquote.side-callout {
10431049

10441050
.code-type {
10451051
text-transform: uppercase;
1046-
border: 1px solid #cccccc;
1047-
border-bottom: 1px solid white;
1048-
padding: .25rem 1rem; /* Padding for button content */
1052+
padding: .25rem 0.25rem; /* Padding for button content */
10491053
font-size: 12px; /* Font size */
10501054
z-index: 9999;
1051-
margin-bottom: -1px;
1055+
position: absolute;
1056+
background-color: white;
1057+
margin: -12px 0 0 1rem;
1058+
}
1059+
1060+
.code-container:hover {
1061+
.code-copy-button {
1062+
display: block;
1063+
}
10521064
}
10531065

10541066
.code-copy-button {
@@ -1059,6 +1071,10 @@ blockquote.side-callout {
10591071
font-family: "JetBrains Mono", monospace;
10601072
font-size: 12px;
10611073
color: #000;
1074+
display: none;
1075+
position: absolute;
1076+
right: calc(25% + 2rem);
1077+
margin-top: 8px;
10621078
}
10631079

10641080
.code-copy-button:hover {
@@ -1081,9 +1097,11 @@ figure {
10811097
margin: 0;
10821098
}
10831099

1100+
img,
10841101
.figure-bitmap {
10851102
margin-bottom: 0.625rem;
10861103
display: inline-block;
1104+
width: 100%;
10871105
max-width: 100%;
10881106
}
10891107

layouts/_default/_markup/render-codeblock.html

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,23 @@
55

66
{{- if $isSingleLine -}}
77
<div class="code-block" data-mf="true" style="display: none;">
8-
<div class="code-header no-lang">
8+
<div class="code-container">
99
<button onclick="copyToClipBoard(this)" data-id-codeblock="{{ $codeBlockId }}" class="code-copy-button" type="button">Copy</button>
10-
</div>
11-
<div class="highlight-v2 single-line" id="{{ $codeBlockId }}">
12-
{{ $result.Wrapped }}
10+
<div class="highlight-v2 single-line" id="{{ $codeBlockId }}">
11+
{{ $result.Wrapped }}
12+
</div>
1313
</div>
1414
</div>
1515
{{- else -}}
1616
<div class="code-block" data-mf="true" style="display: none;">
1717
{{- if and (ne .Type "") (ne .Type "none") -}}
18-
<div class="code-header">
1918
<span class="code-type">{{ .Type }}</span>
20-
<button onclick="copyToClipBoard(this)" data-id-codeblock="{{ $codeBlockId }}" class="code-copy-button" type="button">Copy</button>
21-
</div>
22-
{{- else -}}
23-
<div class="code-header no-lang">
24-
<button onclick="copyToClipBoard(this)" data-id-codeblock="{{ $codeBlockId }}" class="code-copy-button" type="button">Copy</button>
25-
</div>
2619
{{- end -}}
27-
<div class="highlight-v2" id="{{ $codeBlockId }}">
28-
{{ $result.Wrapped }}
20+
<div class="code-container">
21+
<button onclick="copyToClipBoard(this)" data-id-codeblock="{{ $codeBlockId }}" class="code-copy-button multi-line" type="button">Copy</button>
22+
<div class="highlight-v2" id="{{ $codeBlockId }}">
23+
{{ $result.Wrapped }}
24+
</div>
2925
</div>
3026
</div>
3127
{{- end -}}

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)