dart-sass
dart-sass copied to clipboard
Drop explicit support for @-moz-document
See https://github.com/sass/sass/issues/2529.
- [x] Deprecate all syntax other than
url-prefix()
andurl-prefix("")
. - [x] ~~Deprecate all syntax (blocked on Firefox removing support for
url-prefix()
).~~ - [x] ~~Remove support entirely (waiting for breaking release).~~
- [ ] Drop explicit support for
@-moz-document
and treat it as an unknown at-rule.
Isn't @-moz-document
is still used for userstyles? I could try migrating to url-prefix, but afaik userstyle support is still entirely present and not deprecated.
@refi64 Can you use @document
there instead? One reason we want to drop support for @-moz-document
is that it uses different syntax than @document
, which requires special parser support.
Ah apologies, I didn't realize @document
worked as well.
@nex3 given that Firefox gave up on removing support for the empty prefix hack (see https://bugzilla.mozilla.org/show_bug.cgi?id=1449753#c17), what is the plan for Sass ?
Dang. In that case, I think what we should do is transition to treating @-moz-document
like an unknown at-rule: parse its value as an interpolated declaration value and be done with it. That probably isn't even a breaking change, since only interpolated SassScript is allowed in the first place. I'll update the task list above.
Firefox still allows @-moz-document
rules with values other than url-prefix()
in its user stylesheet files (userChrome.css
and userContent.css
), as well as the browser's own internal stylesheets. (Changing them to unprefixed @document
s did not seem to work, and according to MDN, even Firefox only supports the prefixed version.) They're also used in the UserCSS format used by the Stylus user stylesheet manager[^1] and similar browser extensions. (In that case, they're being interpreted by the extension rather than the browser engine - which might not even be Firefox - ~but the spec still says to use the -moz-
-prefixed version~.)
[Edit: Just realized that user styles were mentioned above as supporting @document
, and I somehow missed it. Still, userChrome.css
and userContent.css
do seem to need the prefixed version.]
Would it be feasible to limit the deprecation warning to forms of @-moz-document
that are actually syntactically invalid according to the spec, and thus might fail when the explicit parser support is removed from Sass? If I understand correctly, that would be cases where url-prefix
or domain
has an unquoted argument - and they work just as well with quoted ones.
[^1]: Not to be confused with the CSS preprocessor also named Stylus.