Skip to content

Commit

Permalink
Fix: Allow code base color to be customized with theme config (#1335)
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
abhishekdev authored and Artem Sapegin committed Apr 16, 2019
1 parent 63251bb commit 49f1007
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/client/styles/prismTheme.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
const prismTheme = ({ color }) => ({
'&': {
color: color.codeBase,
},
[`& .token.comment,
& .token.prolog,
& .token.doctype,
Expand Down
1 change: 1 addition & 0 deletions src/client/styles/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const color = {
ribbonBackground: '#e90',
ribbonText: '#fff',
// Based on default Prism theme
codeBase: '#333',
codeComment: '#6d6d6d',
codePunctuation: '#999',
codeProperty: '#905',
Expand Down

0 comments on commit 49f1007

Please sign in to comment.