Skip to content

Docs: set color-scheme in the custom color mode example - #43272

Merged
julien-deramond merged 1 commit into
mainfrom
v6-jd-custom-color-mode-color-scheme
Nov 2, 2026
Merged

julien-deramond merged 1 commit into
mainfrom
v6-jd-custom-color-mode-color-scheme

Conversation

@julien-deramond

@julien-deramond julien-deramond commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Spotted in julien-deramond/bootstrap-test-playground#202

The "Custom color modes" example, [data-bs-theme="blue"], doesn't set color-scheme. Every light-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-color and --bs-btn-focus-box-shadow, which no button reads any more since focus styles moved to the shared focus-ring mixin.

The example now sets color-scheme: dark and --bs-shadow-strength: 2.4, like the built-in dark mode, and drops the two button tokens (nothing in scss/ reads either). The change is in site/src/scss/_content.scss. A new paragraph under the example's Sass code in site/src/content/docs/customize/color-modes.mdx says that a custom mode should set color-scheme and --bs-shadow-strength.

Docs in light mode Docs in dark mode
Before before, docs in light mode: the heading and the Menu button text are dark on the blue background before, docs in dark mode: the heading and the Menu button text are light
After after, docs in light mode: the heading and the Menu button text are light, as in dark mode after, docs in dark mode: unchanged

These show the example on the "Color modes" page with its menu open, from a local build of the docs on main and 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 dark because the mode sets white body text. A light-on-blue mode that wants light controls would set light, so the new paragraph says "set color-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

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@julien-deramond julien-deramond added docs Documentation site and its content v6 v6, the main branch color-mode Light and dark color modes labels Nov 2, 2026
@julien-deramond julien-deramond added this to the v6.0.0-alpha.2 milestone Nov 2, 2026
@github-project-automation github-project-automation Bot moved this to Inbox in v6.0.0 Nov 2, 2026
@julien-deramond
julien-deramond marked this pull request as ready for review November 2, 2026 18:48
@julien-deramond
julien-deramond requested a review from a team as a code owner November 2, 2026 18:48
@julien-deramond
julien-deramond merged commit e0bbab7 into main Nov 2, 2026
14 checks passed
@julien-deramond
julien-deramond deleted the v6-jd-custom-color-mode-color-scheme branch November 2, 2026 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

color-mode Light and dark color modes docs Documentation site and its content v6 v6, the main branch

Projects

Status: Inbox

Development

Successfully merging this pull request may close these issues.

1 participant