tftd
tftd

Reputation: 17032

Less - the dynamic stylesheet language?

While googling around for doing more css with less writing and I found this - http://lesscss.org/

Has anybody tried it and is it working under IE6+, Firefox 3+, Chrome, Safari, Opera and all of the standard web browsers we all use?

Thanks in advance :)

Upvotes: 2

Views: 969

Answers (4)

mingos
mingos

Reputation: 24502

http://leafo.net/lessphp/

This is the PHP version of the preprocessor. You create the .less file and upload it to the site. The preprocessor does the rest. Works in any browser because the browser only receives the processed CSS file, not the LESS one. All you need to do is add something like this in your index.php:

require_once 'lessc.inc.php';
try {
    lessc::ccompile(PATH_TO_STYLES.'/style.less', PATH_TO_STYLES.'/style.less.css');
} catch (exception $ex) {
    exit('lessc fatal error:<br />'.$ex->getMessage());
}

and then simply use style.less.css as your site's stylesheet.

Upvotes: 5

laander
laander

Reputation: 2663

I have tried LessCSS and a range of other likewise alternatives, but settled on SASS (SCSS) - it can be precompiled using a small Ruby Gem which makes it super easy and fast to use in development. The integration to Ruby is a nice plus when working with e.g. Rails if u do that stuff.

http://sass-lang.com/ - use it with the Compass CSS framework (http://compass-style.org/) and you got a pretty badass setup!

Upvotes: 1

Guillaume86
Guillaume86

Reputation: 14400

You can generate the css server side, or use LESS.js, in the first case, the client is not even aware of the LESS origin of the style, so it's just like css (doesn't rely on client js).

Upvotes: 4

SamMullins
SamMullins

Reputation: 267

As long as javascript is enabled yes, as there is a js script added after the stylesheet link that helps display it in ie6+ and all other mainstream browsers.

If you are also planning on accomodating users who don't have javascript enabled you can do the processing server side, I haven't done this however, so can't vouch for this method.

Sam

Upvotes: 1

Related Questions