/** * loop through all fields and create an array of style definitions */ public static function loop_controls() { $fields = Nova::$fields; $css = array(); // Early exit if no fields are found. if (empty($fields)) { return; } foreach ($fields as $field) { // Only continue if $field['output'] is set if (isset($field['output']) && !empty($field['output']) && 'background' != $field['type']) { if (function_exists('array_replace_recursive')) { $css = array_replace_recursive($css, Nova_Output_CSS::css($field)); } else { $css = Nova_Helper::array_replace_recursive($css, Nova_Output_CSS::css($field)); } } } if (is_array($css)) { return Nova_Output_CSS::styles_parse(Nova_Output_CSS::add_prefixes($css)); } return; }
public function include_stylesheets() { $config = apply_filters('nova/config', array()); $styles = ''; Nova_Helper::init_filesystem(); global $wp_filesystem; /** * Include the width CSS if necessary */ if (isset($config['width'])) { $styles .= $wp_filesystem->get_contents(Nova::$path . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'css' . DIRECTORY_SEPARATOR . 'customizer-dynamic-css-width.css'); /** * Replace width placeholder with actual value */ $styles = str_replace('WIDTH', $config['width'], $styles); } /** * Include the color modifications CSS if necessary */ if (false !== $this->color_back && false !== $this->color_font) { $styles .= $wp_filesystem->get_contents(Nova::$path . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'css' . DIRECTORY_SEPARATOR . 'customizer-dynamic-css-colors.css'); } /** * Include generic CSS for controls */ $styles .= $wp_filesystem->get_contents(Nova::$path . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'css' . DIRECTORY_SEPARATOR . 'customizer-dynamic-css.css'); return $styles; }