Stop stylish from applying the style to certain pages.

edited November 2017 in Style Development Chrome
I have searched the site and can't find exactly what I am looking for. I am making a style for Reddit. I want the style to work on every 'main page' of Reddit, but not on things like comment pages or the inbox.

I want it to work on:

But I do not want it to work on:

How do I achieve this?


  • Try if it works if you put your code inside

    @-moz-document url(""), 
        regexp("https?:\\/\\/www\\.reddit\\.com\\/r\\/((?!\\/comments\\/).)+")  {
        /* your code here*/
  • I thought I had thanked you for this. Sorry. Thank you so much.

    How would I do this for user profiles. Reddit changed them recently so they appear blank with my style.

    I wish I understood regexp code.
  • I need more info. Why not just use

    @-moz-document url-prefix("") {
        /* your code here */



  • Wouldn't that apply the code to the user page? I want it to ignore the userpage but work on all other parts of the site.
  • Also thank you again for your help.
  • edited February 2018 Firefox

    Then try if this works sufficient for you

    @-moz-document url(""), 
        url("https?:\\/\\/www\\.reddit\\.com\\/((?!message\\/|user\\/|r\\/.+\\/comments\\/).)+") {
    /* your code here */
  • Sorry for another late reply:

    Style code has an invalid @-moz-document value: url https?:\/\/www\.reddit\.com\/((?!message\/|user\/|r\/.+\/comments\/).)+. Read for more info.
  • ehm yeah it shouldn't be url, but regexp. Sorry for my mistake.
    Furthermore I'm not sure if I put those extra brackets on purpose. Removed them and still looks fine.

    @-moz-document url(""), 
        regexp("https?:\\/\\/www\\.reddit\\.com\\/(?!message\\/|user\\/|r\\/.+\\/comments\\/).+") {
    /* your code here */

    Ask back, if something doesn't work.

Sign In or Register to comment.