Frameworks for Designers

by Jeff Croft

55 Reader Comments

Back to the Article
  1. Given that the article leads off by saluting the (fantastic) YUI along with other front-end engineering frameworks, I’d like to direct your readers’ attention to the Yahoo Design Pattern Library ( The YUI and YPL are closely related and we are working on making them even more useful for designers, developers, and hybrids.

    Copy & paste the code below to embed this comment.
  2. This is a great article, and very relevant to what I’m working on right now. It seems like I learn something new after every new site produced to come closer to the subject of this article, but I don’t have the luxury of working on a mega-site like Yahoo yet to cooperate with frameworks that really make a difference.

    What I do know is that this pursuit makes production much easier to keep things simple, clean and as standardized as possible so engineering can program exactly what we intended. However, the designs I produce tend to be so pixel-precise and intricate with multiple font decorations per line and slight alterations designers love to include. My pursuit of standards and frameworks break down by the time we launch because of all the little page-level tweaks to keep things pixel-perfect. Do sites that focus on less highly-designed Web content have less trouble adhering to standards and frameworks?

    Copy & paste the code below to embed this comment.
  3. I really enjoy the articles on this site, and am still amazed how the internet can give you access to so many cool people. I live in Charlotte, NC and am having trouble hooking up with other people to discuss this stuff.

    Anyway, one thing I started doing is using the code completion in my text editor to write my standard css files for me. Think of custom textmate bundles for writing certain parts of your css file. (I’m on windows at the moment, so I use, but it works the same more or less). 

    So if you are going to use left navigation, maybe you create a shortcut named xxleftnav or xxrightnav for right navigation and so forth. If you’re like me when you work on new sites you tend to have the same layout structures which lend themselves to a library of css layout templates. Enjoy, Brian

    Copy & paste the code below to embed this comment.
  4. Great article, I think it would be a good idea for me to make a CSS framework.

    You rightly mention that multiple stylesheets can have a significant impact on performance, and that one stylesheet it a solution, but say this is inconvenient to update. I don’t think it would be as bad as you make it out to be, and in my opinion this would be best if the stylesheet was well commented.

    Copy & paste the code below to embed this comment.
  5. Hey Alex, thanks for your comments! I think it’s simply personal prefer as to whether people like maintaining one long CSS file or a handful of shorter ones. I like breaking them out, but I definitely know people who like one long one better. So, to each his own.

    The other downside of one long file, though—besides maintenance—is that you can’t include only bits of the framework, you always have to include the whole thing. Depending on the framework you create, this may or may not be an issue, but it’s something to think about.

    I think the ideal solution is to allow for multiple files but have a server-side process that concatenates them together and sends only one long file to the browser.

    Copy & paste the code below to embed this comment.
  6. Hey all,
    After reading Jeff’s article, I put together a simple framework   using paradigms I’ve found helpful in most of my projects (I’d been thinking about it for a while, but the article convinced me to bite the bullet).

    I’m releasing it under GNU in hopes it might be useful to others too. I’m calling it Taffy (Every framework needs a cute name, right?). Hope it helps out, if not as a framework, at least as another example.

    Check it out here: “Taffy Framework”:

    Copy & paste the code below to embed this comment.
  7. I’m not a web designer, just some idiot who has time to much around with her own site. But, this is something I was looking for two years ago when people started talking about CSS and XHTML and having sites that were accessible. I’m glad to see someone thinking about it who actually knows what they are doing. I’d love to have a frame. Especially right now as I have still not fixed my code, mainly because I’ve had less time and less patience and after all it is just my pet project. Hardly anyone but me knows about it. :)

    Copy & paste the code below to embed this comment.
  8. I have seen many design teams using framework and specially offshore team, in order to keep them not to far from what was required we suggest framework. Armand Rousso

    Copy & paste the code below to embed this comment.
  9. A clean usable set of code to do header, menu, 2 and 3 col body, and footer available in a forum is doable. Someone who has asked needs to take and volunteer to moderate it and we can tean to create content. 1ho volunteers? ((-:
    5ale on my blkbry in Oceans 13

    Copy & paste the code below to embed this comment.
  10. If you create a frameworks of multiple CSS files and concatenate them in one long file, server-side, you are saving the HTTP requests and lightening the load on your server; but you are creating a scenario where you are potentially creating many different on-the-fly, unique css files that are long and different page by page. In other words, the client must download them each time because they will not be recognized as cached (even though they are using the same chunks of frameworks). On top of that, for every unique sheet that’s not seen as being cached, the client will download all those bits and bytes again—more tax on your server.

    If you use the individual framework components as separate files, you are taking advantage of caching in the client, but then you are creating a server load as the clients tax the server with HTTP requests to see if their cached versions have been updated on the server or not.

    Seems like the server-side solution could be a good one as long as you limit the number of permutations of unique files that the server-side solution would serve up.

    Copy & paste the code below to embed this comment.
  11. While this is a great article, it could use more examples.  I really hate to see the multiple http request problem not solved.  I would just create in PHP (or your language of choice) one file that includes all the others (e.g. using php’s include function) – at least that will reduce the network overhead.

    Copy & paste the code below to embed this comment.
  12. In the past I have merely copied, pasted and modified working CSS from past sites when designing new ones with a similar layout, so moving to a framework is a logical step. Thanks for bringing Yahoo’s UI library to my attention, too – it looks incredibly useful. I look forward to cutting out time working out issues like why my div is 2 pixels to the left in IE and having fun getting back to actually designing!

    Copy & paste the code below to embed this comment.
  13. If you use “TextMate”: , you can specify the default content when creating new files types. For example, you can edit the template that creates new XHTML Strict 1.0 documents to already have the structure you prefer (like including YUI CSS links, etc…).

    I then use “Snipplr”: and their “TextMate Bundle”: to easily pull in my own code snippets or favorite code snippets. The bundle saves those snippets offline in TextMate, which is useful if I’m coding offline. The combination of TextMate and Snipplr is my framework.

    Copy & paste the code below to embed this comment.
  14. Good article, this is something that I’ve been thinking about quite a bit recently. Most of it seems like common sense, but then all the best ideas do. I agree with Jon Henshaw above with regard to ‘implementing’ this framework.

    I have a few core CSS files that I always start a site with:

    • reset.css (from Eric Meyer)
    • IE_only.css (to sort out the misbehaving children)
    • styles.css.

    The last one will eventually have all the main styles in, but it starts with some basics that I always use (styles for links, setting font size to 62.5% etc) and then I build on this.

    Any common code that I often use is saved as snippets for use with the Scribes text editor. For example I have a nice snippet that creates a tabbed navigation bar within a few keystrokes – it makes development much quicker.

    Copy & paste the code below to embed this comment.
  15. Yes!

    Copy & paste the code below to embed this comment.
  16. This si a text grabbed from my guidelines

    Site-wide blocks like sidebars, navigations and complex forms included after the content section. My ideal positions of the code blocks in the <body> are as follows:

    1. Header — contains logo (image) and concise slogan (text) of the site. Header can also contain few links to the most important navigation sections of the site (2-5 links) and breadcrumb trails. It is important to keep this information first for branding and accessibility. This also tells the search engine which pages are the most important.
    2. Content — starts with heading 1 and continue with the copy paragraph text, headings (2, 3”¦), unordered and ordered lists”¦ If the content contains semantic blocks, these should be wrapped in a div. Example: information about one product in a group of products should be enclosed in a &lt;div&gt;. This &lt;div&gt; can contain heading with the link to the product page, image of the product and paragraph text with the product description. More information about the content and copywriting has been in the copywriting guidelines document.
    3. Secondary content — if you have one, it is usually the non-site-wide navigation specific for the current section
    4. Sidebars — should contain site-wide-navigation and all the site—wide search forms and similar stuff. The ideal structure of the navigation is unordered list &lt;ul&gt;&lt;li&gt;&#8221;¦&lt;/li&gt;&lt;/ul&gt; or nested unordered list &lt;ul&gt;&lt;li&gt;Section<ul><li>Subsections</li><li>another subsection</li></ul></li></ul> in case you have sub sections. If the sections contain many other sub-sections, you should put this in a separate list to the secondary content. See ““”: to find out how to give your list-based navigation the look you need.
    5. Footer — contains the most generic information. Footer may contain information about author/owner of the page enclosed in the &lt;address&gt; tag. The &lt;address&gt;  should contain full address, e-mail and telephone number. You may want to add more semantics here using VCARD format. To include an address is espacially important for local business sites to make the page rank for local terms: “Type of the business and name of the location”? (E.g.: Travel agents Swindon, PPC Warrington) and ensure user can easily find contact details. Footer can also contain link to T&C, Site-wide sitemap and copyright/licence information.
    6. Wrapper – Everything is wrapped in the wrapper to make it easier to create which has its position:relative to make the layouts easier with position:absolute

    Every layout style sheet than looks like:
    <br /> *{margin:0;padding:0}<br /> body{}<br /> #w{}<br /> #h{}<br /> #c{}<br /> #s2{}<br /> #s{}<br /> #f{}<br /> .class1{}<br /> .class2{}<br /> ...<br /> #c p{}<br /> #c ul{}<br /> ...<br /> #s ul{}<br /> #s li{}<br /> #s ul ul li{}<br />

    Colours and backgrounds are often separated in the stylesheet called theme.css

    If anyone fancy I’ll write an article about my field tested madular CSS/XHTML strategy.

    Copy & paste the code below to embed this comment.
  17. This is a good article. Thank you.

    My main concern is that how are we going to communicate the existing styles to the other designers for reuse? More often than not, the styles do not get reused simply because they are hard to find. Should we create some sorts of documentations (e.g. screenshots) for every major style?

    Copy & paste the code below to embed this comment.
  18. This is a great article to get us thinking.  I really like the idea of standardizing our approach to CSS.

    To your list of 5 basic style sheets I might add one for microformats since there are some basic styles I generally end up applying to them and the classes are 100% predictable.

    I worry that class names like “tabs” aren’t semantic.  I haven’t played around with it myself (I have a full time day job maintaining one site) but I’m wondering what your thoughts are on starting with a predictable basic XHTML layout that has common semantic class/id names in it like a header area with a nav list in it by default and then grabbing an applying different basic style sheets (or parts of sheets) depending on how you want those formatted.

    Copy & paste the code below to embed this comment.
  19. Vox wrote a server-side solution to concatenate all their .js and .css files into one each for the client.

    Start at slide 47.  Not much on the detail side, though.  Wouldn’t be very difficult, though.

    Copy & paste the code below to embed this comment.
  20. Vox wrote a server-side solution to concatenate all their .js and .css files into one each for the client.

    Start at slide 47.  Not much on the detail side, though.  Wouldn’t be very difficult, though.

    Copy & paste the code below to embed this comment.
  21. I really enjoyed this article, and immediately wanted a solution for concatenating all my css files. Basically I wish @import had less side effects.

    So I wrote one, and made it public for anyone else who wants to use it:

    10KB PHP file and 2 lines of .htaccess, and you’re off to the races. Supports caching, basic compression, and even a little debug.

    I’d like to hear feedback, as I’m new to this sort of thing. Thanks again for the inspiration.


    Copy & paste the code below to embed this comment.
  22. On HTTP connections vs. stylesheet size, what’s wrong with using @import in a CSS 2.0 world? Cascading is supposed to be a core feature—it’s the ‘C’ in CSS after all.

    For the framework I built for our developers, there is a basic.css. More advanced stylesheets import the BASIC.css. Some have multiple imports to other css ‘modules’, for example, TOOL.css imports BASIC and GRID (GRID imports TABLE), while GUIDE.css which doesn’t need GRID only imports BASIC and TABLE.

    As long as you keep the functionalities simple and nested, developers only see a few choices (TOOL, GUIDE), and the cascade logic takes care of the rest, while giving me the ability to add new modules or styles only where needed without steadily increasing BASIC.

    I’m sure some more advanced folks will let me know why this is bad somehow, but it has worked here for a few years in our (admittedly homogenous) environment (an intranet).

    Copy & paste the code below to embed this comment.
  23. As many others, I really like to keep it minimal. But even at minimal, I tend to use at least three CSS files. Basics, IE fixes and then the rest. I’ve never used a framework and probably never will. Good article tough, many points i’ve not know of. Thanks!

    Copy & paste the code below to embed this comment.
  24. I know it’s been a while since you’ve written this article, but I wanted to tell you thanks for taking the time to share your experience. We have been getting a lot of requests for larger MVC sites that are very complex from a GUI perspective (not to mention the programming aspect), and we are definitely seeking an optimal approach with our CSS and designs, as we’ve been spending a lot of time looking at each other’s CSS and going, “huh?” and “what the …”.

    Your article is just what I was looking for.

    Copy & paste the code below to embed this comment.
  25. You said:
    Have a server-side process that dynamically flattens the individual files into a single response. I’ve not seen this done, but it could be very efficient if done well.

    Actually Google Pagespeed project supplies code that can be used to flatten and minify your css into a single request.

    Copy & paste the code below to embed this comment.