You are here

function csstidy::csstidy in Advanced CSS/JS Aggregation 6

Loads standard template and sets default settings @access private @version 1.3

File

advagg_css_compress/csstidy/class.csstidy.inc, line 254

Class

csstidy
CSS Parser class

Code

function csstidy() {
  $this->settings['remove_bslash'] = true;
  $this->settings['compress_colors'] = true;
  $this->settings['compress_font-weight'] = true;
  $this->settings['lowercase_s'] = false;

  /*
  1 common shorthands optimization
  2 + font property optimization
  3 + background property optimization
  */
  $this->settings['optimise_shorthands'] = 1;
  $this->settings['remove_last_;'] = true;

  /* rewrite all properties with low case, better for later gzip OK, safe*/
  $this->settings['case_properties'] = 1;

  /* sort properties in alpabetic order, better for later gzip
   * but can cause trouble in case of overiding same propertie or using hack
   */
  $this->settings['sort_properties'] = false;

  /*
  1, 3, 5, etc -- enable sorting selectors inside @media: a{}b{}c{}
  2, 5, 8, etc -- enable sorting selectors inside one CSS declaration: a,b,c{}
  preserve order by default cause it can break functionnality
  */
  $this->settings['sort_selectors'] = 0;

  /* is dangeroues to be used: CSS is broken sometimes */
  $this->settings['merge_selectors'] = 0;

  /* preserve or not browser hacks */
  $this->settings['discard_invalid_selectors'] = false;
  $this->settings['discard_invalid_properties'] = false;
  $this->settings['css_level'] = 'CSS2.1';
  $this->settings['preserve_css'] = false;
  $this->settings['timestamp'] = false;
  $this->settings['template'] = '';

  // say that propertie exist
  $this
    ->set_cfg('template', 'default');

  // call load_template
  $this->optimise = new csstidy_optimise($this);
  $this->tokens_list =& $GLOBALS['csstidy']['tokens'];
}