On Sep 19, 2013, at 11:19 PM, C. Scott Ananian cananian@wikimedia.org wrote:
@dan: the particular "less isn't very powerful" issues I'm concerned about are the ones solved by compass. As is well-known, there is no equivalent to compass for less, and is not likely every to be, since less can not express the transformations required. Compass uses ruby code to do this w/ sass. For example, https://github.com/chriseppstein/compass/blob/stable/lib/compass/sass_extens... the code in compass in order to generate clean gradient specifications that work with all major browsers (including synthesizing SVG background images where required). (Spec in http://compass-style.org/reference/compass/css3/images/ ). Now, maybe we don't actually need all that power. But the automatic cross-browser compatibility it allows sure is nice... --scott
As Ori pointed out, these could be implemented as Less functions in PHP land.
However note that (for me) one the reasons I prefer Less over Sass with Compass is that it allows more fine-grained control over browser support and doesn't take the insane approach of trying to support everything and leaving you with very minimal options to switch things off.
For example, in the of older browsers supporting SVG background-image but not CSS3 gradients, I'd say just drop that and only provide CSS3 gradient + vendor prefixed versions thereof and have it fallback for the rest. You're gonna have to provide that fallback anyway for browsers that support neither CSS3 or SVG.
Optimise for the future, not for the past (those browsers are getting smaller in usage). It's not worth it to generate and serve that SVG to all clients.