default background and foreground for inline code in dark mode #13182
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This afternoon I wanted to see if Claude Code could help me navigate our intimidating mountain of SCSS in order to fix
Claude on this task
I fed it
_bootstrap-rules.scss
and_bootstrap-variables.scss
andsass/brand.ts
and told it how we currently can fix the color using brand.yml but we'd prefer to have a decent default.Good ✅
Bad ❌
Conclusions 📊
(This comment was written entirely by human.)
Contents of this PR
This minimal and defensive change changes inline code to use the same default background and foreground colors as the block code, when in dark mode.
Fixes #8568
It leaves the inline code foreground color defaulted to purple in light mode, which seems to be intentional. In dark mode, it uses
#code-block-bg-color
which exists in that mode.I think the fix is correct and safe but it may be more convoluted than we want.
The problem is,
$code-bg
, which controls the inline code background color, has a bad default for dark mode of$gray-100
(in_bootstrap-variables.scss
) but the way to calculate the correct color for dark mode is not known until_bootstrap-rules.scss
.I couldn't
!default
it, or set it outright, so Claude suggested this kludge of checking if$code-bg
has its default setting. 😛I have tested this manually
brand.typography.monospace-inline.background-color
(which is the current workaround for the original bug).No warnings.
Posting draft for CI; will look at Playwright tests next.
Visual design considerations
This is the minimal change, but
git blame
, it took a while to settle on this color.)