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

Function getEffectiveStyle

packages/base/src/theming/getEffectiveStyle.ts:13–33  ·  view source on GitHub ↗
(ElementClass: typeof UI5Element)

Source from the content-addressed store, hash-verified

11});
12
13const getEffectiveStyle = (ElementClass: typeof UI5Element) => {
14 const tag = ElementClass.getMetadata().getTag();
15 const key = `${tag}_normal`;
16 const openUI5Enablement = getFeature<typeof OpenUI5Enablement>("OpenUI5Enablement");
17
18 if (!effectiveStyleMap.has(key)) {
19 let busyIndicatorStyles = "";
20
21 if (openUI5Enablement) {
22 busyIndicatorStyles = getStylesString(openUI5Enablement.getBusyIndicatorStyles());
23 }
24
25 const customStyle = getCustomCSS(tag) || "";
26 const builtInStyles = getStylesString(ElementClass.styles);
27
28 const effectiveStyle = `${builtInStyles} ${customStyle} ${busyIndicatorStyles}`;
29 effectiveStyleMap.set(key, effectiveStyle);
30 }
31
32 return effectiveStyleMap.get(key)!; // The key is guaranteed to exist
33};
34
35export default getEffectiveStyle;

Callers 1

getConstructableStyleFunction · 0.85

Calls 7

getFeatureFunction · 0.85
getStylesStringFunction · 0.85
getCustomCSSFunction · 0.85
getTagMethod · 0.80
getMetadataMethod · 0.80
getMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…