From 6b4203b5e559de2168cc791b34777b01eba01fc8 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Tue, 13 Oct 2026 20:29:37 +0200 Subject: [PATCH] Enable dark mode of Bootstrap --- CHANGELOG.md | 1 + apps/client/src/app/app.component.ts | 2 ++ apps/client/src/styles/bootstrap.scss | 1 - libs/ui/.storybook/preview.js | 14 +++++++++++++- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d05f916dfd..f53d995772 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Improved the colors of the muted texts and borders by enabling the dark mode of `bootstrap` - Upgraded `bootstrap` from version `4.6.2` to `5.3.8` ## 3.86.0 - 2026-10-13 diff --git a/apps/client/src/app/app.component.ts b/apps/client/src/app/app.component.ts index fba00e1c47..c9e124723d 100644 --- a/apps/client/src/app/app.component.ts +++ b/apps/client/src/app/app.component.ts @@ -350,9 +350,11 @@ export class GfAppComponent implements OnInit { if (isDarkColorScheme(userPreferredColorScheme)) { this.document.body.classList.add('theme-dark'); this.document.body.classList.remove('theme-light'); + this.document.documentElement.setAttribute('data-bs-theme', 'dark'); } else { this.document.body.classList.add('theme-light'); this.document.body.classList.remove('theme-dark'); + this.document.documentElement.setAttribute('data-bs-theme', 'light'); } this.document diff --git a/apps/client/src/styles/bootstrap.scss b/apps/client/src/styles/bootstrap.scss index 23086c46b6..8237a9fb22 100644 --- a/apps/client/src/styles/bootstrap.scss +++ b/apps/client/src/styles/bootstrap.scss @@ -25,7 +25,6 @@ $container-max-widths: ( xl: 1140px ); $cyan: #17a2b8; -$enable-dark-mode: false; $enable-rfs: false; $enable-smooth-scroll: false; $figure-caption-font-size: 90%; diff --git a/libs/ui/.storybook/preview.js b/libs/ui/.storybook/preview.js index c29b26fd61..dbef588032 100644 --- a/libs/ui/.storybook/preview.js +++ b/libs/ui/.storybook/preview.js @@ -1,5 +1,8 @@ import '@angular/localize/init'; -import { withThemeByClassName } from '@storybook/addon-themes'; +import { + withThemeByClassName, + withThemeByDataAttribute +} from '@storybook/addon-themes'; const preview = { decorators: [ @@ -10,6 +13,15 @@ const preview = { Dark: 'theme-dark', Light: 'theme-light' } + }), + withThemeByDataAttribute({ + attributeName: 'data-bs-theme', + defaultTheme: 'Light', + parentSelector: 'html', + themes: { + Dark: 'dark', + Light: 'light' + } }) ] };