function ctools_stylizer_padding_apply_style in Chaos Tool Suite (ctools) 6
Same name and namespace in other branches
- 7 includes/stylizer.inc \ctools_stylizer_padding_apply_style()
File
- includes/
stylizer.inc, line 1628 - Create customized CSS and images from palettes created by user input.
Code
function ctools_stylizer_padding_apply_style(&$stylesheet, $selector, $settings) {
$css = '';
if (isset($settings['top']) && $settings['top'] !== '') {
$css .= ' padding-top: ' . $settings['top'] . ";\n";
}
if (isset($settings['right']) && $settings['right'] !== '') {
$css .= ' padding-right: ' . $settings['right'] . ";\n";
}
if (isset($settings['bottom']) && $settings['bottom'] !== '') {
$css .= ' padding-bottom: ' . $settings['bottom'] . ";\n";
}
if (isset($settings['left']) && $settings['left'] !== '') {
$css .= ' padding-left: ' . $settings['left'] . ";\n";
}
if ($css) {
$stylesheet .= $selector . " {\n" . $css . "}\n";
}
}