By Peter Bell

LightCSS - an Easy CSS Framework - any Interest?

I've been playing with a bunch of the open source CSS frameworks, but I never really found a simple plug and play solution to my problem.

I wanted something where I could pick from a set of common conventions (with/without topbar, sidebar, rightbar, etc.) that supported pods within content areas, and that meant someone who knew very little CSS could still create tableless websites for the vast majority of simple sites in a short period of time using a standard approach.

I've been working with a very smart developer (Thomas Turnbull - expect to hear more about him in the future) to develop a CSS framework that makes it easy to create site templates in under an hour from a JPEG and that I could wrap with a CMS and generator to allow non-technical users to manage their CSS using a nice administrative wizard (that won't be done until early next year) . . .

So far the project is going really well, and I'm going to include this as part of the LightBase project as well as setting up a separate LightCSS project that Thomas will run and that will provide this to people who don't want to use LightBase (or even ColdFusion).

I KNOW there are a lot of CSS frameworks out there, but I just never found one that seemed to fit what we were trying to do this well - select from a list of standard structural templates, customize a few bits and then move on. They were either too prescriptive in terms of "pick a look and feel" which didn't work as we need to work from JPEGs or not prescriptive enough meaning it took over an hour to go from JPEG to working CSS which is just too slow for the business we are in.

Very early stages, but this is starting to look interesting. would anyone be interested in finding out more about this/playing with this/getting involved? We never really wanted to build a CSS framework, but this just fitted what I think is a common requirement - very quick development of completely custom layouts - with the understanding that 99% of the time those layouts fit within one of a number of common structural patterns even though they look graphically very different.

Any interest at all?

Comments
Peter, I am very interested in this, we are re-designing the site for a certain editor and it would be a great place to try it out!
# Posted By Mark Drew | 11/29/06 12:34 PM
I'd be happy to help, I seem to be your target developer. Basic knowledge of CSS, but always getting in trouble when attempting tableless design.. Let me know if you need someone to test anything.. :)
# Posted By Mateo | 11/29/06 12:41 PM
Hi Guys,

Perfect. Was wondering if this would just get completely shot down as I know there are bunch of CSS frameworks out there, but I REALLY couldn't find anything for this use case. Let me get the wheels in motion and I'll be in touch shortly!
# Posted By Peter Bell | 11/29/06 12:47 PM
Just a thought that hit me when I read this:

Why use MXML's container tags to "lay out" regions on a page, and then write an interpreter that distills an MXML file to CSS and DIVs? You could go as far as background images, colors, behavior, etc. You could also write plug-ins for additional MXML tags, like mx:Accordian, to create accordian divs/js.

However, not everything technically possible is a good idea.
# Posted By Joe Rinehart | 11/29/06 1:08 PM
Peter, interesting concept. Though not a generator you might be interested in http://www.code-sucks.com/css%20layouts/ as a place to get started. I think they have about 50 different design wireframes ranging from 1-4 columns, with/without header/footer etc etc
# Posted By Andy Jarrett | 11/29/06 1:16 PM
I've only built one or two layouts with it, but the <a href="http://developer.yahoo.com/yui/grids/">yahoo css libraries</a> are pretty slick, and easy to get the basics of. Nesting layouts in it makes just about anything possible it seems.

Either way it'll be fun to try out whatever you come up with.
# Posted By Adam Fortuna | 11/29/06 1:24 PM
This sounds like something I am interested in. Let me know what I can do to help.
# Posted By Matt Graf | 11/29/06 2:01 PM
@Joe - Stealing my thunder!!! I've been thinking about moving to a general declaritive component based model where you can broadly specify your UI components and then have them rendered using AJAX, Flex or HTML (each using different techniques to handle filtering, paging, form display, etc.).

Coming back to 2006 for a moment, I think there is a place for components within the UI (such as a proper data grid), but I'm not yet convinced that a component only specification is sufficiently flexible for all the little snippets of junk that real world applications tend to require, but this is definitely the direction I am thinking about long term along with a WYSIWYG GUI deployment technology agnostic screen builder for building views and screens and pages. In practice though I don't know if it would ever work and I am sure it would take a while to get it solid (I'm thinking late 2007, but I could be wrong!).

@Andy, Thanks - will play with that one and see what it looks like and let everyone know.

@Adam I find the complexity of the Yahoo! library too high. The generic support for nesting allows you to do everything, but it makes the handful of real world layouts we usually have to deal with more complex than they need to be.

@Matt, Cool, thanks! I'll check out Andy's link to see if this solves the problem well enough. If so I'll direct everyone there. If not I'll explain why it doesn't work for me and for anyone else who prefers LightCSS we'll get this show on the road!
# Posted By Peter Bell | 11/29/06 2:58 PM
@Andy,

Thanks for the link. I get what they have done, but they haven't solved the problem for me. I need pod support, I need the ability to define things like a content footer (under the content area) and a full width footer (across the whole width of the bottom), and I also need a set of best practices for navigation and content area based tags with support for setting tags as a site level (perhaps the general bodytext div is consistent site wide) and overriding at a pane level (where I want to not have underlines on my sidebar links but to have them throughout the rest of the site) and it should make all of that really easy. I also wanted to define an appropriate subset of standard ad advanced properties for each class of div (distinguishing between image, text and container based properties) and to clarify which were standard and which were advanced so it would be easy to write a generator for managing it.

So, I think still enough value in LightCSS to be worth doing. From there I'll then work on the generator.
# Posted By Peter Bell | 11/29/06 3:02 PM
Peter,

Mollio might be a start

http://www.mollio.org/
# Posted By Pragnesh Vaghela | 11/29/06 5:13 PM
Hi Pragnesh,

Thanks. I've not played with Farcry (although I keep meaning to), but I knew they were involved with Mollio so I did check it out. It does some of the things I wanted in terms of the containers but not some of the other things and in the end it was as easy to just work up a new framework with a slightly different approach. I don't believe it is the complete solution, but it is definitely an alternative people should consider to LightCSS and has a Google groups with a few postings most months so there is some usage.

I'm still going to get LightCSS finished out, as it seems to have a place, but I agree Mollio is about as close as I've seen to a solution so far for what I'm looking for and I like their nice clear style guide (although think it could have been done in jpg's - I don't love downloading PDFs!
# Posted By Peter Bell | 11/29/06 5:23 PM
Peter, no worries. I know you are looking more at the generation it was more for getting an idea of the range of layouts.

Just thinking out loud here (I know I shouldn't but no one is here to stop me) but carrying on from what Joe said. If you defined the xml could the interpreter not be XLST to create the HTML and CSS?? (sorry if thats what you meant Joe).
# Posted By Andy Jarrett | 11/29/06 5:27 PM
Hi Andy (and Joe),

Honestly I need to play with Flex as I don't know enough about MXML container tags and their expressiveness. If they were sufficiently expressive this would be a really interesting approach as it would allow you to use a single language for layouts irrespective of deployment technology which would be cool from a syntax PoV even if you chose to implement different skins for rich vs. traditional displays (which is likely). I'm concerned as to whether the MXML would be sufficiently expressive, but will have to find out when I get a chance!

FWIW, I don't love XSLT so I'd probably just treat the XML as a domain specific language to drive the generation of the appropriate HTML/CSS, but the XSLT approach probably makes more sense if you're comfortable with the approach and syntax.
# Posted By Peter Bell | 11/29/06 8:13 PM
I would be very interested in this, it ties in nicely with what I am planning to do with some work next year :)
# Posted By Wayne Putterill | 11/30/06 4:24 AM
Intersting idea Peter, anything that can speed up development time is always interesting. I like Joes idea of using MXML, that way your keeping within the Adobe realm and not asking people to learn wayout funky tags
# Posted By nick tong | 11/30/06 8:10 AM
Thanks guys. Will check out if MXML will do the job and will keep you posted!
# Posted By Peter Bell | 11/30/06 9:37 AM
I think the key comment was from Joe, and may have been missed....
"However, not everything technically possible is a good idea."

Why introduce an unrelated language for anyone using this framework to learn.
To solve the problem you are trying to solve, just make the position/layout and css customization easier and you solve your problem. Very few CF developers know mxml, plus it is so verbose. I personally don't care for flex and don't really want to have to learn mxml just to layout an HTML/CF app.

In other words make the difficult part easier (layout & positioning) through your framework as most CF or HTML developers are familuar with style property names and what they do.
# Posted By doug s. | 11/30/06 3:47 PM
Hi Doug, good point. I'll implement as simple tool, but may support MXML as alternate input type if it ends up making any sense! As you said, Joe just mentioned the possibility - he didn't venture an opinion as to whether it was a good idea and I've been to swamped to even think about it. Either way, LightCSS is a go. Will keep y'all posted!
# Posted By Peter Bell | 11/30/06 7:33 PM
What a great idea!
Your blog rocks!
I loved learning about http://www.code-sucks.com
# Posted By Phillip Senn | 8/7/07 8:34 PM
i very much enjoyed your article about lightCss in the latest fusion authority. Is there a place to download the example the lightcss.riaforge.org isnt working.

thanx
# Posted By josht | 1/8/08 12:38 AM
Hi Josh,

Thanks for the comment. Since I wrote the article, I've actually changed my position on handling CSS (sometimes you just need to try different things and they don't all work out as you'd expect!). I'm now more focused on creating a framework for a set of use cases that focused on the semantics of the content rather than presentational markup. When I get something stable enough to share, I'll definitely release it.

The closest to LightCSS that I've found would be YUI grids or Blueprint. They are definitely different, but Blueprint in particular is a quick and easy way of creating CSS for sites if you're not too concerned about keeping presentational information out of your markup.
# Posted By Peter Bell | 1/8/08 6:00 AM
Would you call what you are developing a "CSS Design Pattern"?
# Posted By Phillip Senn | 1/8/08 9:00 AM
@Phillip, I'd probably call it a framework as there will be specific code that is reused between projects such as the reset code, but there will be some patterns involved!
# Posted By Peter Bell | 1/8/08 2:42 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.005.