9

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?

user1717828
  • 7,122
  • 8
  • 34
  • 59
  • 1
    If you're using **Stylus**, not Stylish, it correctly imports such scoped CSS in the extension's style editor: simply repaste (or click the "import" button explicitly) and it will automatically create scoped sections with applies-to conditions under the code. Stylus additionally supports [usercss styles](https://github.com/openstyles/stylus/wiki/Usercss). – wOxxOm Jul 07 '18 at 18:03
  • 1
    It's even worse for Stylish, @wOxxOm (and everybody). [**Stylish has turned into malware** and is now **blocked by Mozilla/Firefox.**](https://bugzilla.mozilla.org/show_bug.cgi?id=1472948) – Brock Adams Jul 08 '18 at 19:17

2 Answers2

8

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.

Brock Adams
  • 90,639
  • 22
  • 233
  • 295
  • 2
    Oh, I see the problem with Stylish. It's just buggy. Sorry for the confusion - I didn't use it for more than a year. I've been using Stylus that has no such bugs. – wOxxOm Jul 07 '18 at 18:01
  • @wOxxOm, GTK. Stylish has been slow to respond to bugs and pull requests of late. I'll check out [Stylus](https://github.com/openstyles/stylus). – Brock Adams Jul 07 '18 at 18:26
2

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

grossdm
  • 65
  • 5