diff options
Diffstat (limited to 'lib/exe')
-rw-r--r-- | lib/exe/css.php | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/lib/exe/css.php b/lib/exe/css.php index 04516e8ba..0157e6a40 100644 --- a/lib/exe/css.php +++ b/lib/exe/css.php @@ -154,6 +154,9 @@ function css_out(){ // apply style replacements $css = css_applystyle($css,$tplinc); + print $css; + + // parse LESS $less = new lessc(); $css = $less->compile($css); @@ -188,15 +191,21 @@ function css_applystyle($css,$tplinc){ $styleini = css_styleini($tplinc); if($styleini){ - $css = strtr($css,$styleini['replacements']); - + // we convert ini replacements to LESS variable names + // and build a list of variable: value; pairs $less = ''; foreach($styleini['replacements'] as $key => $value){ - $key = trim($key, '_'); - $key = '@ini_'.$key; - $less .= "$key: $value;\n"; + $lkey = trim($key, '_'); + $lkey = '@ini_'.$lkey; + $less .= "$lkey: $value;\n"; + + $styleini['replacements'][$key] = $lkey; } + // we now replace all old ini replacements with LESS variables + $css = strtr($css, $styleini['replacements']); + + // now prepend the list of LESS variables as the very first thing $css = $less.$css; } return $css; |