Commit 2b47ff15 authored by chechunchi's avatar chechunchi

fix build deck styles

parent 5a47c255
Pipeline #28646 passed with stages
in 12 minutes and 1 second
...@@ -67,6 +67,12 @@ const matConfigWithUnit = Object.entries(_matConfigWithUnit).map( ...@@ -67,6 +67,12 @@ const matConfigWithUnit = Object.entries(_matConfigWithUnit).map(
([k, [value, unit]]) => [k, pxTransform(value, unit) as [number, UNIT]], ([k, [value, unit]]) => [k, pxTransform(value, unit) as [number, UNIT]],
) satisfies CSSConfig; ) satisfies CSSConfig;
export function setCssProperties() {
toCssProperties(matConfigWithUnit).forEach(([k, v]) => {
document.body.style.setProperty(k, v);
});
}
export const matConfig = matConfigWithUnit.reduce( export const matConfig = matConfigWithUnit.reduce(
(prev, [key, value]) => ({ (prev, [key, value]) => ({
...prev, ...prev,
...@@ -75,7 +81,3 @@ export const matConfig = matConfigWithUnit.reduce( ...@@ -75,7 +81,3 @@ export const matConfig = matConfigWithUnit.reduce(
}), }),
{} as Record<keyof typeof _matConfigWithUnit, number>, {} as Record<keyof typeof _matConfigWithUnit, number>,
); );
toCssProperties(matConfigWithUnit).forEach(([k, v]) => {
document.body.style.setProperty(k, v);
});
...@@ -40,6 +40,7 @@ import { ...@@ -40,6 +40,7 @@ import {
initSuper, initSuper,
initWASM, initWASM,
} from "./utils"; } from "./utils";
import { setCssProperties } from "../Duel/PlayMat/css";
const NeosConfig = useConfig(); const NeosConfig = useConfig();
...@@ -51,6 +52,10 @@ export const loader: LoaderFunction = async () => { ...@@ -51,6 +52,10 @@ export const loader: LoaderFunction = async () => {
initForbidden(); initForbidden();
initI18N(); initI18N();
initSuper(); initSuper();
// set some styles
setCssProperties();
return null; return null;
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment