src/content/docs/linter/rules/no-important-in-keyframe.mdx
import { Tabs, TabItem } from '@astrojs/starlight/components';
<Tabs> <TabItem label="CSS" icon="seti:css"> ## Summary - Rule available since: `v1.8.0` - Diagnostic Category: [`lint/suspicious/noImportantInKeyframe`](/reference/diagnostics#diagnostic-category) - This rule is **recommended**, meaning it is enabled by default. - This rule doesn't have a fix. - The default severity of this rule is [**error**](/reference/diagnostics#error). - Sources: - Same as [`keyframe-declaration-no-important`](https://github.com/stylelint/stylelint/blob/main/lib/rules/keyframe-declaration-no-important/README.md){
"linter": {
"rules": {
"suspicious": {
"noImportantInKeyframe": "error"
}
}
}
}
Disallow invalid !important within keyframe declarations
Using !important within keyframes declarations is completely ignored in some browsers.
@keyframes foo {
from {
opacity: 0;
}
to {
opacity: 1 !important;
}
}
@keyframes foo {
from {
opacity: 0;
}
to {
opacity: 1;
}
}