News for hackers. Stuff that matters.
Re:Less, a leaner CSS by cloudhead on Tuesday June 16, 2009 @06:06PM (#660989)
Great to have you on board! Compass was definitely one of the inspirations behind Less. Unlike Compass, though, I'd like to keep it small, as it is and as close to CSS as possible, so the more complex features of Compass probably won't find their way in Less, unless they fit the ideal.
Re:Less, a leaner CSS by chriseppstein on Tuesday June 16, 2009 @06:40PM (#661027)
I know the distinction between Sass and Compass is blurred for many folks, much like ruby and rails.

Compass is libraries and tools to provide project management and community features, sass is the syntax that makes compass possible. Compass could be built on any css syntax with a comparable feature set to sass.

So my point was that until you provide those more heavyweight features in the core language, you cannot have a framework like compass. Frameworks drive adoption, so think about that decision carefully. Having powerful features doesn't force them to be used, but not having them, creates limitations.

Re:Less, a leaner CSS by cloudhead on Tuesday June 16, 2009 @10:50PM (#661290)
'Having more features doesn't force them to be used' — correct, but it changes the perception people have of the tool, as well as what they start to expect from it.

I personally favor smaller tools which do the least amount possible while still fulfilling your needs. That's why, for example, I'm not a huge fan of Rails, and would much rather use Sinatra when I can. I know I'm not the only one.

It's this sort of overhead I'm trying to avoid. Less is very straightforward, and I want to keep it that way—there's not much you need to learn to start using it, and the code base is tiny. For most use cases I think the feature-set will be more than enough, and if it's not, we have Compass.

Re:Less, a leaner CSS by chriseppstein on Tuesday June 16, 2009 @11:29PM (#661325)
You're still confusing sass and compass.

Like I said, your current feature set is ample for the 95% use case of normal web development. To that end, we are in complete agreement.

I don't know how familiar you are with blueprint, but the less syntax doesn't support creating new abstractions that simplify design.

In sass using the compass port of blueprint we can do this:

#sidebar +column(8)

which generates:

#sidebar { float: left; margin-right: 10px; width: 310px; }

The column mixin is defined here: http://github.com/chriseppstein/compass/blob/master/framewor...

So what could be the equivalent less syntax for this?

div#sidebar { .column: 8; }

This is wonderfully easy for end users, but the language syntax has to become more complicated to support it. You have to be able to specify the arguments for the mixin. Also, you need a way to refer to the parent selector within the mixin abstractly. In sass we use the & symbol to represent the selector's context. I don't know what a "css-like" syntax would be for these capabilities. I would argue that they don't really have to be that "css-y", but they just have to play nicely with existing CSS syntax, because normal users don't need them.

Anyways, it's your project... But I've spent the last year thinking about these sorts of issues. If you want to discuss further, you can hit me up on github.

-chris

Re:Less, a leaner CSS by 9oliYQjP on Tuesday June 16, 2009 @11:32PM (#661331)
I think you made the right call. CSS isn't complex enough to need a framework. In a lot of cases, CSS frameworks abuse the primary motivating factor for trying to separate style and content in the first place. If I have to use particular HTML markup or class naming conventions, I may as well just forego the separation of content and style altogether and use table layouts.

But less appears to make desperately needed additions that should ultimately show up in CSS itself IMHO. Certainly when I was first picking up CSS -- given my programming background -- I was reaching for the concept of variables and in fact was surprised that they did not exist in CSS. For that reason, I'd consider less to be more of a language extension than a framework.

Re:Less, a leaner CSS by chriseppstein on Wednesday June 17, 2009 @12:06AM (#661361)
You don't know about compass then. Go watch the screencast.

CSS isn't complex, but building websites that work correctly in 8 web browsers most certainly is. Compass frameworks give you re-use without semantic fail.

Re:Less, a leaner CSS by Keyframe on Wednesday June 17, 2009 @04:55AM (#661567)
I've just started using sass/compass for a project and I can tell I am more productive than ever, though I am using 960.gs instead of blueprint with compass. I am using compass for sass/960 and staticmatic for haml - so I can output a set of html/css files which are used in my php project.

I am loving it, especially since staticmatic has preview mode and compass has --watch mode - so I have both running and auto updating my preview while I work on it. Even if I didn't use haml at all and no framework (960), it would still make sense for sass variables and mixins with input variables alone.

building sites that work across browsers is easier with reset+some framework, but I still have to have IE7+ specific css, and compass seems a bit moody on windows.

edit: I am not sure if I would be comfortable using anything external to css to output css that has the same syntax, like less seems to have - it would most likely pollute my way of thinking down the road.

Re:Less, a leaner CSS by 9oliYQjP on Wednesday June 17, 2009 @09:59AM (#661824)
I do know about compass, but I have a feeling compass will be to less what Prototype is to jQuery, at least for me. When I first learned Prototype I thought it was awesome, but jQuery just ended up making a whole lot more sense to me. Different strokes for different folks I suppose.
Re:Less, a leaner CSS by carbon8 on Wednesday June 17, 2009 @11:45AM (#661983)
What you are describing would be closer to Sass vs Less, not Compass vs Less. Compass is a meta-framework built on Sass to make working with CSS frameworks much simpler, easier, cleaner and more flexible.

In your case, you don't use CSS frameworks at all, but you just want a few features that aren't in CSS, so Compass isn't what you'd be considering, Less or Sass would be.

Re:Less, a leaner CSS by chriseppstein on Wednesday June 17, 2009 @01:48PM (#662179)
At least someone gets it ;-)
Re:Less, a leaner CSS by 9oliYQjP on Wednesday June 17, 2009 @02:06PM (#662207)
If I don't want to use a framework like blueprint, and I actually prefer (in this context) the CSS syntax (e.g., braces et al) as opposed to HAML, then is compass still useful to me? That's what is (now) confusing to me given your replies to my original comment. My original criticism isn't of compass. It's just that if I don't like blueprint/YUI/960, then would it not be redundant to use compass?

Hopefully you don't take this personally. If I ever find myself required to use one of the above frameworks, they would probably be a lot more palatable when used in conjunction with compass.