Community & Support

LESS - Leaner CSS - An approach, apparently using Ruby - Any thoughts/ideas on Possibilities of such for Drupal?

I came across this in another forum, and got to wondering if anyone is working on or might be able to work on such a capability as this:

http://lesscss.org/

Apparently, it's for use in Ruby, only, but I was thinking that Ruby, Python, and PHP were pretty close, and therefore I started wondering if anyone in the Drupal world has looked at such.

I have very little experience, to date, of messing with the PHP in Drupal; and even less experience looking at CSS. I want to take the time to do it, but I have so little time, that I often just have to skip all of that.

Anyway, I'd imagine that many people in the Drupal Community would benefit from something along this line (which perhaps someone HAS done something, but I just didn't see it).

Any thoughts from anyone out there?

Comments

mm.

Certainly has merit.
I've always wanted constants for my colours in CSS, and:

/* LESS */

.rounded_corners {
  -moz-border-radius: 8px;
  -webkit-border-radius: 8px;
  border-radius: 8px;
}

#header {
  .rounded_corners;
}

#footer {
  .rounded_corners;
}

is also pretty intuative. Not sure about the rest.

In the bigger picture, rather than yet another Syntax, I'd suggest looking at what's coming down the line with CSS n+1 and see if we can run a precompiler on our css to emulate the effects and new features. Drupal ALREADY does CSS aggregation, so inserting a precompiler step there will be easy!

wow !

just wow !
wonderful idea !

Compass compass

Compass compass compass!

http://wiki.github.com/chriseppstein/compass

It relies on Sass, which is a more mature Ruby ... library? application? It's a ruby something. Gem! That's it.

So Compass brings known CSS frameworks into the picture: Blueprint, YUI, 960. Sass is a CSS metalanguage that compiles to CSS like LessCSS does. You can create constants to define reusable color or font definitions. You can do math and concatenation in your styles with Sass:

p
:margin-bottom = (!line_height / !font_size) + "em"

It correctly knows CSS units like px, em, %, etc.

but the best thing about Compass is that it makes Sass easier to use outside Ruby projects. I can't recommend compass enough!

Inspired by this and other

Inspired by this and other pages about LESS, I made a CSS pre-processor that uses the LESS php compiler at http://leafo.net/lessphp/

It works with css that is either added by modules or the theme.

Just waiting on CVS...

Dev version is up LESS CSS

Dev version is up LESS CSS Preprocessor

Integration to Drupal

Hello, do you have any idea how to use LESS in Drupal clearly? I think, it could be the best if LESS preprocessor will be integrated to Drupal's css aggregation engine.

I suggest checking out

I suggest checking out http://drupal.org/project/less

It fully integrates with CSS aggregation.

nobody click here