Disallow unknown at-rules.
CSS contains a number of at-rules, each beginning with a @
, that perform various operations. Some common at-rules include:
@import
@media
@font-face
@keyframes
@supports
@namespace
@page
@charset
It's important to use a known at-rule because unknown at-rules cause the browser to ignore the entire block, including any rules contained within. For example:
/* typo */
@charse "UTF-8";
Here, the @charset
at-rule is incorrectly spelled as @charse
, which means that it will be ignored.
This rule warns when it finds a CSS at-rule that isn't part of the CSS specification. The at-rule data is provided via the CSSTree project.
Examples of incorrect code:
@charse "UTF-8";
@importx url(foo.css);
@foobar {
.my-style {
color: red;
}
}
If you are purposely using at-rules that aren't part of the CSS specification, then you can safely disable this rule.