MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / applyCssText

Function applyCssText

packages/vite/hmr/client/css-handler.ts:5–21  ·  view source on GitHub ↗
(cssText: string)

Source from the content-addressed store, hash-verified

3
4// CSS helper function
5export function applyCssText(cssText: string): void {
6 if (typeof cssText !== 'string' || !cssText.length) return;
7
8 try {
9 if (Application.addCss) {
10 Application.addCss(cssText);
11 if (VERBOSE) console.info('[ns-hmr] Applied app CSS');
12 } else {
13 const topFrame = Frame.topmost?.();
14 const curPage = topFrame?.currentPage;
15 curPage.addCss(cssText);
16 if (VERBOSE) console.info('[ns-hmr] Applied page CSS');
17 }
18 } catch (e) {
19 console.warn('[ns-hmr] CSS apply failed:', e?.message || String(e));
20 }
21}
22
23// Fetch helper
24export async function fetchText(url: string): Promise<string> {

Callers 2

handleCssUpdatesFunction · 0.85
handleCustomCssFunction · 0.85

Calls 5

infoMethod · 0.80
warnMethod · 0.80
StringClass · 0.50
addCssMethod · 0.45
topmostMethod · 0.45

Tested by

no test coverage detected