You are here

function theme_rounded_corners_css in Panels 5.2

Generates the dynamic CSS.

Parameters

$display: A Panels display object.

$where: String indicating where the rounded corners should be applied, either 'pane' or 'panel'.

1 theme call to theme_rounded_corners_css()
panels_add_rounded_corners_css in styles/rounded_corners.inc

File

styles/rounded_corners.inc, line 126
styles/rounded_corners.inc Definition of the 'rounded_corners' panel style.

Code

function theme_rounded_corners_css($display, $where = 'pane') {
  $idstr = empty($display->css_id) ? '.rounded_corner' : "#{$display->css_id}";
  $url = panels_get_path('styles/corners', TRUE);
  $css = <<<EOF

{<span class="php-variable">$idstr</span>} .t-edge, .b-edge, .l-edge, .r-edge, .wrap-corner {
  position: relative;
  /* hasLayout -1 ? For IE only */
  zoom: 1;
}
{<span class="php-variable">$idstr</span>} .t-edge {
  background: url({<span class="php-variable">$url</span>}/shadow-t.png) repeat-x 0 top;
  font-size: 1px;
}
{<span class="php-variable">$idstr</span>} .b-edge {
  background: url({<span class="php-variable">$url</span>}/shadow-b.png) repeat-x 0 bottom;
  font-size: 1px;
}
{<span class="php-variable">$idstr</span>} .l-edge {
  background: url({<span class="php-variable">$url</span>}/shadow-l.png) repeat-y 0 0;
}
{<span class="php-variable">$idstr</span>} .r-edge {
  background: url({<span class="php-variable">$url</span>}/shadow-r.png) repeat-y right 0;
}
{<span class="php-variable">$idstr</span>} .wrap-corner {
  background: #fff !important;
}
{<span class="php-variable">$idstr</span>} .wrap-corner .t-edge, .wrap-corner .b-edge {
  height: 11px;
}
{<span class="php-variable">$idstr</span>} .wrap-corner .l, .wrap-corner .r {
  position: absolute;
  top: 0;
  height: 11px;
  width: 11px;
  background-image: url({<span class="php-variable">$url</span>}/corner-bits.png);
}
{<span class="php-variable">$idstr</span>} .wrap-corner .l {
  left: 0;
}
{<span class="php-variable">$idstr</span>} .wrap-corner .r {
  right: 0;
  background-position: -11px 0;
}
{<span class="php-variable">$idstr</span>} .wrap-corner .b-edge .l {
  background-position: 0 -11px;
}
{<span class="php-variable">$idstr</span>} .wrap-corner .b-edge .r {
  background-position: -11px -11px;
}
{<span class="php-variable">$idstr</span>} .wrap-corner .r-edge {
  padding: 5px 24px;
}
{<span class="php-variable">$idstr</span>} div.admin-links {
  margin-top: -14px;
  margin-left: -12px;
}

EOF;
  if ($where == 'panel') {
    $css .= <<<EOF
{<span class="php-variable">$idstr</span>} .panel-separator {
  background: url({<span class="php-variable">$url</span>}/shadow-b.png) repeat-x 0 center;
  font-size: 1px;
  height: 30px;
  }
EOF;
  }
  drupal_set_html_head("<style type=\"text/css\" media=\"all\">\n{$css}</style>\n");
}