Greasy Fork is available in English.

Discussions » Development

Serious issue with css <link> and @-moz-document domain("myanimelist.net") {

§
Posted: 2023-03-07
Edited: 2023-03-07

https://github.com/ampproject/amphtml/issues/26406

Not sure if that links helps at all, but I have been trying to run this https://pastebin.com/raw/tw1QHsjG

And it usually works as long as anything like @-moz-document domain("myanimelist.net") { is not on the css code, for a while I thought it was like a CORS-related issue, but that was only because I got CORB issues using the wrong URL.

Is @-moz-document domain("myanimelist.net") { still valid to use at all?

I read somewhere that stylish and browsers do make some kind of conversion to make styles work for them, but what would that conversion be then?

I would like to make a css style like this one https://userstyles.org/styles/260561.css work with some kind of @-moz-document restriction to pages similar to https://myanimelist.net/profile/xxxxxxxxxx but so far none of my tries worked with <link rel="stylesheet".............

§
Posted: 2023-05-21
Edited: 2023-05-21

@-moz-document domain("myanimelist.net") { is not valid css code, but it is commonly used in UserCSS.

There is no equivalent in standard CSS.

For Stylus, the user.css will be translated into standard CSS by the processor. It will determine which website or which webpage shall apply the corresponding css rules.

the conversion is just the unwrap the bracket and inject in the page with matched url.

In short, just install Stylus to manage your UserCSS. Personally I use it with @preprocessor stylus

Here is a simple example for UserCSS with Stylus https://greasyfork.org/en/scripts/457375-youtube-chat-bubbles

NotYouMod
§
Posted: 2023-05-21

@-moz-document domain("myanimelist.net") { is not valid css code, but it is commonly used in UserCSS.

There is no equivalent in standard CSS.

What makes you think so? In CSS exists @document, but for Firefox was implemented same thing, but with prefix -moz-. Look in MDN.

§
Posted: 2023-05-21
Edited: 2023-05-21

@-moz-document domain("myanimelist.net") { is not valid css code, but it is commonly used in UserCSS.

There is no equivalent in standard CSS.

What makes you think so? In CSS exists @document, but for Firefox was implemented same thing, but with prefix -moz-. Look in MDN.

As per your MDN link, it is clearly said that it is Deprecated and Non-standard.

@-moz-document has been long existed since Firefox 2. W3C did not (and obviously will not) make @document into W3C standard.

All the UserStyle managers do their own processor conversions to handle this @-moz-document which is essential for UserStyles.

(Also see https://caniuse.com/?search=%40document)

Remarks: looks like CSS4 (in future) will include @document (source)

Remarks: CSS4 (in future) might include @document

Source 2: https://www.w3.org/TR/2012/WD-css3-conditional-20121213/#changes

Post reply

Sign in to post a reply.