How do I make multiple styles for the same site?

edited November 2017 in userstyles.org Firefox
Okay I'm writing out a style and want it to affect the layout of some of the pages in the domain and alter it differently on others is there a way to do that?

Comments

  • When you create your @-moz-document rule there are several options:

    * domain()
    * url()
    * url-prefix()
    * regexp()

    More info: https://github.com/stylish-userstyles/stylish/wiki/Valid-@-moz-document-rules
  • edited November 2017 Firefox
    Yeah that's helpful in proper syntax at the start of the style but lets say I want to alter the layout of the frontpage & the search page but leave profile & similar pages without altering the structure/topography and since the search page has a rotating variable

    Leaving these three with the same coding that radically changes the page structure

    FRONTPAGE-EX:www.sitename.com/subidirectory
    SEARCH-EX1:www.sitename.com/subdirectory/genre/action
    SEARCH-EX2:www.sitename.com/subdirectory/genre/romance

    But leave the profile pages or other pages alone only changing the colorscheme

    PROFILE-EX:www.sitename.com/subdirectory/user/*

    How and where do I use the initial options for starting this kind of code?
  • edited November 2017 Firefox

    You can include multiple different @-moz-document sections in one style, not just one.

    For import:

    @-moz-document regexp("https?:\\/\\/www\\.sitename\\.com\\/subdirectory\\/((?!user)genre\\/(action|romance).*)?") {
        /* code for first three here */
    }
    
    @-moz-document url-prefix("www.sitename.com/subdirectory/user/") {
        /* code for last one here */
    }
    

    For just copying the RegEx:

    https?:\/\/www\.sitename\.com\/subdirectory\/((?!user)genre\/(action|romance).*)?
    
Sign In or Register to comment.