Skip to content

Commit

Permalink
fix(ThemeProvider): fix scoped CSS classes
Browse files Browse the repository at this point in the history
  • Loading branch information
amje committed Sep 13, 2023
1 parent fc3a75e commit 1effe63
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/components/theme/ThemeProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import {block} from '../utils/cn';
import {block, blockNew} from '../utils/cn';

import {ThemeContext} from './ThemeContext';
import {ThemeSettingsContext} from './ThemeSettingsContext';
Expand All @@ -10,6 +10,7 @@ import {updateBodyClassName} from './updateBodyClassName';
import {useSystemTheme} from './useSystemTheme';

const b = block(ROOT_CLASS_NAME);
const bNew = blockNew(ROOT_CLASS_NAME);

interface ThemeProviderExternalProps {}

Expand Down Expand Up @@ -65,13 +66,10 @@ export function ThemeProvider({
<ThemeSettingsContext.Provider value={themeSettingsContext}>
{scoped ? (
<div
className={b(
{
theme: themeValue,
'native-scrollbar': nativeScrollbar,
},
className={bNew({theme: themeValue, 'native-scrollbar': nativeScrollbar}, [
b({theme: themeValue, 'native-scrollbar': nativeScrollbar}),
rootClassName,
)}
])}
>
{children}
</div>
Expand Down

0 comments on commit 1effe63

Please sign in to comment.