(css: string, selector: string)
| 103 | } |
| 104 | |
| 105 | function extractEffectiveBlock(css: string, selector: string): string | null { |
| 106 | const block = extractBlock(css, selector); |
| 107 | if (block === null) { |
| 108 | return null; |
| 109 | } |
| 110 | |
| 111 | if (!selector.startsWith(".") || !selector.includes("-")) { |
| 112 | return block; |
| 113 | } |
| 114 | |
| 115 | const themeName = selector.slice(1) as ConcreteThemeName; |
| 116 | const baseBlock = extractBlock(css, `.${baseModeFor(themeName)}`); |
| 117 | if (baseBlock === null) { |
| 118 | return null; |
| 119 | } |
| 120 | return `${baseBlock}\n${block}`; |
| 121 | } |
| 122 | |
| 123 | describe("theme CSS variables", () => { |
| 124 | const cssPath = path.resolve(__dirname, "../index.css"); |
no test coverage detected