Skip to content

Commit a1eef9e

Browse files
authored
Site code block color adjustment (#5009)
1 parent f7bde94 commit a1eef9e

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.code {
22
--code-padding-vertical: 0.1rem;
3-
--code-padding-horizontal: 0.1rem;
3+
--code-padding-horizontal: 0.25rem;
44
}
55

66
.code {
@@ -9,4 +9,8 @@
99
vertical-align: text-bottom;
1010
white-space: pre-wrap;
1111
padding: var(--code-padding-vertical) var(--code-padding-horizontal);
12+
background-color: var(--salt-container-secondary-background);
13+
border-radius: var(--salt-palette-corner-weaker, 0);
14+
vertical-align: baseline;
15+
border: var(--salt-size-border) var(--salt-container-borderStyle) var(--salt-container-secondary-borderColor);
1216
}

site/src/components/mdx/pre/Pre.module.css

+8-2
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,16 @@
1111
margin: 0;
1212
}
1313

14+
:global([data-mode="light"]) .pre pre,
15+
:global([data-mode="light"]) .pre pre span {
16+
background-color: var(--salt-container-secondary-background, var(--shiki-light-bg));
17+
color: var(--shiki-light);
18+
}
19+
1420
:global([data-mode="dark"]) .pre pre,
1521
:global([data-mode="dark"]) .pre pre span {
16-
background-color: var(--shiki-dark-bg) !important;
17-
color: var(--shiki-dark) !important;
22+
background-color: var(--shiki-dark-bg);
23+
color: var(--shiki-dark);
1824
}
1925

2026
.copyButton {

site/src/components/mdx/pre/Pre.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export const Pre = forwardRef<HTMLDivElement, PreProps>(function Pre(
5151
light: "github-light",
5252
dark: "github-dark",
5353
},
54-
defaultColor: "light",
54+
defaultColor: false,
5555
});
5656

5757
setHtml(html);

0 commit comments

Comments
 (0)