spectacle
spectacle copied to clipboard
Support CodePane font change
Description
Currently, fonts used in CodePane are hardcoded into the themes.
Proposal
I propose to support customizing of them may be the same way we can customize other fonts now
Links / References
Currently I've written dirty hack to monkey patch it in runtime,
import codeTheme from 'react-syntax-highlighter/dist/cjs/styles/prism/material-dark';
const changeFont = obj => {
if (typeof obj === 'object') {
for (const keys in obj) {
if (typeof obj[keys] === 'object') {
changeFont(obj[keys])
} else {
if (keys==="fontFamily"){
obj[keys] = '"JetBrains Mono", monospace'
}
}
}
}
return obj;
};
changeFont(codeTheme)
But of course, it's not how it should be done.