Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unknown @ rule: @-moz-document for Stylish in Firefox 61

I upgraded to Firefox 61 last night and my custom Stylish theme isn't being applied. Looking in Stylish I see the code section has the flags

Unknown @ rule: @-moz-document

The code is:

@namespace url(http://www.w3.org/1999/xhtml);

@-moz-document domain("outlook.office.com") {
.ms-border-color-themeSecondary, .ms-bcl-ts, .ms-border-color-themeSecondary-hover:hover, .ms-border-color-themeSecondary-focus:focus, .ms-border-color-themeSecondary-before::before, .ms-bcl-ts-h:hover, .ms-bcl-ts-f:focus, .ms-bcl-ts-b::before{
  border-color:red;
  }


._cb_l2{
  border-bottom-style: solid;
  border-bottom-width: 3px;
}

._cb_n2{
  z-index: 10;
}

@U._cb_s2{
    border-bottom-style: solid;
    border-bottom-width: 3px;
}

  ._cb_u2{
    z-index: 10;
  }
}

Is there an easy way to replace the @-moz-document line with something that will preserve the style functionality?

like image 753
user1717828 Avatar asked Jun 29 '18 12:06

user1717828


2 Answers

Mozilla nuked @-moz-document rules with Firefox version 61. It's supposed to be replaced with @document(link), but that doesn't work yet.

This needs to be addressed in Stylish. It would be best if the Import tool parses @-moz-document rules to its internal metadata and then strips the text on import, IMO.

I couldn't find anything about this new Firefox breakage in a quick search of the Stylish GitHub, so you may want to raise the issue over there.

As a temporary workaround, you can set the layout.css.moz-document.content.enabled pref to true in about:config.
That won't clear the red error X in the edit dialog, but the script will work.

like image 184
Brock Adams Avatar answered Nov 15 '22 22:11

Brock Adams


@BrockAdams is correct about the change, but @-moz-document should still work in userstyles.
The preference he mentions enables it generally, which Mozilla has disabled for security reasons.
This about: URL takes you to the preference directly: about:config?filter=layout.css.moz-document.content.enabled

From @document:

  • Implemented with the vendor prefix: -moz-
  • Disabled by default in web pages, except for an empty url-prefix() value, which is supported due to its use in Firefox browser detection. Still supported in user stylesheets.
  • Disabled From version 61: this feature is behind the layout.css.moz-document.content.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.

Note that Mozilla's compatibility info for Firefox on Android is listed as: ?.

like image 29
grossdm Avatar answered Nov 15 '22 23:11

grossdm