Theme Configuration
Configure theme settings
ts
purrmdTheme({
...
}),Theme Mode - mode
'light'Default theme, light mode'dark'Default theme, dark mode'dracula'Dracula theme, dark mode'base'Only includes essential base theme
Primary Color - primaryColor
string|undefinedPrimary color, only supported whenmodeis'light'|'dark'|'dracula'
Markdown Marker Color - formattingColor
string|undefinedMarkdown marker color, defaults toprimaryColor
Markdown Marker Opacity - formattingOpacity
string|undefinedMarkdown marker opacity, defaults to'0.8'
Dark Mode - isDark
boolean|undefinedWhether it is dark mode, defaults to following themodesetting
CSS Variables
Supports using CSS variables to override the themeSupports using CSS variables to override the theme
ts
const theme = EditorView.theme(
{
'.cm-content': {
'--purrmd-primary-color': 'blue',
...
},
},
{
dark: false,
},
);
const view = new EditorView({
parent: document.getElementById('root')!,
extensions: [
theme,
purrmd(),
purrmdTheme(),
],
});scss
// Primary color
--purrmd-primary-color
// Marker color
--purrmd-formatting-color
// Marker opacity
--purrmd-formatting-opacity
// ...For more CSS variables, refer to: packages/core/src/core/themes/base/markdown