/ Published in: PHP
compress & combine CSS files and param theme with PHP vars
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/* in .htaccess */ AddType application/x-httpd-php .css // to parse PHP var /* on root CSS folder */ <?php function compress($buffer) { // remove comments // remove tabs, spaces, new lines ", "\r", "\n", "\t", ' ', ' ', ' '), '', $buffer); // remove spaces return $buffer; } // include your PHP vars include 'cssvar.php'; // and insert all your CSS files include 'reset.css'; ?> /* in CSSVAR.PHP */ <?php $v_css_gradient_blue = " background: #b8c1d7; background: -webkit-gradient(linear, left top, left bottom, from(#dae3ee), to(#b8c1d7)); background: -moz-linear-gradient(top, #dae3ee, #b8c1d7); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dae3ee', endColorstr='#b8c1d7'); "; ?> /* Use in CSS files */ h1{ padding:0 0 15px 0; margin:0; font-size:180%; <?php echo $v_css_gradient_blue;?> }