Skip to content

Commit 4843bb7

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 4843bb7

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

stylesheets/compiled.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1962,6 +1962,16 @@ 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: var(--color-text-default);
1973+
}
1974+
19651975
.container{
19661976
width: 100%;
19671977
margin-right: auto;

stylesheets/tailwind.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,12 @@
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: var(--color-text-default);
33+
}
2634
}

0 commit comments

Comments
 (0)