Skip to content

Commit 2fd1737

Browse files
committed
minor #1102 [Site] Dark mode theme (smnandre)
This PR was squashed before being merged into the 2.x branch. Discussion ---------- [Site] Dark mode theme Handle "Dark mode" on ux.symfony.com | Homepage | Packages | Markdown | Demo | | - | - | - | - | | ![homepage light](https://github.com/symfony/ux/assets/1359581/1c53b01e-5ade-42c8-8388-79e02a4cf24d) | ![packages light](https://github.com/symfony/ux/assets/1359581/a885c9b7-d0c5-490d-b070-d52cab8ab2dd) | ![markdown light](https://github.com/symfony/ux/assets/1359581/8a73e1a6-3fd8-4305-9ebd-be9dacdfbf21) | ![demo light](https://github.com/symfony/ux/assets/1359581/242900a0-dcb8-4821-af0d-231134c1557c) | | Homepage | Packages | Markdown | Demo | | - | - | - | - | | ![homepage dark](https://github.com/symfony/ux/assets/1359581/7f0ea2ef-1a18-4dcb-860c-bd5db0246ae4) | ![packages dark](https://github.com/symfony/ux/assets/1359581/a71494a7-5c08-4067-8dee-6fccf863a87b) | ![markdown dark](https://github.com/symfony/ux/assets/1359581/2e054ef2-1e85-4e04-bc8a-5971fffedd04) | ![demo dark](https://github.com/symfony/ux/assets/1359581/f74d69de-3d64-4b9b-b32f-21f29730c3df) | (and a couple of minor fixes) Commits ------- 6cf75f5 [Site] Dark mode theme
2 parents 264417e + 6cf75f5 commit 2fd1737

File tree

73 files changed

+1616
-1112
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+1616
-1112
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { Controller } from '@hotwired/stimulus';
2+
3+
export default class extends Controller {
4+
switch() {
5+
const theme = localStorage.getItem('user-theme') === 'dark' ? 'light' : 'dark';
6+
localStorage.setItem('user-theme', theme);
7+
document.documentElement.setAttribute('data-bs-theme', theme);
8+
}
9+
}
Loading
Loading
Loading

ux.symfony.com/assets/images/sf-ux-logo-white.svg

-26
This file was deleted.

ux.symfony.com/assets/images/sf-ux-logo.svg

-1
This file was deleted.
+4
Loading

0 commit comments

Comments
 (0)