Repository navigation
Docs: set color-scheme in the custom color mode example - #43272
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
julien-deramond
marked this pull request as ready for review
November 2, 2026 18:48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Spotted in julien-deramond/bootstrap-test-playground#202
The "Custom color modes" example,
[data-bs-theme="blue"], doesn't setcolor-scheme. Everylight-dark()color it doesn't override follows the page's color mode instead, so the blue example changes when the docs switch between light and dark. In light mode, the "Example blue theme" heading and the "Menu" button text turn dark on the blue background. The example also sets--bs-btn-focus-border-colorand--bs-btn-focus-box-shadow, which no button reads any more since focus styles moved to the sharedfocus-ringmixin.The example now sets
color-scheme: darkand--bs-shadow-strength: 2.4, like the built-in dark mode, and drops the two button tokens (nothing inscss/reads either). The change is insite/src/scss/_content.scss. A new paragraph under the example's Sass code insite/src/content/docs/customize/color-modes.mdxsays that a custom mode should setcolor-schemeand--bs-shadow-strength.These show the example on the "Color modes" page with its menu open, from a local build of the docs on
mainand on this branch. The theme picker is on auto, with the system set to light and then to dark. Before, the heading and the button text change with the mode. After, the example looks the same in both.I picked
darkbecause the mode sets white body text. A light-on-blue mode that wants light controls would setlight, so the new paragraph says "setcolor-scheme" and doesn't hard-code the value.The example is on the deploy preview: https://deploy-preview-43272--twbs-bootstrap.netlify.app/docs/6.0/customize/color-modes/
🤖 Generated with Claude Code