Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions browser/src/sample-theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* Dormant unless a trusted docs host asks for a theme.
*/

import { configureTheme } from 'igniteui-react';

type ThemeName = 'material' | 'fluent' | 'bootstrap' | 'indigo';
type ThemeMode = 'light' | 'dark' | 'system';
type ResolvedMode = 'light' | 'dark';
Expand Down Expand Up @@ -139,6 +141,10 @@ function applyTheme(theme: ThemeName, mode: ThemeMode): void {
root.setAttribute('data-igd-theme', theme);
root.setAttribute('data-igd-mode', resolved);
root.style.colorScheme = resolved;

// Tell the Shadow DOM / Lit components to re-adopt their
// per-theme stylesheet now that the global CSS is in place.
configureTheme(theme, resolved);
})
.catch((err) => {
console.warn('[sample-theme] Could not load theme "' + theme + '":', err);
Expand Down