-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.html
43 lines (42 loc) · 1.31 KB
/
demo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Css-Vars Design Token Demo</title>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<script src="/node_modules/react/umd/react.production.min.js"></script>
<script src="/node_modules/react-dom/umd/react-dom.production.min.js"></script>
<script src="/dist/bundle.js"></script>
<style>
* {
background-color: var(--primary);
color: var(--secondary);
}
</style>
</head>
<body>
<div id="root"></div>
<script type="text/babel">
function App() {
const { toggle } = CssVarsDesignToken.useCssVarsDesignTokenContext();
return (
<div>
<h1>CssVars & Design Token</h1>
<button onClick={toggle}>toggle</button>
</div>
);
}
ReactDOM.createRoot(document.getElementById('root')).render(
<CssVarsDesignToken.CssVarsDesignTokenProvider
themes={{
light: { primary: '#333', secondary: '#666' },
dark: { primary: '#fff', secondary: '#ccc' },
}}
>
<App />
</CssVarsDesignToken.CssVarsDesignTokenProvider>,
);
</script>
</body>
</html>