News for hackers. Stuff that matters.
Re:More, a CSS compiler by r0s on Wednesday May 09, 2012 @12:52AM (#3947147)
Well maybe I'm blind, but I honestly don't see the benefit of CSS compilation. Client side is the only use case I'd even consider, I've been using php to augment styles for years.

Yet, js compiled CSS seems like it breaks tools like Firebug or the Chrome inspector. And version control systems.

What am I missing?

Re:More, a CSS compiler by ericclemmons on Wednesday May 09, 2012 @01:04AM (#3947172)
You've used PHP to augment styles (as have I), I've even used Twig, and have now been using LESS.

Version control is no different, and you typically compile on the server before sending to the client. The LESS.js shim is for convenience, like when you're editing a site over FTP with no access to the server.

CSS precompilers help DRY up your code and introduce structure. For example, no more repeating that hex value and forgetting which red is the error red vs the logo red, constantly retyping vendor prefixes, or maintaining a single gigantic stylesheet.

As a PHP developer, I prefer to "refresh to see changes", which is why using Assetic is a must for compiling both CSS and JS resources.

Re:More, a CSS compiler by youngtaff on Wednesday May 09, 2012 @09:45AM (#3948506)
Compiling CSS client-side slows the page load down...

For less.js the browser has to download the js, then the less file and then produces the CSS

Until the browser has the CSS it can't start rendering the page.

Here's a waterfall for lesscss.org (http://www.webpagetest.org/result/120509_18_ff2ca6e34c6b8e90...) notice how for a really simple webpage that the rendering doesn't start until over 1.2 seconds in!!!

Re:More, a CSS compiler by SquareWheel on Wednesday May 09, 2012 @09:33AM (#3948430)
By augmenting CSS with PHP, do you mean something like this?

  p {color: <?=$mainColor?>}
And then just setting .htaccess (or whatever) to allow PHP execution in .css files?
Re:More, a CSS compiler by r0s on Wednesday May 09, 2012 @08:09PM (#3951173)
You can just process main.css.php (or whatever)

Here's some of my (old crappy)code:

  color: <?php echo $foreground1; ?>;
  font-family: <?php echo $font2; ?>;
But I'm sure there's libs out there that make it really easy and pretty.