(str: string)
| 169 | } |
| 170 | |
| 171 | const parse = (str: string) => { |
| 172 | try { |
| 173 | return postcss.parse(str) |
| 174 | } catch (error) { |
| 175 | if (error instanceof CssSyntaxError) { |
| 176 | logger.error('tokens:process', error.showSourceCode(true)) |
| 177 | } else { |
| 178 | logger.caughtError('tokens:process', 'Failed to parse token CSS', error) |
| 179 | } |
| 180 | } |
| 181 | } |
| 182 | |
| 183 | export function cleanupSelectors(css: string, varSelector: string) { |
| 184 | // Ignore if invalid CSS |