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

XF 1.4 Minifying CSS not working + multiple stylesheets

Discussion in 'XenForo Questions and Support' started by 1BJK903, Aug 30, 2015.

  1. 1BJK903

    1BJK903 Active Member

    Hi all,

    Maybe I am doing something wrong, I don't know, but I wanted to ask anyway...

    I have enabled "Minify CSS" in the admin panel, but I can't see a minified CSS file being made in the source. My question: am I missing something?

    And beside that, it outputs 4 different stylesheets (fonts, extra.css blabla)... I assume this will be one file when minifed correctly, correct?

    Hope someone can help me with it.
  2. 1BJK903

    1BJK903 Active Member

    149 views and no answer. Can someone help me please?
  3. Brogan

    Brogan XenForo Moderator Staff Member

    What makes you think it isn't being minified?

    I just checked the headers and it looks OK to me.
  4. Nuno

    Nuno Active Member

    Sorry for hijacking this thread but I notice some themes have 2, 3 and even 4 links to css.php implying multiple requests.

    How can this be avoid?
  5. Mike

    Mike XenForo Developer Staff Member

    Minification only happens if you have enabled a cache in config.php (the option description implies this but doesn't explicitly say it).

    There will always be 2 CSS requests per page out of the box. This is done for efficiency purposes. If there are more than this, its down to your style adding additional requests explicitly.
  6. 1BJK903

    1BJK903 Active Member

    These are two different answers...

    I assume they are not minified, because 1) I didn't enable cache in config.php... (haven't read anything about that)

    2) I can SEE that they are not minified @Brogan.

    Anyhow, @Mike: where can I find a tutorial to minify the CSS? And is there a way I can merge multiple stylesheets to one stylesheet?
  7. Mike

    Mike XenForo Developer Staff Member

    You just need to enable the option and enable caching in config.php: Defining a Cache | XenForo

    If you're getting more than 2 CSS requests in a page, you'll need to contact the style author for guidance.
    Nuno and 1BJK903 like this.
  8. 1BJK903

    1BJK903 Active Member

    Thanks, that's all I needed to know!

Share This Page