You are here

function ctools_stylizer_padding_apply_style in Chaos Tool Suite (ctools) 7

Same name and namespace in other branches
  1. 6 includes/stylizer.inc \ctools_stylizer_padding_apply_style()

File

includes/stylizer.inc, line 1631
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";
  }
}