Skip to content

Commit

Permalink
fix: local theme change (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
martyanovandrey authored Jun 13, 2024
1 parent d696288 commit 0b36d30
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@ export function updateRootClassName({
mobileView ? 'mobile' : 'desktop',
wideFormat && 'dc-root_wide-format',
fullHeader && 'dc-root_full-header',
theme === 'light' && 'g-root_theme_light',
theme === 'dark' && 'g-root_theme_dark',
]
.filter(Boolean)
.join(' ');

document.querySelectorAll('.g-root').forEach((el) => {
el.classList.toggle('g-root_theme_light', theme === 'light');
el.classList.toggle('g-root_theme_dark', theme === 'dark');
});
}

export function getDirection(lang: Lang): TextDirection {
Expand Down

0 comments on commit 0b36d30

Please sign in to comment.