diff --git a/angular/demo/src/app/app.component.ts b/angular/demo/src/app/app.component.ts index 223b5058a9..f53abaa24c 100644 --- a/angular/demo/src/app/app.component.ts +++ b/angular/demo/src/app/app.component.ts @@ -1,3 +1,4 @@ +import type {OnInit} from '@angular/core'; import {Component} from '@angular/core'; import {RouterModule} from '@angular/router'; @@ -11,4 +12,14 @@ import {RouterModule} from '@angular/router'; `, }) -export class AppComponent {} +export class AppComponent implements OnInit { + ngOnInit() { + window.addEventListener('storage', (event) => { + if (event.key === 'theme') { + if (event.newValue) { + document.documentElement.setAttribute('data-bs-theme', event.newValue); + } + } + }); + } +} diff --git a/angular/demo/src/app/samples/rating/form.route.ts b/angular/demo/src/app/samples/rating/form.route.ts index e541e87d02..314b88e688 100644 --- a/angular/demo/src/app/samples/rating/form.route.ts +++ b/angular/demo/src/app/samples/rating/form.route.ts @@ -13,7 +13,7 @@ import {FormControl, ReactiveFormsModule, Validators} from '@angular/forms';
Model: {{ ctrl.value }}
diff --git a/angular/demo/src/index.html b/angular/demo/src/index.html
index 6efa1bc4db..f0c1c9e689 100644
--- a/angular/demo/src/index.html
+++ b/angular/demo/src/index.html
@@ -6,6 +6,12 @@
Model:{' '} diff --git a/react/demo/src/index.html b/react/demo/src/index.html index 94e1103750..89c901a3be 100644 --- a/react/demo/src/index.html +++ b/react/demo/src/index.html @@ -6,6 +6,12 @@Vite App + diff --git a/react/demo/src/main.tsx b/react/demo/src/main.tsx index a57e093c95..e24017b970 100644 --- a/react/demo/src/main.tsx +++ b/react/demo/src/main.tsx @@ -53,6 +53,14 @@ const router = createHashRouter([ }, ]); +window.addEventListener('storage', (event) => { + if (event.key === 'theme') { + if (event.newValue) { + document.documentElement.setAttribute('data-bs-theme', event.newValue); + } + } +}); + ReactDOM.createRoot(document.getElementById('root')!).render( diff --git a/svelte/demo/src/app/App.svelte b/svelte/demo/src/app/App.svelte index 319b48366a..9f3f600f2b 100644 --- a/svelte/demo/src/app/App.svelte +++ b/svelte/demo/src/app/App.svelte @@ -1,7 +1,17 @@diff --git a/svelte/demo/src/app/index.html b/svelte/demo/src/app/index.html index 5183465197..74b39c9a7f 100644 --- a/svelte/demo/src/app/index.html +++ b/svelte/demo/src/app/index.html @@ -6,6 +6,12 @@Svelte App + diff --git a/svelte/demo/src/app/samples/rating/Form.route.svelte b/svelte/demo/src/app/samples/rating/Form.route.svelte index 4e8137ef0c..50924dd739 100644 --- a/svelte/demo/src/app/samples/rating/Form.route.svelte +++ b/svelte/demo/src/app/samples/rating/Form.route.svelte @@ -17,7 +17,7 @@Thanks!{/if} {#if ctrl.invalid} -Please rate us+Please rate us{/if}Model: {ctrl.value}