Commit 06c82f8 1 parent 26bb1e3 commit 06c82f8 Copy full SHA for 06c82f8
File tree 3 files changed +5
-5
lines changed
3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import URLSearchParams from '@ungap/url-search-params';
6
6
import { Component } from '@storybook/addon-docs' ;
7
7
import { Parameters } from '@storybook/react' ;
8
8
9
- import Theme , { applyTheme } from '../src/global/theme' ;
9
+ import Theme , { applyTheme , GLOBAL_DARK_CLASS_NAME } from '../src/global/theme' ;
10
10
11
11
import styles from './preview.css' ;
12
12
import strictModeDecorator from './strict-mode-decorator' ;
@@ -47,7 +47,7 @@ export const parameters = {
47
47
default : 'Light' ,
48
48
list : [
49
49
{ name : 'Light' , color : '#FFF' } ,
50
- { name : 'Dark' , class : 'ring-ui-theme-dark' , color : '#23272b' }
50
+ { name : 'Dark' , class : GLOBAL_DARK_CLASS_NAME , color : '#23272b' }
51
51
]
52
52
}
53
53
} ;
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import Text from '../text/text';
5
5
6
6
import Select from '../select/select' ;
7
7
8
- import Theme , { ThemeProvider } from './theme' ;
8
+ import Theme , { GLOBAL_DARK_CLASS_NAME , ThemeProvider } from './theme' ;
9
9
10
10
export default {
11
11
title : 'Components/Theme Provider'
@@ -29,7 +29,7 @@ const ThemedWrapper: React.FC<{children: React.ReactNode}> = ({children}) => (
29
29
export const basic = ( ) => {
30
30
const ThemeExample : React . FC = ( ) => (
31
31
< div >
32
- < div className = "ring-ui-theme-dark" >
32
+ < div className = { GLOBAL_DARK_CLASS_NAME } >
33
33
< ThemedWrapper >
34
34
< Text > This is dark (via global css class)</ Text >
35
35
</ ThemedWrapper >
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ enum Theme {
29
29
30
30
export const ThemeContext = createContext < { theme : Theme . LIGHT | Theme . DARK } > ( { theme : Theme . LIGHT } ) ;
31
31
32
- const GLOBAL_DARK_CLASS_NAME = 'ring-ui-theme-dark' ;
32
+ export const GLOBAL_DARK_CLASS_NAME = 'ring-ui-theme-dark' ;
33
33
34
34
const darkMatcher = window . matchMedia ( '(prefers-color-scheme: dark)' ) ;
35
35
You can’t perform that action at this time.
0 commit comments