CSS configuration

I am using CSS Tidy. Due to all its compression measures, in some cases it messed up my pages by merging or rearranging the selector etc. Even with the options below, CSS compressed pages do not display the same as uncompressed pages.

My question is, how can I customize CSS Tidy to combine all my CSS files into one and do nothing more?

$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;

      


@ypnos: As far as configuration goes, I don't have a config file, I don't set config options when initializing the class. I just edited the csstidy () function in the actual class. I'm sure my edited settings are being read because some - but not all - of the issues have been fixed.

@Ambrose: The CSS is compressed from 30KB and has a number of issues that I find it difficult to deal with. I can clearly see the problems on the rendered pages, but it's tighter to track them in the file generated by CSS Tidy. In some cases, the order of the selectors changed, but by editing these settings, I at least fixed the problem. Both of your assumptions about CSS Tidy (URL and use as PHP) are correct.

Since http-compression can compress CSS in terms of whitespace, all I need to get CSS Tidy to do is merge all my CSS files into one, without trying to manipulate the content.

0


source to share


2 answers


I managed to find the source of my problem. I attributed it incorrectly to CSS Tidy when something else was at fault. Thanks for the help.



0


source


How about showing us before and after your CSS?



What about linking to CSS Tidy? I'm guessing this is this ? Used as a PHP script?

0


source







All Articles