// https://github.com/callstack/linaria/blob/60962090410ea3878f3c190817c1667a124d7df9/docs/BASICS.md#adding-global-styles
export const globalCSS = css`
:global() {
@import-sanitize;
}
`
Running stylelint on the above code will give:
src/App.tsx
9:3 ✖ Unexpected unknown pseudo-class selector ":global" selector-pseudo-class-no-unknown
My stylelint config is:
extends:
- stylelint-config-recommended
- linaria/stylelint-config
:global(html) works. See #450
Nvm it doesn't, my bad.
We can probably add ignorePseudoClasses: ["global()"] in the default config
This also happens for :export.
Going to close as it has been a while and I'm not sure if this is relevant anymore.
For those who still have this problem, just add this rule to your .stylelintrc:
"rules": {
...
"selector-pseudo-class-no-unknown": [
true,
{
"ignorePseudoClasses": ["global"]
}
]
}
Most helpful comment
For those who still have this problem, just add this rule to your .stylelintrc:
Reference: https://stylelint.io/user-guide/configure#rules