Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

moshemo's avatar
Level 12

How to Handle Multiple (Post)CSS Files with Laravel Mix

I have a main stylesheet (styles.css) and a css library that I downloaded (hamburgers.css from https://github.com/jonsuh/hamburgers).

I have already set up Laravel Mix to process my styles.css file using mix.postCss (while passing in a few postCss plugins such as purgeCss). I now want to ALSO concatenate my styles.css and the hamburgers.css file together into one production ready css file (using purgeCss to remove unused css in BOTH my styles.css file and the hamburgers.css file).

However, I am having trouble figuring out how to best do this. I know that I can concatenate plain css files together using mix.styles. And I know that I can process postCss using mix.postCss.

But how can I BOTH concatenate and process?

For now, what I am doing is importing hamburgers.css into styles.css (which then gets processed using mix.postCss). I am wondering though if a) there is a reason NOT to do it that way and b) a BETTER way to do it.

Any ideas?

Thanks.

0 likes
0 replies

Please or to participate in this conversation.