MCPcopy
hub / github.com/OpenWebGAL/WebGAL / applyStyle

Function applyStyle

packages/webgal/src/hooks/useApplyStyle.ts:15–23  ·  view source on GitHub ↗
(classNameLable: string, fallbackClassName: string)

Source from the content-addressed store, hash-verified

13 const replaced = useStageState().replacedUIlable;
14
15 const applyStyle = (classNameLable: string, fallbackClassName: string) => {
16 // 先看看是否被用户用 applyStyle 指令替换了类名
17 const className = replaced?.[classNameLable] ?? classNameLable;
18 if (Object.keys(styleObject.value.classNameStyles).includes(className)) {
19 const cijClassName = css(styleObject.value.classNameStyles?.[className] ?? '');
20 return cijClassName;
21 }
22 return fallbackClassName;
23 };
24
25 const updateStyleObject = () => {
26 styleObject.value = WebGAL.styleObjects.get(ui) ?? { classNameStyles: {}, others: '' };

Callers 4

IMSSTextboxFunction · 0.50
settleTextFunction · 0.50
renderButtonTextFunction · 0.50
TitleFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected