diff --git a/.changeset/warm-coins-refuse.md b/.changeset/warm-coins-refuse.md new file mode 100644 index 00000000000..6949b4ddb2f --- /dev/null +++ b/.changeset/warm-coins-refuse.md @@ -0,0 +1,5 @@ +--- +'@astrojs/starlight': patch +--- + +Fixes colour contrast correction in code blocks diff --git a/packages/starlight/integrations/expressive-code/theming.ts b/packages/starlight/integrations/expressive-code/theming.ts index 39f96b1737f..e207aac3895 100644 --- a/packages/starlight/integrations/expressive-code/theming.ts +++ b/packages/starlight/integrations/expressive-code/theming.ts @@ -79,6 +79,7 @@ export function applyStarlightUiThemeColors(theme: ExpressiveCodeTheme) { // Set theme `bg` color property for contrast calculations theme.bg = isDark ? '#23262f' : '#f6f7f9'; + theme.colors['editor.background'] = theme.bg; // Set actual background color to the appropriate Starlight CSS variable const editorBackgroundColor = isDark ? 'var(--sl-color-gray-6)' : 'var(--sl-color-gray-7)';