Passing :root as a selector?
Hi there
I'm trying to pass a `:root` selector trough `astro-critters` unsuccessfully (so far).
I have some dark mode settings set with `:root[data-theme~='dark']` and I'm trying to get those into the critical css.
```css
:root[data-theme~='dark'] {
--color-default: 128 0 29;
--color-primary: 94 129 172;
...
}
```
So far none of these seem to yield the desired result:
```js
includeSelectors: [/\:root/, /^\:root.*/, /[:]\s*root.*/, /\:root\s*\{([^}]*)\}/, /\:root\[data-theme~=['"][^'"]*['"]\]/, /\:root/, ':root', ':root[data-theme~=\'dark\']'], }
```
By now I'm just throwing everything and seeing what sticks...
Any ideas?
cheers
关闭于 2023-09-24 5 条评论