MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / getCssVariable

Method getCssVariable

packages/core/ui/styling/style/index.ts:68–87  ·  view source on GitHub ↗
(varName: string)

Source from the content-addressed store, hash-verified

66 }
67
68 public getCssVariable(varName: string): string | null {
69 const view = this.view;
70 if (!view) {
71 return null;
72 }
73
74 if (this.unscopedCssVariables.has(varName)) {
75 return this.unscopedCssVariables.get(varName);
76 }
77
78 if (this.scopedCssVariables.has(varName)) {
79 return this.scopedCssVariables.get(varName);
80 }
81
82 if (!view.parent || !view.parent.style) {
83 return null;
84 }
85
86 return view.parent.style.getCssVariable(varName);
87 }
88
89 public resetScopedCssVariables() {
90 this.scopedCssVariables.clear();

Callers 1

Calls 1

getMethod · 0.65

Tested by

no test coverage detected