sass / dart-sass

The reference implementation of Sass, written in Dart.
https://sass-lang.com/dart-sass
MIT License
3.97k stars 357 forks source link

Drop explicit support for @-moz-document #378

Open nex3 opened 6 years ago

nex3 commented 6 years ago

See https://github.com/sass/sass/issues/2529.

refi64 commented 5 years ago

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.

nex3 commented 5 years ago

@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.

refi64 commented 5 years ago

Ah apologies, I didn't realize @document worked as well.

stof commented 2 years ago

@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 ?

nex3 commented 2 years ago

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.

Rhys-T commented 1 year ago

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 @documents 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.