You are here

function panels_flexible_render_css_group in Panels 7.3

Same name and namespace in other branches
  1. 6.3 plugins/layouts/flexible/flexible.inc \panels_flexible_render_css_group()

Render the CSS for a group of items to be displayed together.

Columns and regions, when displayed as a group, need to cooperate in order to share margins and make sure that percent widths add up to the right total.

1 call to panels_flexible_render_css_group()
panels_flexible_render_css in plugins/layouts/flexible/flexible.inc
Provide CSS for a flexible layout.

File

plugins/layouts/flexible/flexible.inc, line 769
Flexible layout plugin.

Code

function panels_flexible_render_css_group($renderer, $list, $owner_id, $type, $id) {
  $css = array();

  // Start off with some generic CSS to properly pad regions.
  $css[$owner_id . ' .' . $renderer->item_class['region']] = array(
    'padding' => '0',
  );
  $css[$owner_id . ' .' . $renderer->item_class['region'] . '-inside'] = array(
    'padding-right' => $renderer->region_separation,
    'padding-left' => $renderer->region_separation,
  );
  $css[$owner_id . ' .' . $renderer->item_class['region'] . '-inside-first'] = array(
    'padding-left' => '0',
  );
  $css[$owner_id . ' .' . $renderer->item_class['region'] . '-inside-last'] = array(
    'padding-right' => '0',
  );
  $css[$owner_id . ' .' . $renderer->item_class['column']] = array(
    'padding' => '0',
  );
  $css[$owner_id . ' .' . $renderer->item_class['column'] . '-inside'] = array(
    'padding-right' => $renderer->column_separation,
    'padding-left' => $renderer->column_separation,
  );
  $css[$owner_id . ' .' . $renderer->item_class['column'] . '-inside-first'] = array(
    'padding-left' => '0',
  );
  $css[$owner_id . ' .' . $renderer->item_class['column'] . '-inside-last'] = array(
    'padding-right' => '0',
  );

  // And properly pad rows too:
  $css[$owner_id . ' .' . $renderer->item_class['row']] = array(
    'padding' => '0 0 ' . $renderer->row_separation . ' 0',
    'margin' => '0',
  );
  $css[$owner_id . ' .' . $renderer->item_class['row'] . '-last'] = array(
    'padding-bottom' => '0',
  );
  panels_flexible_get_css_group($css, $renderer, $list, $owner_id, $type, $id);
  ctools_include('css');
  return ctools_css_assemble($css);
}