Skip to content

Commit

Permalink
Fixes code example colour contrast (#2708)
Browse files Browse the repository at this point in the history
Co-authored-by: Hippo <[email protected]>
  • Loading branch information
delucis and hippotastic authored Jan 10, 2025
1 parent 29a885b commit 442c819
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/warm-coins-refuse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/starlight': patch
---

Fixes colour contrast correction in code blocks
1 change: 1 addition & 0 deletions packages/starlight/integrations/expressive-code/theming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)';

Expand Down

0 comments on commit 442c819

Please sign in to comment.