-
Notifications
You must be signed in to change notification settings - Fork 149
Description
https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@charset
Although the first character in
@charsetis the@symbol, it is not an at-rule. It is a specific byte sequence that can only be placed at the very beginning of a stylesheet. No other characters, except the Unicode byte-order mark, are allowed before it. It also does not follow normal CSS syntax rules such as use of quotes or whitespace.
https://drafts.csswg.org/css-syntax/#at-ruledef-charset
However, there is no actual at-rule named
@charset. When a stylesheet is actually parsed, any occurrences of an@charsetrule must be treated as an unrecognized rule, and thus dropped as invalid when the stylesheet is grammar-checked.Note: In CSS 2.1,
@charsetwas a valid rule. Some legacy specs may still refer to a@charsetrule, and explicitly talk about its presence in the stylesheet.