mirror of
https://github.com/jgthms/bulma
synced 2026-03-20 12:24:28 -07:00
Add Reset button
This commit is contained in:
@@ -49,7 +49,14 @@ function App() {
|
||||
getVar: (id) => {
|
||||
return context.cssvars[id];
|
||||
},
|
||||
updateVar: (id, newValue) => {
|
||||
updateVar: (id, newValue, unit) => {
|
||||
const computedValue = `${newValue}${unit}`;
|
||||
|
||||
document.documentElement.style.setProperty(
|
||||
`--bulma-${id}`,
|
||||
computedValue,
|
||||
);
|
||||
|
||||
setContext((context) => {
|
||||
return {
|
||||
...context,
|
||||
@@ -57,7 +64,7 @@ function App() {
|
||||
...context.cssvars,
|
||||
[id]: {
|
||||
...context.cssvars[id],
|
||||
value: newValue,
|
||||
current: newValue,
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -66,8 +73,6 @@ function App() {
|
||||
};
|
||||
const [context, setContext] = useState(initialContext);
|
||||
|
||||
console.log("ZLOG context", context);
|
||||
|
||||
useEffect(() => {
|
||||
const rootStyle = window.getComputedStyle(document.documentElement);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user