本文整理汇总了PHP中Essential_Grid_Base::compress_css方法的典型用法代码示例。如果您正苦于以下问题:PHP Essential_Grid_Base::compress_css方法的具体用法?PHP Essential_Grid_Base::compress_css怎么用?PHP Essential_Grid_Base::compress_css使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Essential_Grid_Base
的用法示例。
在下文中一共展示了Essential_Grid_Base::compress_css方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: output_global_css_styles_wrapped
/**
* echo global CSS with wrapper
*/
public static function output_global_css_styles_wrapped()
{
$base = new Essential_Grid_Base();
echo '<style type="text/css">';
echo $base->compress_css(self::get_global_css_styles());
echo '</style>' . "\n";
}
示例2: output_navigation_skins
public static function output_navigation_skins()
{
$base = new Essential_Grid_Base();
$skins = self::get_essential_navigation_skins();
$css = '';
if (!empty($skins)) {
foreach ($skins as $skin) {
$css .= '<style class="navigation-skin-css-' . $skin['id'] . '" type="text/css">';
$css .= $base->compress_css($skin['css']);
$css .= '</style>' . "\n";
}
}
return $css;
}
示例3: output_element_css_by_meta
public function output_element_css_by_meta()
{
$base = new Essential_Grid_Base();
$disallowed = array('transition', 'transition-delay');
$allowed_wrap_styles = Essential_Grid_Item_Element::get_allowed_styles_for_wrap();
$post_Class = !isset($post['ID']) ? '' : $post['ID'];
$p_class = '.eg-post-' . $post_Class;
if (!empty($this->layers_meta_css['idle'])) {
echo '<style type="text/css">';
$css = '';
foreach ($this->layers_meta_css['idle'] as $class => $settings) {
$forbidden = array();
if (!empty($this->add_css_wrap) && isset($this->add_css_wrap[$class])) {
$forbidden = $allowed_wrap_styles;
}
//write hover only if no tag inside the text exists
$d_i = $this->layers_css[$this->id]['settings'][$class]['important'];
//add important or not
if (!empty($settings)) {
$css .= '.' . $class . $p_class . ' {' . "\n";
foreach ($settings as $style => $value) {
if (!in_array($style, $forbidden) && !in_array($style, $disallowed)) {
$css .= ' ' . $style . ': ' . stripslashes($value) . $d_i . ';' . "\n";
}
}
$css .= '}' . "\n";
}
}
echo $base->compress_css($css);
echo '</style>' . "\n";
}
if (!empty($this->layers_meta_css['hover'])) {
echo '<style type="text/css">';
$css = '';
foreach ($this->layers_meta_css['hover'] as $class => $settings) {
if (!empty($this->add_css_tags) && isset($this->add_css_tags[$class])) {
continue;
}
//write hover only if no tag inside the text exists
$d_i = $this->layers_css[$this->id]['settings'][$class]['important'];
//add important or not
if (!empty($settings)) {
$css .= '.' . $class . $p_class . ':hover {' . "\n";
foreach ($settings as $style => $value) {
$css .= ' ' . $style . ': ' . stripslashes($value) . $d_i . ';' . "\n";
}
$css .= '}' . "\n";
}
}
echo $base->compress_css($css);
echo '</style>' . "\n";
}
//check for custom css on tags
if (!empty($this->add_css_tags)) {
$allowed_styles = Essential_Grid_Item_Element::get_allowed_styles_for_tags();
foreach ($this->add_css_tags as $class => $tags) {
if (!empty($this->layers_meta_css['idle'][$class])) {
// we write the idle styles
$d_i = $this->layers_css[$this->id]['settings'][$class]['important'];
//add important or not
foreach ($tags as $tag => $do) {
echo '<style type="text/css">';
$css = '';
$css .= '.' . $class . $p_class . ' ' . $tag . ' {' . "\n";
foreach ($this->layers_meta_css['idle'][$class] as $style => $value) {
if (in_array($style, $allowed_styles)) {
$css .= ' ' . $style . ': ' . stripslashes($value) . $d_i . ';' . "\n";
}
}
$css .= '}' . "\n";
echo $base->compress_css($css);
echo '</style>' . "\n";
}
}
if (!empty($this->layers_meta_css['hover'][$class])) {
// we write the hover styles
$d_i = $this->layers_css[$this->id]['settings'][$class]['important'];
//add important or not
foreach ($tags as $tag => $do) {
echo '<style type="text/css">';
$css = '';
$css .= '.' . $class . $p_class . ' ' . $tag . ':hover {' . "\n";
foreach ($this->layers_meta_css['hover'][$class] as $style => $value) {
if (in_array($style, $allowed_styles)) {
$css .= ' ' . $style . ': ' . stripslashes($value) . $d_i . ';' . "\n";
}
}
$css .= '}' . "\n";
echo $base->compress_css($css);
echo '</style>' . "\n";
}
}
}
}
//check for custom css on wrappers for example
if (!empty($this->add_css_wrap)) {
$allowed_cat_tag_styles = Essential_Grid_Item_Element::get_allowed_styles_for_cat_tag();
foreach ($this->add_css_wrap as $class => $tags) {
if (!empty($this->layers_meta_css['idle'][$class])) {
// we write the idle styles
//.........这里部分代码省略.........