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

XF 1.4 CSS modification doesn't work anymore

Discussion in 'Troubleshooting and Problems' started by Betclever, Dec 15, 2014.

  1. Betclever

    Betclever Active Member

    Hello all,

    I want to add some CSS code into the CSS sheet "extra.css" but nothing change...
    I have tried with 10 different codes which are correct and available on Xenforo but nothing change...

    I have added, removed several times, it is maybe the reason...

    How can I fix this?

    Thanks,
     
  2. TJA

    TJA Well-Known Member

    What is the code you have entered that isn't working for you?
     
  3. Tracy Perry

    Tracy Perry Well-Known Member

    There can be several reasons of this happening.
    A few of the most common are
    #1 - You are adding it to the EXTRA.css of the wrong style
    #2 - Somewhere in your EXTRA.css you have incorrectly closed CSS code
    #3 - The style you are using over-rides the CSS you are trying to use (I run into this frequently)
    #4 - Active caching is causing a delay in the change.
     
    Last edited: Dec 16, 2014
    thedude likes this.
  4. batpool52!

    batpool52! Well-Known Member

    Have you tried the css property value with
    Code:
    !important
    It should work.
     
  5. Tracy Perry

    Tracy Perry Well-Known Member

    Normally it will work.. but it is actually a poor fix to have to use !important. It's normally better to find WHY you are having to use that parameter instead. :D
     
  6. Amaury

    Amaury Well-Known Member

    I personally just use important on everything just in case.
     
  7. Tracy Perry

    Tracy Perry Well-Known Member

    As I said.. that's a very BAD habit to get into.

    Just a few comments from research I've done on why:
    from here.

    and
    from here.

    Use of the !important should almost never be used. It is an indicator that the person is usually not familiar with CSS and is having to rough-shod over the problem instead of fixing it correctly.
    Generally for a lot of them the template search utility will reflect where you can change it in your style without using the EXTRA.css (especially when using child styles of a purchased one).

    Have I used it before? Yes... and I slowly try to work through my styles to eliminate the need of them.
     
  8. batpool52!

    batpool52! Well-Known Member

    The valid use I find in XenForo is to leave the templates untouched.
     
  9. Tracy Perry

    Tracy Perry Well-Known Member

    If you are working on a child style of an existing template... then there is no harm in modifying it instead of relying entirely on the EXTRA.css. I started that way myself (at one time one of my EXTRA.css had over 3000 lines in it). Now I just modify the child style directly.
     
  10. batpool52!

    batpool52! Well-Known Member

    Upgrade process could mess up in future (maybe).
     
  11. Tracy Perry

    Tracy Perry Well-Known Member

    Haven't on any of mine. The merge process works just fine on the Audentio styles I use.
    Before the ability to merge them then it did present problems.

    Just saying... EXTRA.css has it's place - but not really the catch all to do all styling (or modifying of styling) in.
     
  12. Amaury

    Amaury Well-Known Member

    @Tracy Perry, I'll have to show you our CSS when @Nights gets the name servers for KH-Flare updated, but a lot of the CSS I have in EXTRA.css comes from things already controlled in the templates, but rather than edit the templates directly, I use EXTRA.css as recommended, and I think that's one of the avenues to use !important.
     
    batpool52! likes this.
  13. Russ

    Russ Well-Known Member

    To be fair his main complaint with it just briefly reading over the article is how troublesome it can be for the END user. If XenForo used !importants for every CSS they laid out it would be beyond annoying. Someone throwing in an !important in their own extra.CSS isn't really going to make a difference in the end. Style authors should though take his advice and just use an extra selector(or obviously a style property) so end users can if they need to, use an important.

    Oh and on topic haha I'm going to randomly guess you have some corrupt CSS, but no telling what is it without seeing your extra.css.
     
    batpool52! likes this.
  14. Tracy Perry

    Tracy Perry Well-Known Member

    yep.... and from what @Maru indicated... he used !important "on everything - just in case". That in and of itself is not a good idea. One here and there isn't going to hurt - but using them for everything is ridiculous.

    One of the biggest complaints I have is even sometimes using an !important would not change some of the style selectors I've tried. That's the main reason I started editing the CSS in the style templates themselves.
     
    Russ likes this.
  15. Russ

    Russ Well-Known Member

    Gatta love the automerge featured :D
     
    Tracy Perry likes this.
  16. Tracy Perry

    Tracy Perry Well-Known Member

    I raised a big glass to 'em for doing that. The good stuff too.... Patron Platinum (y).
     
  17. Brogan

    Brogan XenForo Moderator Staff Member

    I always try to use specificity rather than !important.

    I think I've only had to use !important a small handful of times.
     
    Tracy Perry likes this.

Share This Page