Skip to content

Commit 5d9bf83

Browse files
authored
fix: codeblock line nums (#22866)
1 parent 4cda46d commit 5d9bf83

File tree

5 files changed

+10
-26
lines changed

5 files changed

+10
-26
lines changed

assets/css/global.css

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,6 @@ input[type="search"]::-moz-search-cancel-button {
3939
input[type="search"]::-ms-clear {
4040
display: none;
4141
}
42-
.prose {
43-
code {
44-
@apply !bg-gray-100;
45-
}
46-
& .highlight,
47-
& :not(pre) > code {
48-
.dark & {
49-
background: var(--color-gray-900) !important;
50-
border-color: var(--color-gray-700) !important;
51-
}
52-
}
53-
}
5442

5543
.prose {
5644
li {

assets/css/syntax-dark.css

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,15 @@
1414
/* LineHighlight */
1515
.hl {
1616
min-width: fit-content;
17-
background-color: var(--color-gray-700);
18-
}
19-
.lntd:first-child .hl,
20-
& > .chroma > code > .hl {
21-
margin-left: -4px;
22-
border-left: 4px solid var(--color-gray-900);
17+
background-color: var(--color-gray-800);
2318
}
2419
/* LineNumbersTable */
2520
.lnt {
2621
white-space: pre;
2722
user-select: none;
2823
margin-right: 0.4em;
2924
padding: 0 0.4em 0 0.4em;
30-
color: var(--color-gray-900);
25+
color: var(--color-gray-300);
3126
}
3227
/* LineNumbers */
3328
.ln {

assets/css/syntax-light.css

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,7 @@
1414
/* LineHighlight */
1515
.hl {
1616
min-width: fit-content;
17-
background-color: var(--color-blue-100);
18-
}
19-
.lntd:first-child .hl,
20-
& > .chroma > code > .hl {
21-
margin-left: -4px;
22-
border-left: 4px solid var(--color-blue-300);
17+
background-color: var(--color-gray-100);
2318
}
2419
/* LineNumbersTable */
2520
.lnt {

assets/css/theme.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,4 +200,7 @@
200200
--color-yellow-hover: rgba(235, 156, 0, 0.12);
201201
--color-yellow-outlinedborder: rgba(235, 156, 0, 0.56);
202202
--color-yellow-selected: rgba(235, 156, 0, 0.16);
203+
204+
--tw-prose-code-bg: var(--color-gray-100);
205+
--tw-prose-code-bg-dark: var(--color-gray-800);
203206
}

assets/css/utilities.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,10 @@
153153
}
154154

155155
:not(pre) > code {
156-
background: var(--color-gray-200);
156+
background: var(--tw-prose-code-bg);
157+
.dark & {
158+
background: var(--tw-prose-code-bg-dark);
159+
}
157160
display: inline-block;
158161
margin: 0;
159162
font-weight: 400;

0 commit comments

Comments
 (0)