Skip to content

Commit 3a36df9

Browse files
committed
Feat: Allow code base color to be customized with theme config
- Add `theme.color.codeBase` property - Allow syntax highlight default color to set without affecting base color - The codeBase and codeBackground can be set to allow finer control on code text contrast ratios. e.g. Use dark themes for code samples.
1 parent 63251bb commit 3a36df9

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/client/styles/prismTheme.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
const prismTheme = ({ color }) => ({
2+
'&': {
3+
color: color.codeBase,
4+
},
25
[`& .token.comment,
36
& .token.prolog,
47
& .token.doctype,

src/client/styles/theme.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export const color = {
2626
ribbonBackground: '#e90',
2727
ribbonText: '#fff',
2828
// Based on default Prism theme
29+
codeBase: '#333',
2930
codeComment: '#6d6d6d',
3031
codePunctuation: '#999',
3132
codeProperty: '#905',

0 commit comments

Comments
 (0)