Skip to content

Style Overrides

You can add a styleOverrides object to the engine configuration to customize the appearance of the rendered code blocks without having to write custom CSS.

The root level of this object contains core style settings like colors, fonts, paddings and more. Plugins can contribute their plugin style settings by adding a nested object with the plugin’s name as key. For example, if the frames plugin is enabled, you can override its shadowColor by setting styleOverrides.frames.shadowColor to a color value.

If any of the settings are not given, default values will be used or derived from the theme.

Type: UnresolvedStyleValue Default: ({ theme }) => theme.colors['titleBar.border'] || lighten(theme.colors['editor.background'], theme.type === 'dark' ? 0.5 : -0.15) || 'transparent'

Border color of code blocks.

Type: UnresolvedStyleValue Default: '0.3rem'

Border radius of code blocks.

Type: UnresolvedStyleValue Default: '1.5px'

Border width of code blocks.

Type: UnresolvedStyleValue Default: ({ theme }) => theme.colors['editor.background']

Background color of code blocks.

Type: UnresolvedStyleValue Default: "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace"

Font family of code content.

Type: UnresolvedStyleValue Default: '0.85rem'

Font size of code content.

Type: UnresolvedStyleValue Default: '400'

Font weight of code content.

Type: UnresolvedStyleValue Default: ({ theme }) => theme.colors['editor.foreground']

Foreground color of code, unless overwritten by syntax highlighting.

Type: UnresolvedStyleValue Default: '1.65'

Font line height of code content.

Type: UnresolvedStyleValue Default: '1rem'

Block-level padding (= top and bottom padding in horizontal writing mode) around the code content inside code blocks.

Type: UnresolvedStyleValue Default: '1.35rem'

Inline-level padding (= left and right padding in horizontal writing mode) around the code content inside code blocks.

Type: UnresolvedStyleValue Default: ({ theme }) => theme.colors['editor.selectionBackground']

Background color of selected code, unless selection color customization is disabled by the option useThemedSelectionColors.

Type: UnresolvedStyleValue Default: ({ theme }) => theme.colors['focusBorder']

Color of the focus border around focused elements.

Type: UnresolvedStyleValue Default: ({ theme }) => theme.colors['scrollbarSlider.background']

Color of the scrollbar thumb, unless scrollbar color customization is disabled by the option useThemedScrollbars.

Type: UnresolvedStyleValue Default: ({ theme }) => theme.colors['scrollbarSlider.hoverBackground']

Color of the scrollbar thumb when hovered, unless scrollbar color customization is disabled by the option useThemedScrollbars.

Type: UnresolvedStyleValue Default: "ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'"

Font family of UI elements.

Type: UnresolvedStyleValue Default: '0.9rem'

Font size of UI elements.

Type: UnresolvedStyleValue Default: '400'

Font weight of UI elements.

Type: UnresolvedStyleValue Default: '1.65'

Font line height of UI elements.

Type: UnresolvedStyleValue Default: '0.25rem'

Block-level padding (= top and bottom padding in horizontal writing mode) of UI elements like tabs, buttons etc.

Type: UnresolvedStyleValue Default: '1rem'

Inline-level padding (= left and right padding in horizontal writing mode) of UI elements like tabs, buttons etc.

Type: UnresolvedStyleValue Default: ({ theme }) => theme.colors['menu.selectionBackground']

Background color of selected UI elements, unless selection color customization is disabled by the option useThemedSelectionColors.

Type: UnresolvedStyleValue Default: ({ theme }) => theme.colors['menu.selectionForeground']

Foreground color of selected UI elements, unless selection color customization is disabled by the option useThemedSelectionColors.

Type: FramesStyleSettings Default: {}

Allows you to override frames style settings to customize the appearance of the frames rendered around code blocks.

Type: TextMarkersStyleSettings Default: {}

Allows you to override text markers style settings to customize the appearance of the text markers used to highlight parts inside code blocks.

Allows you to override collapsible sections style settings to customize the appearance of collapsed and expanded sections inside code blocks.