What is the best way to concatenate multiple CSS files into one CSS file?
I want to reduce the following ..
<link href="css/1.css" rel="stylesheet" type="text/css" media="all">
<link href="css/2.css" rel="stylesheet" type="text/css" media="all">
<link href="css/3.css" rel="stylesheet" type="text/css" media="all">
.. into ..
<link href="css/1-3.css" rel="stylesheet" type="text/css" media="all">
Simply doing cat css/*.css > css/1-3.css
does not seem to do the trick.
As long as the ordering of the arguments for cat
matches the original ordering of the three referenced CSS files in the HTML file the cat
-method should work as expected.
So given say ..
<link href="css/one.css" rel="stylesheet" type="text/css" media="all">
<link href="css/two.css" rel="stylesheet" type="text/css" media="all">
<link href="css/three.css" rel="stylesheet" type="text/css" media="all">
.. the following concaternation ..
cat css/one.css css/two.css css/three.css > css/all.css
.. together will the following reference ..
<link href="css/all.css" rel="stylesheet" type="text/css" media="all">
.. should be 100 % identical.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With