Skip to content

Commit 6d99370

Browse files
authored
Merge pull request #308 from nginxinc/codeblock-design
Codeblock update design
2 parents 2439193 + 4163859 commit 6d99370

File tree

1 file changed

+31
-9
lines changed

1 file changed

+31
-9
lines changed

assets/css/v2/style.css

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ textarea:not([rows]) {
156156
--color-inline_codeblock-border: 0.85 0 0;
157157
--color-inline_codeblock-background: 0.98 0 0;
158158
--color-codeblock-border: 0.63 0 0;
159-
--color-codeblock-shadow: 0.92 0 0;
160159
--color-codeblock-background: 1 0 0;
161160
--color-codeblock-highlight: 0.99 0.0479 105.97;
162161
--color-footer: 0.23 0 0;
@@ -199,6 +198,7 @@ textarea:not([rows]) {
199198
--codeblock-comment-space-between: 10px;
200199
--codeblock-horizontal-line-length: 2rem;
201200
--codeblock-horizontal-line-overflow: 0.25rem;
201+
--codeblock-horizontal-padding: 1rem;
202202
--codeblock-border-thickness: 1px;
203203
--codeblock-code-section-padding-left: 1rem;
204204
--codeblock-line-box-side-length: 4px;
@@ -1849,12 +1849,37 @@ a:has(code:not(pre code)) {
18491849

18501850
/* Regular Codeblock */
18511851
.highlight {
1852-
padding: 0 1rem 0 1rem;
1852+
padding: 0 var(--codeblock-horizontal-padding) 0
1853+
var(--codeblock-horizontal-padding);
18531854
position: relative;
18541855
flex: 1;
18551856

1856-
code .cl {
1857-
position: relative;
1857+
code {
1858+
font-size: var(--font-step--1);
1859+
1860+
.cl {
1861+
position: relative;
1862+
}
1863+
}
1864+
1865+
table {
1866+
width: calc(100% + var(--codeblock-horizontal-padding));
1867+
}
1868+
1869+
.lntd:first-child pre code {
1870+
span {
1871+
margin-left: -1rem;
1872+
padding-left: 1rem;
1873+
width: calc(100% + 1rem);
1874+
}
1875+
}
1876+
1877+
pre code .line {
1878+
display: inline;
1879+
}
1880+
1881+
pre code .line.hl {
1882+
display: block;
18581883
}
18591884
}
18601885

@@ -1885,10 +1910,6 @@ a:has(code:not(pre code)) {
18851910
/* margin: 1.5rem 0 0.25rem 0; */
18861911
}
18871912

1888-
.highlight code {
1889-
font-size: 0.875rem;
1890-
}
1891-
18921913
.highlight-v2.single-line {
18931914
display: flex;
18941915
align-items: center;
@@ -1912,7 +1933,7 @@ a:has(code:not(pre code)) {
19121933
}
19131934

19141935
.code-container {
1915-
box-shadow: 2px 2px 0px oklch(var(--color-codeblock-shadow));
1936+
box-shadow: 3px 3px 0px oklch(var(--color-shadow));
19161937
}
19171938

19181939
ol .code-block,
@@ -1960,6 +1981,7 @@ ul .code-block {
19601981
.highlight code .hl {
19611982
width: fit-content;
19621983
min-width: 100%;
1984+
display: block;
19631985
background-color: oklch(var(--color-codeblock-highlight));
19641986
}
19651987

0 commit comments

Comments
 (0)