function ctools_stylizer_border_apply_style in Chaos Tool Suite (ctools) 7
Same name and namespace in other branches
- 6 includes/stylizer.inc \ctools_stylizer_border_apply_style()
File
- includes/
stylizer.inc, line 1473 - 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";
}
}