(themeKey: string)
| 191 | } |
| 192 | |
| 193 | #var(themeKey: string) { |
| 194 | let value = this.values.get(themeKey) |
| 195 | if (!value) { |
| 196 | return null |
| 197 | } |
| 198 | |
| 199 | // Since @theme blocks in reference mode do not emit the CSS variables, we can not assume that |
| 200 | // the values will eventually be set up in the browser (e.g. when using `@apply` inside roots |
| 201 | // that use `@reference`). Ensure we set up a fallback in these cases. |
| 202 | let fallback = null |
| 203 | if (value.options & ThemeOptions.REFERENCE) { |
| 204 | fallback = value.value |
| 205 | } |
| 206 | |
| 207 | return `var(${escape(this.prefixKey(themeKey))}${fallback ? `, ${fallback}` : ''})` |
| 208 | } |
| 209 | |
| 210 | markUsedVariable(themeKey: string): boolean { |
| 211 | let key = unescape(this.#unprefixKey(themeKey)) |
no test coverage detected