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

Function addCustomCSS

packages/base/src/theming/CustomStyle.ts:34–52  ·  view source on GitHub ↗
(tag: string, css: string)

Source from the content-addressed store, hash-verified

32});
33
34const addCustomCSS = (tag: string, css: string) => {
35 const customCSSFor = getCustomCSSFor();
36 if (!customCSSFor[tag]) {
37 customCSSFor[tag] = [];
38 }
39 customCSSFor[tag].push(css);
40
41 skipRerender = true;
42 try {
43 // The event is fired and the attached event listeners are all called synchronously
44 // The skipRerender flag will be used to avoid calling reRenderAllUI5Elements twice when it is this copy
45 // of CustomStyle.js which is firing the `CustomCSSChange` event.
46 fireCustomCSSChange(tag);
47 } finally {
48 skipRerender = false;
49 }
50
51 return reRenderAllUI5Elements({ tag });
52};
53
54const getCustomCSS = (tag: string) => {
55 const customCSSFor = getCustomCSSFor();

Callers

nothing calls this directly

Calls 4

getCustomCSSForFunction · 0.85
fireCustomCSSChangeFunction · 0.85
reRenderAllUI5ElementsFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…