Style broken because of specificity, please help.

This (https://userstyles.org/styles/117633/awesome-bar-text-based-on-type-2-8) won't apply correctly because of the XML namespace. I know, confuses me too.

What else do I need to add onto the style to make it function? I am sure there's another topic about this somewhere but I'm too lazy to look; Link me if I am reporting a duplicate issue with applying browser styles where some elements don't become modified with the XML namespace.

Comments

  • edited August 2015 Safari

    .ac-emphasize-text is an HTML span element so you have to add HTML namespace after XUL namespace

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

    and change the selector to

    html|span.ac-emphasize-text
    
  • Ugh. Okay, that worked but I had to end up saying I really wanted it to be global anyway. Anything I can do to *not* require the global style override?
  • edited August 2015 Safari

    You now have two HTML namespaces in your code

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

    you actually should use XUL and HTML namespaces

    @namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.onlu.xul);
    @namespace html url(http://www.w3.org/1999/xhtml);
    

    and why would you want it to be a global style?
    Your style is only applied to browser window so you should use @document rule

    @namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.onlu.xul);
    @namespace html url(http://www.w3.org/1999/xhtml);
    
    @-moz-document url(chrome://browser/content/browser.xul) {
      /* insert your CSS rules here */
    }
    
  • edited August 2015 Firefox
    Add LC's @document wrapper, remove all of the @namespaces and namespace prefixes. There's almost no overlap in the HTML and XUL namespaces, and no real advantage to using them here.
Sign In or Register to comment.