codeconsole opened a new pull request, #15941: URL: https://github.com/apache/grails-core/pull/15941
## Summary Adds a Bootstrap 5.3 color-mode (light / dark / auto) switcher to the default generated application, so a freshly created app can toggle and remember its theme out of the box. The generated layout already uses theme-aware Bootstrap utilities and `grails.css` already has `[data-bs-theme=dark]` rules — this wires up the missing UI + persistence. Independent of, and additive to, the i18n language-selector PR (#15940); both live in the same navbar but neither depends on the other. ## Changes **New `theme.js` asset** (clean-room, ASF-licensed — not a copy of Bootstrap's CC-BY docs snippet) - Persists the choice in `localStorage`; toggles `data-bs-theme` on `<html>`; `auto` follows the OS via `prefers-color-scheme` and re-resolves on OS change. - Applied immediately on load and wired to the buttons on `DOMContentLoaded` (updates the active check + toggle icon). **Default layout (`grails-forge` template + classic `web` profile skeleton)** - Loads `theme.js` in the `<head>` so the theme is set before the page paints (no flash of the wrong theme). - Adds a light/dark/auto dropdown to the navbar (Bootstrap Icons, already a dependency). **`grails-forge` `AssetPipeline` feature** - Registers `theme.js` so it is copied into the generated app's `grails-app/assets/javascripts/`. ## Tests - `GrailsGspSpec` gains a check that a generated WEB app ships `theme.js`, loads it in the head, and that the navbar offers the light/dark/auto options. All green. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
