1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Not a Bug EXTRA.css doesn't override polls.css or account.css

Discussion in 'Resolved Bug Reports' started by owls8521, Jul 6, 2011.

  1. owls8521

    owls8521 Active Member

    When I make changes in EXTRA.css, it gets overrided by both polls.css and account.css. It makes it impossible to edit css of polls or accounts without editing the css template files. I believe EXTRA.css is supposed to override everything, so I think this is a bug.
  2. Kier

    Kier XenForo Developer Staff Member

    Steve F likes this.
  3. Steve F

    Steve F Well-Known Member

    You may have to use "!important" after your class


    color: #fff !important;
    Not a bug, those css templates are being loaded after the EXTRA.css is loaded.
    owls8521 likes this.
  4. owls8521

    owls8521 Active Member

    I'm working at the same level of specificity as polls.css. I included a screenshot to show it. As you can see, I'm trying to override the color property for .pollBlock .question .questionText. I wrote that it should be white in EXTRA.css. But then as you can see, it is being overridden by the color in polls.css, which is gray.

    EDIT: Writing !important fixed the problem. Thanks Qwk86gn!

    Attached Files:

  5. James

    James Well-Known Member

    Strange, I thought EXTRA.css was the last loaded stylesheet to ensure that it overrides any previous attributes...
  6. owls8521

    owls8521 Active Member

    Yeah that's the same thing I thought. It's a little confusing.
  7. Steve F

    Steve F Well-Known Member

  8. Romchik®

    Romchik® Well-Known Member

    It has been suggested, but...
    I still think that this is not correct. Defeats the purpose of this file.
    And do not talk about !important. This is not entirely correct.
  9. Kier

    Kier XenForo Developer Staff Member

    EXTRA.css could be the very last thing loaded and it would make absolutely no difference if higher levels of specificity than the other scripts are not provided. And what's the objection to !important anyway?
    Forsaken and Steve F like this.
  10. Floris

    Floris Guest

    The filename isn't called "extreme_last_css_loaded.css"
    It's to assist in customizing the theme, extra css.

    And _lets_ talk about !important; starting with it's explanation

  11. Romchik®

    Romchik® Well-Known Member

    I have a hard pick arguments in English.

    Because I always believed that I should avoid frequent use of !important. Otherwise it may cause confusion.
    If possible, I'd better write a chain of classes ( .className .className2 p a {... ).
    This is why I am against. But this does not mean that without it I would not be able mark up style.
    In the vB forum this template is called additional.css, but if I'm not mistaken, does not require !important value.

    It would be ideal of course, if the system detects a similar class in the EXTRA.css and replaces them basic class.
    And so we have a double definition, which is not good if we have a lot of them.

    But it is probably to difficult or badly affect performance.
  12. Floris

    Floris Guest

    Ok, thanks for your explanation - your English is just fine.

Share This Page