MCPcopy Create free account
hub / github.com/UI5/webcomponents / hasStyle

Function hasStyle

packages/base/src/ManagedStyles.ts:54–60  ·  view source on GitHub ↗
(name: string, value = "")

Source from the content-addressed store, hash-verified

52};
53
54const hasStyle = (name: string, value = ""): boolean => {
55 if (isSSR) {
56 return true;
57 }
58
59 return !!document.adoptedStyleSheets.find(sh => (sh as Record<string, any>)._ui5StyleId === getStyleId(name, value));
60};
61
62const removeStyle = (name: string, value = "") => {
63 document.adoptedStyleSheets = document.adoptedStyleSheets.filter(sh => (sh as Record<string, any>)._ui5StyleId !== getStyleId(name, value));

Callers 1

createOrUpdateStyleFunction · 0.85

Calls 1

getStyleIdFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…