views:

315

answers:

4

I am using CSS Tidy. Due to all of its compression measures, in some cases it's messing up my pages by combining or re-arranging selectors, etc. Even with the options shown below, pages with the compressed CSS do not render as they do with the uncompressed.

My question is: How can I configure CSS Tidy to combine all of my CSS files into one, and do nothing more than that?

$this->settings['remove_bslash'] = false;
$this->settings['compress_colors'] = false;
$this->settings['compress_font-weight'] = false;
$this->settings['lowercase_s'] = false;
$this->settings['optimise_shorthands'] = 0;
$this->settings['remove_last_;'] = false;
$this->settings['case_properties'] = 0;
$this->settings['sort_properties'] = false;
$this->settings['sort_selectors'] = false;
$this->settings['merge_selectors'] = 0;
$this->settings['discard_invalid_properties'] = false;
$this->settings['css_level'] = 'CSS2.1';
$this->settings['preserve_css'] = true;
$this->settings['timestamp'] = false;
A: 

Are you sure your configuration file is actually read by CSS Tidy?

ypnos
A: 

How about you show us a before and after of your CSS?

And how about you link to CSS Tidy itself? I assume it's this? Being used as a PHP script?

AmbroseChapel
A: 

@ypnos: In terms of configuration, I do not have a configuration file, no do I set the configuration options when I initialize the class. I just edited the csstidy() function in the actual class. I am sure my edited settings are being read because some—-but not nearly all--of the problems were fixed.

@Ambrose: The CSS is 30k compressed and has a number of issues I am having difficulty in tracking down. I can clearly see problems on the rendered pages, but tougher to track them down in the file generated by CSS Tidy. In some cases, the order of selectors was being changed, but by editing those settings, I at least corrected that problem. Both of your assumptions about CSS Tidy (URL and usage as PHP) are correct.

Since http-compression can compress the CSS from a whitespace standpoint, all I need CSS Tidy to do is combine all of my CSS files into one, without trying to manipulate the contents.

chipotle_warrior
A: 

I was able to track down the source of my problem. I had incorrectly attributed it to CSS Tidy, when something else was actually at fault. Thanks for the help.

chipotle_warrior