You are here

protected function AvailabilityCalendarCssGenerator::createHeaderCss in Availability Calendars 7.4

Same name and namespace in other branches
  1. 7.5 availability_calendar.styles.inc \AvailabilityCalendarCssGenerator::createHeaderCss()
  2. 7.3 availability_calendar.styles.inc \AvailabilityCalendarCssGenerator::createHeaderCss()

Return value

string The CSS for the header.

1 call to AvailabilityCalendarCssGenerator::createHeaderCss()
AvailabilityCalendarCssGenerator::createCss in ./availability_calendar.styles.inc
Creates the css.

File

./availability_calendar.styles.inc, line 646

Class

AvailabilityCalendarCssGenerator

Code

protected function createHeaderCss() {
  $category = 'header';
  $css = '';
  $css .= "/* Weekday names (header row) */\n";
  $css .= $this
    ->cssSelector(".cal thead th");
  $css .= $this
    ->addCssLengthDeclaration($category, 'height');
  $line_height = $this
    ->getStyle($category, 'height');

  // @todo: subtract border from line-height, but for that we need to add border as a style in this UI.
  $css .= $this
    ->cssDeclaration('line-height', $line_height . 'px');
  $css .= $this
    ->addCssDeclaration($category, 'text-align');
  $css .= $this
    ->addCssDeclaration($category, 'font-weight');
  $css .= $this
    ->addCssDeclaration($category, 'font-style');
  $css .= $this
    ->addCssDeclaration($category, 'font-size');

  // Add color also to th cells to override Bartik
  $css .= $this
    ->addCssColorDeclaration('table', 'color');

  // Add width to first row to assure that IE7 works fine.
  // Will be overridden for the column that contains the week number/notes.
  $css .= $this
    ->addCssLengthDeclaration('days', 'width');
  $css .= $this
    ->cssSelectorEnd();
  return $css;
}