Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
any news on this? -webkit-* -moz-* stuff gets thrown out when running thru csstidy. like gradient/border radius et al. or is there a way to "preserve" certain portions of a stylesheet from being optimized?
First, you'll need to edit the huge parse() method in csstidy.php. You'll have to add a condition to explictly tell CSSTidy not to discard -webkit-gradient and -moz-linear-gradient.
Just open your csstidy.php file, find the parse() method and locate the case 'instr' in the huge switch statement.
In bold, the else part to add. This will make sure your webkit and firefox gradient rules will get processed correctly.
I don't really understand WHY it work, but it does. The parse() method is a huge uncommented mess, it is quite difficult to understand it. There must be a better way, a more generic one than specifying some properties, but I didn't manage to come with anything better than that.
I gave this a try but I did not succeed at getting it to work. I'll switch CSSTidy off for now and have a look at other compression methods, maybe solely Gzipped CSS.
Comments
Comment #1
philbar commentedComment #2
Anonymous (not verified) commentedany news on this? -webkit-* -moz-* stuff gets thrown out when running thru csstidy. like gradient/border radius et al. or is there a way to "preserve" certain portions of a stylesheet from being optimized?
Comment #3
philbar commentedCan you try this hack:
http://www.pixelastic.com/blog/188:css3-gradients-with-csstidy
If it works, I add something similar to the project.
Comment #4
Anonymous (not verified) commentedHey,
I gave this a try but I did not succeed at getting it to work. I'll switch CSSTidy off for now and have a look at other compression methods, maybe solely Gzipped CSS.
Comment #5
philbar commentedBummer. Well I created a new issue for this:
#863782: Support Browser Specific CSS
Let continue discussion on it there.