/** * Establish the default LESS constants and provides a filter to over-write them * * @uses pl_hashify - adds # symbol to CSS color hex values * @uses page_line_height - calculates a line height relevant to font-size and content width */ function __construct() { global $less_vars; // The LESS Class $this->lparser = new plessc(); $this->base_color = pl_hashify(pl_base_color()); /* Type */ $fontsize = 15; $content_width = 600; // PageLines Variables $constants = array('plRoot' => sprintf("\"%s\"", PL_PARENT_URL), 'plSectionsRoot' => sprintf("\"%s\"", PL_SECTION_ROOT), 'plPluginsRoot' => sprintf("\"%s\"", WP_PLUGIN_URL), 'plChildRoot' => sprintf("\"%s\"", PL_CHILD_URL), 'plExtendRoot' => sprintf("\"%s\"", PL_EXTEND_URL), 'pl-base' => $this->base_color, 'pl-text' => pl_hashify(pl_text_color()), 'pl-link' => pl_hashify(pl_link_color()), 'pl-header' => pl_hashify(pl_header_color()), 'pl-footer' => pl_hashify(pl_footer_color()), 'pl-min-height' => '400px', 'invert-dark' => $this->invert(), 'invert-light' => $this->invert('light'), 'font-size' => $fontsize . 'px', 'line-height' => page_line_height($fontsize, $content_width) . 'px', 'pl-page-width' => pl_page_width() . 'px', 'pl-content-width' => pl_content_width() . 'px', 'pl-responsive-width' => round(pl_responsive_width(), 2) . '%', 'pl-sidebar-width' => pl_sidebar_width() . 'px', 'pl-secondary-width' => pl_secondary_sidebar_width() . 'px'); if (is_array($less_vars)) { $constants = array_merge($less_vars, $constants); } $constants = array_merge($this->type_vars(), $constants); // Make Filterable $this->constants = apply_filters('pless_vars', $constants); }
/** * Get current page secondary sidebar width * * @return int */ function pl_secondary_sidebar_width() { $width = pl_page_width() - pl_sidebar_width() - pl_content_width(); return $width; }