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

XF 1.2 Important Declaration

Discussion in 'Styling and Customization Questions' started by Amaury, Mar 10, 2014.

  1. Amaury

    Amaury Well-Known Member

    How do you determine if something needs an important declaration?
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    If you can't get the styling to stick without it.
     
    iGloo' and Amaury like this.
  3. Amaury

    Amaury Well-Known Member

    I was just thinking of this while making a thread on TAZ and rather than create a new thread, I figured I'd bump this.

    Is this another correct way of looking at it? If you search the templates for the custom CSS and templates come up (e.g., forum_list), use !important, but if there are no results, then !important wouldn't be necessary?

    Also, Brogan, when you said "if you can't get the styling to stick," did you mean that without !important it works at first, but then stops, or doesn't work at all?
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    If you use higher specificity, in most cases you won't need to use !important.

    In some cases, certain templates/classes are compiled after EXTRA.css which will necessitate the use of !important.
     
    Amaury likes this.
  5. Amaury

    Amaury Well-Known Member

    Ah, okay. So something like this is what you mean, correct?

    .subHeading = !important needed
    .thread_view .subHeading = !important not needed
     
  6. Brogan

    Brogan XenForo Moderator Staff Member

    More or less, yes.
     
    Amaury likes this.
  7. Amaury

    Amaury Well-Known Member

    Thanks for your amazing support and response time as always, Brogan.
     

Share This Page