Skip to content

Style settings

Every colour and size of the plugin is an Expressive Code style setting. The settings are in groups: codeblocks has the settings that every feature shares, and each other group belongs to one feature. The configuration page shows how to change a setting with styleOverrides.

Most colour defaults come from the colours of the Expressive Code theme, such as terminal.ansiBlue, or from another setting. The table says how. A change to codeblocks.accent also changes the markers, the focus ring and the link underlines. A default with two values has one for dark themes and one for light themes. A default with one value applies to both.

The colour defaults meet the contrast targets on the accessibility page. If you change a colour, check its contrast against the code background of each theme.

Shared settings, which every feature uses.

SettingDefaultDescription
accentThe terminal.ansiBlue colour of the theme, with 4.5:1 contrast on the code background.Markers, numbered buttons and active states. Needs 3:1 contrast on the code background.
accentHoveraccent mixed 45% towards codeForeground: lighter in dark themes, darker in light themes.Step borders under the mouse cursor.
accentForegroundThe code background, with 4.5:1 contrast on accent.Text on an accent background.
mutedForegroundcodeForeground mixed 30% towards the code background, with 4.5:1 contrast on it, on popoverBackground, on a 10% tint of codeForeground and on the frame tab bar.Secondary text, such as output and marker labels. Needs 4.5:1 contrast on the code background.
focusRingThe value of codeblocks.accent.The outline of a control that has keyboard focus.
popoverBackgroundThe code background mixed 12% towards accent in dark themes, and lightened in light themes.The background of annotation notes and hover cards.
popoverForegroundcodeForeground, with 4.5:1 contrast on popoverBackground.The text of annotation notes and hover cards.
popoverBorderpopoverBackground mixed 30% towards accent.The border of annotation notes and hover cards.
popoverShadow0 8px 28px rgb(10 14 24 / 0.45) dark
0 8px 28px rgb(12 20 36 / 0.18) light
The shadow of annotation notes and hover cards.
popoverRadius6pxThe corner radius of annotation notes and hover cards.
popoverMaxWidth340pxThe width of annotation notes. Hover cards are 20px wider. Both stay 12px inside the window.
popoverFontSize0.8125remThe text size of annotation notes and hover cards.

Settings of Focus.

SettingDefaultDescription
blur1.1pxThe blur radius of lines outside the focus.
opacity0.48The opacity of lines outside the focus.
transitionDuration250msThe time that the lines take to become clear.

Settings of Line states.

SettingDefaultDescription
barWidth3pxThe width of the bar on the left edge of a line.
labelFontSize0.75remThe text size of messages.
labelRadius3pxThe corner radius of messages.
errorThe editorError.foreground colour of the theme, with 3:1 contrast on the code background.The colour of the error state. The other error settings come from it.
warningThe editorWarning.foreground colour of the theme, with 3:1 contrast on the code background.The colour of the warning state. The other warning settings come from it.
infoThe editorInfo.foreground colour of the theme, with 3:1 contrast on the code background.The colour of the info state. The other info settings come from it.
successThe terminal.ansiGreen colour of the theme, with 3:1 contrast on the code background.The colour of the success state. The other success settings come from it.
<state>BackgroundThe state colour at 15% opacity.The tint of a line with the state. There is one for each state, such as errorBackground.
<state>LabelBackgroundThe state colour at 20% opacity.The background of a message.
<state>LabelForegroundThe state colour mixed with the code colour, with 5:1 contrast on the message background.The text of a message.
<marker>LabelBackgroundExpressive Code's textMarkers.<marker>BorderColor at 20% opacity.The background of a message after [!code ++], [!code --] or [!code highlight]. There is one for each of ins, del and mark, such as insLabelBackground.
<marker>LabelForegroundThe marker colour mixed with the code colour, with 5:1 contrast on the message background.The text of a message after [!code ++], [!code --] or [!code highlight].

Settings of Word-level diff.

SettingDefaultDescription
insThe terminal.ansiGreen colour of the theme.The colour that the tint and the bar of added words come from.
delThe terminal.ansiRed colour of the theme.The colour that the tint and the bar of removed words come from.
insBackgroundins at 25% opacity on dark themes, 40% on light themes.The tint of added words.
delBackgrounddel at 25% opacity on dark themes, 40% on light themes.The tint of removed words.

Settings of Visible whitespace.

SettingDefaultDescription
foregroundcodeForeground at 32% opacity in dark themes and 38% in light themes.The colour of the glyphs.

Settings of Colourised brackets.

SettingDefaultDescription
colour1The editorBracketHighlight.foreground1 colour of the theme, or VS Code's default (#ffd700 dark, #0431fa light`) if the theme has none, with 4.5:1 contrast on the code background.Brackets at the first depth, and at every third depth after it.
colour2The editorBracketHighlight.foreground2 colour of the theme, or VS Code's default (#da70d6 dark, #319331 light`) if the theme has none, with 4.5:1 contrast on the code background.Brackets at the second depth, and at every third depth after it.
colour3The editorBracketHighlight.foreground3 colour of the theme, or VS Code's default (#179fff dark, #7b3814 light`) if the theme has none, with 4.5:1 contrast on the code background.Brackets at the third depth, and at every third depth after it.

Settings of Smart shell copy.

SettingDefaultDescription
promptForegroundThe terminal.ansiCyan colour of the theme, with 4.5:1 contrast on the code background.The colour of prompts.
outputForegroundThe value of codeblocks.mutedForeground.The colour of output lines.

Settings of Code links.

SettingDefaultDescription
underlineThe value of codeblocks.accent.The underline of a link. Needs 3:1 contrast on the code background.
hoverBackgroundcodeblocks.accent at 10% opacity in dark themes and 12% in light themes.The background of a link on hover and focus.

Settings of API auto-linking.

SettingDefaultDescription
underlinecodeForeground mixed 45% towards the code background, with 3:1 contrast on it.The dotted underline of a link. Needs 3:1 contrast on the code background.
hoverUnderlineThe value of codeblocks.accent.The solid underline of a link on hover and focus.
hoverBackgroundcodeblocks.accent at 10% opacity in dark themes and 12% in light themes.The background of a link on hover and focus.

Settings of Code mentions.

SettingDefaultDescription
barThe value of codeblocks.accent.The bar on the left edge of a highlighted line.
backgroundbar at 10% opacity in dark themes and 12% in light themes.The tint of a highlighted line. Needs 4.5:1 contrast for every syntax colour.
fadeOpacity0.42The opacity of the other lines while lines are highlighted.

Settings of Line permalinks.

SettingDefaultDescription
foregroundThe gutter colour of the theme, with 4.5:1 contrast on the code background.The colour of the line numbers.
targetThe terminal.ansiYellow colour of the theme, with 3:1 contrast on the code background.The bar on the left edge of a highlighted line.
targetBackgroundtarget at 6% opacity in dark themes and 12% in light themes.The tint of a highlighted line.

Settings of Hidden lines.

SettingDefaultDescription
badgeBackgroundcodeblocks.mutedForeground at 10% opacity on the code background.The background of the text on a marker.
rulecodeblocks.mutedForeground at 35% opacity.The dashed rule of a marker.
ruleHoverThe value of codeblocks.mutedForeground.The dashed rule of a marker under the mouse cursor.
ruleOpencodeblocks.mutedForeground at 22% opacity.The dashed rule of a marker while its lines show.
openBackgroundcodeForeground at 4% opacity.The tint of a hidden line that shows.
openOpacity0.75The opacity of the code of a hidden line that shows.

Settings of Run code.

SettingDefaultDescription
outputForegroundThe terminal.ansiGreen colour of the theme, with 4.5:1 contrast on the code background.Standard output. Needs 4.5:1 contrast on the code background.
errorForegroundThe terminal.ansiRed colour of the theme, with 4.5:1 contrast on the code background.Standard error and run errors. Needs 4.5:1 contrast on the code background.
buttonBordercodeForeground mixed 50% towards the code background, with 3:1 contrast on it.The border of the button under the block. Needs 3:1 contrast on the code background.

Settings of File icons.

SettingDefaultDescription
size0.85emThe width and height of a file icon in the plain style.
darkVariantDisplayblock in dark themes, none in light themes.The display of an icon that the set has a light variant of.
lightVariantDisplaynone in dark themes, block in light themes.The display of the light variant of an icon.
foregroundcurrentColorThe colour of a file icon in the plain style. By default, the colour of the title.
tileSize1.1emThe width and height of the square in the tile style.
tileRadius22%The corner radius of the square in the tile style.
tileBackgroundThe value of codeblocks.accent.The colour of the square in the tile style.
tileForegroundaccentForeground.The colour of the icon on the square in the tile style.

Settings of Code walkthrough.

SettingDefaultDescription
stepBordercodeForeground mixed 50% towards the code background, with 3:1 contrast on it.The border of a step that is not done yet.
doneForegroundcodeblocks.accent mixed 50% towards codeForeground, with 4.5:1 contrast on the code background.The number of a step that is done.
lineThe code background mixed 15% towards codeForeground.The line between two steps that are not done yet.
duration480msThe time that the animation between two steps takes, in ms or s.
newLineBackgroundThe terminal.ansiGreen colour of the theme at 30% opacity.The tint that flashes on a line that is new in a step, then fades out.
newLineDuration1000msThe time that the tint of a new line takes to fade out.
themeIndexThe index of the theme in the Expressive Code themes list.The index of the theme, which the animation reads to pick token colours. Do not change it.

Settings of Inline callouts.

SettingDefaultDescription
backgroundThe value of codeblocks.popoverBackground.The background of a bubble.
foregroundThe value of codeblocks.popoverForeground.The text of a bubble.
borderThe value of codeblocks.popoverBorder.The border and the arrow of a bubble.
fontSize0.925emThe text size of a bubble.
radius5pxThe corner radius of a bubble.

Settings of Annotations.

SettingDefaultDescription
markerBackgroundThe value of codeblocks.accent.The background of a numbered marker.
markerForegroundThe value of codeblocks.accentForeground.The number on a marker.
markerHoverBackgroundmarkerBackground mixed 45% towards codeForeground.The background of a marker under the mouse cursor, with keyboard focus or with its note open.
markerSize1.55emThe width and height of a marker.
lineBackgroundcodeblocks.accent at 10% opacity in dark themes and 12% in light themes.The tint of the line of an open annotation. Needs 4.5:1 contrast for every syntax colour.
outlineAccentThe terminal.ansiMagenta colour of the theme, with 4.5:1 contrast on the code background.With style: 'outline': the border of a marker, the bar of a lit line and the background of an active marker.
outlineNumberForegroundoutlineAccent mixed 30% towards codeForeground, with 4.5:1 contrast on the code background and on outlineLineBackground.With style: 'outline': the numbers. Needs 4.5:1 contrast on the code background.
outlineActiveForegroundThe code background, with 4.5:1 contrast on outlineAccent.With style: 'outline': the number of an active marker, on an outlineAccent background.
outlineLineBackgroundoutlineAccent at 10% opacity, on the code background.With style: 'outline': the tint of a lit line. Needs 4.5:1 contrast for every syntax colour.

Settings of Footnotes.

SettingDefaultDescription
accentThe value of codeblocks.accent.The background of a badge and the bar of a selected line.
numberForegroundaccent mixed 30% towards codeForeground, with 4.5:1 contrast on the code background and on lineBackground.List numbers. Needs 4.5:1 contrast on the code background.
activeForegroundThe code background, with 4.5:1 contrast on accent.The number on a badge, on an accent background.
activeBackgroundaccent mixed 45% towards codeForeground.The background of a badge under the mouse cursor, with keyboard focus or on a selected line.
lineBackgroundaccent at 10% opacity in dark themes and 12% in light themes, on the code background.The tint of a selected line. Needs 4.5:1 contrast for every syntax colour.
outlineAccentThe terminal.ansiMagenta colour of the theme, with 4.5:1 contrast on the code background.With style: 'outline': the border of a badge, the bar of a lit line and the background of an active badge.
outlineNumberForegroundoutlineAccent mixed 30% towards codeForeground, with 4.5:1 contrast on the code background and on outlineLineBackground.With style: 'outline': the numbers. Needs 4.5:1 contrast on the code background.
outlineActiveForegroundThe code background, with 4.5:1 contrast on outlineAccent.With style: 'outline': the number of an active badge, on an outlineAccent background.
outlineLineBackgroundoutlineAccent at 10% opacity, on the code background.With style: 'outline': the tint of a lit line. Needs 4.5:1 contrast for every syntax colour.
stickyShadow0 -8px 16px rgb(10 14 24 / 0.35) dark
0 -6px 14px rgb(12 20 36 / 0.1) light
The shadow above a sticky list of footnotes.