function ctools_stylizer_border_apply_style in Chaos Tool Suite (ctools) 6
Same name and namespace in other branches
- 7 includes/stylizer.inc \ctools_stylizer_border_apply_style()
File
- includes/
stylizer.inc, line 1470 - Create customized CSS and images from palettes created by user input.
Code
function ctools_stylizer_border_apply_style(&$stylesheet, $selector, $settings, $color, $which = NULL) {
$border = 'border';
if ($which) {
$border .= '-' . $which;
}
$css = '';
if (isset($settings['thickness']) && $settings['thickness'] !== '') {
if ($settings['thickness'] == 'none') {
$css .= ' ' . $border . ': none';
}
else {
$css .= ' ' . $border . '-width: ' . $settings['thickness'] . ";\n";
if (isset($settings['style']) && $settings['style'] !== '') {
$css .= ' ' . $border . '-style: ' . $settings['style'] . ";\n";
}
$css .= ' ' . $border . '-color: ' . $color . ";\n";
}
}
if ($css) {
$stylesheet .= $selector . " {\n" . $css . "}\n";
}
}