Skip to content

Commit add422d

Browse files
committed
Fix syntax highlighting colors being overridden by body text color
Add explicit color rules for .highlight pre/code elements in @layer base to ensure Rouge syntax highlighting colors take precedence over Tailwind's body text color inheritance.
1 parent 50ccd99 commit add422d

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

stylesheets/compiled.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1962,6 +1962,20 @@ body:is(.dark *){
19621962
color: rgb(250 250 249 / var(--tw-text-opacity, 1));
19631963
}
19641964

1965+
/* Ensure syntax highlighting colors are not overridden by body color */
1966+
1967+
.highlight code {
1968+
color: inherit;
1969+
}
1970+
1971+
.highlight pre {
1972+
color: #333;
1973+
}
1974+
1975+
.dark .highlight pre {
1976+
color: #c9d1d9;
1977+
}
1978+
19651979
.container{
19661980
width: 100%;
19671981
margin-right: auto;

stylesheets/tailwind.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,15 @@
2323
@apply bg-white text-stone-900 text-base leading-5 font-default;
2424
@apply dark:bg-stone-900 dark:text-stone-50;
2525
}
26+
27+
/* Ensure syntax highlighting colors are not overridden by body color */
28+
.highlight code {
29+
color: inherit;
30+
}
31+
.highlight pre {
32+
color: #333;
33+
}
34+
.dark .highlight pre {
35+
color: #c9d1d9;
36+
}
2637
}

0 commit comments

Comments
 (0)