Exemple #1
0
/**
 * Make sure custom CSS is regenerated if we're using custom LESS variables
 */
function largo_update_custom_less_variables()
{
    if (Largo::is_less_enabled()) {
        $variables = Largo_Custom_Less_Variables::get_custom_values();
        $escaped = array();
        foreach ($variables['variables'] as $key => $var) {
            $escaped[$key] = addslashes($var);
        }
        Largo_Custom_Less_Variables::update_custom_values($escaped);
    }
}
 /**
  * Set the variables.less file
  *
  * @param string $variables_less_file - example 'variables.less'
  */
 static function register_variables_less_file($variables_less_file)
 {
     self::$variables_less_file = $variables_less_file;
 }
Exemple #3
0
 /**
  * If the values have changed, save and regenerate the stylesheet
  */
 public function action_customize_save_after_save_less_variables()
 {
     $values = Largo_Custom_Less_Variables::get_custom_values();
     if ($this->less_variables != $values['variables']) {
         $variables = array_merge($values['variables'], $this->less_variables);
         Largo_Custom_Less_Variables::update_custom_values($variables);
     }
 }