The document discusses using CSS frameworks to speed up web development by avoiding having to repeatedly write CSS resets and layout code. It describes the Blueprint CSS framework, including how it provides a grid system, typography styles, and other components out of the box. The author explains how using a framework like Blueprint CSS can save significant time over building sites from scratch each time.
3. How to spend more time building sites and fewer days debugging IE
4. Outline The problem we had About CSS Frameworks About Blueprint CSS Our experience
5. Problem I realised that every new project I began, I was beginning from scratch
6. Problem Global reset of all browsers to reduce browser inconsistencies . Setup the page layout Setup the typography , images , forms , general HTML tags, etc.
7. Problem Sometimes, I'd recycle code from previous projects.
9. Problem Reinventing the wheel doesn't always lead to reliable results. http://www.dev102.com/2008/11/25/10-ways-to-programaticly-shoot-yourself-in-the-foot-part-b/
10. After launch After months of development, the day after you've launched a new site invariably …
11. The client says… "But we wanted a 3 column layout !"
12. The client says… "Well, you never told us that …!"
13. The client says… "We need one, like … right now !"
14. The client says… "OK, but it'll take a couple of hours to code it up…"
24. What a Framework is “ A set of tools, libraries, conventions and best practices that attempt to abstract routine tasks into generic modules that can be reused .” — Jeff Croft http://www.alistapart.com/articles/frameworksfordesigners
25. What a CSS Framework is “ A library that is meant to allow for easier , more standards-compliant styling of a webpage using the Cascading Style Sheets language.” — Wikipedia http://en.wikipedia.org/wiki/CSS_framework
26. What a CSS Framework is “ The goal here is to allow the designer or developer to focus on tasks that are unique to a given project, rather than reinventing the wheel each time around.” — Jeff Croft http://www.alistapart.com/articles/frameworksfordesigners
27. Problem And we remember how that looked! http://www.dev102.com/2008/11/25/10-ways-to-programaticly-shoot-yourself-in-the-foot-part-b/
28. Types of CSS Framework Preset-layouts Grid-layouts Content with Style Yahoo! UI Grids 960 Grid System Blueprint CSS YAML
29. Preset-layouts: Content with Style Vertical navigation Horizontal navigation
31. Elements of a CSS Framework Global reset of all browsers to reduce browser inconsistencies . Setup the page layout Setup the typography , images , forms , etc. Modular Optional plugins
32. Advantages Cross-browse r support Faster development time Well-structured, modular code Visual design cohesion Helps beginners learn
33. Disadvantages Often non-semantic Bloated code Limited — a lack of flexibility You inherit other people's bugs Can take time to learn
34. Disadvantage #1: Non-semantic (1/2) Often get non-semantic classes such as: <div class="column span-4"> Either add an ID to <div id="logo" class="column span-4"> And/or copy the code for these non-semantic classes into your CSS code for #logo once you're happy with the design.
35. Disadvantage #1: Non-semantic (2/2) Custom CSS #logo { background-color: black; float: left; margin-right: 10px; width: 150px; } Declarations from .column and .span-4 in framework.
36. Disadvantage #2: Bloated code (1/3) CSS Frameworks generally try to cover every eventuality . Unlikely you'll need to use every declaration in every project. Blueprint CSS is only 15 KB compressed including print.css and ie.css . Use Firefox plugin Dust-Me Selectors to identify unused selectors in your CSS files. www.sitepoint.com/dustmeselectors/
39. Disadvantages: Limited CSS Frameworks can be limited to the needs of the author, lacking flexibility. Many frameworks have MIT or GPL licences allowing you to adapt them. Most frameworks are modular , so just write your own plugins to extend them.
41. Blueprint CSS http:// www.blueprintcss.org MIT license use, copy, modify, publish, sell, etc ... 24 columns 30px + 10px right-margin = 40px Last column has no right-margin Total width = (24 x 40px) - 10px [last] = 950px
42. Blueprint CSS: Elements File Purpose reset.css Resets default browser CSS. grid.css Easy to use grid of 24 columns . typography.css Sets up some sensible default typography: headings, text elements, lists, tables, misc. classes. forms.css Default styling for forms plus classes to enhance your forms. ie.css Contains every hack required for IE . print.css Sensible styles for printing pages .
43. Blueprint CSS: The grid: 24 columns 24 columns
67. Blueprint CSS: Tweak the content Add some random text to #content <p>Lorum ipsum sit dolor amet, consectetuer adipiscing elit...</p> Here's one I made earlier ... Add an unordered-list to the #sidebar <ul> <li>Lorum ipsum sit dolor amet</li> <li>Consectetuer adipiscing elit</li> ... </ul>
69. Blueprint CSS: Add columns Let's add two columns to #content
70. Blueprint CSS: Add columns Locate the CONTENT div <div id="content" class="span-16 last"> <h2>Content</h2> <p>Lorem ipsum sit amet ...</p> </div>
71. Blueprint CSS: Add columns Add first column … <div id="content" class="span-16 last"> <h2>Content</h2> <p>Lorem ipsum sit amet ...</p> <div id="column1" class="span-8"> <h3>Column 1</h3> <p>Lorem ipsum sit amet ...</p> </div> </div>
72. Blueprint CSS: Add columns Add second column … <div id="content" class="span-16 last"> <h2>Content</h2> <p>Lorem ipsum sit amet ...</p> <div id="column1" class="span-8"> <h3>Column 1</h3> <p>Lorem ipsum sit amet ...</p> </div> <div id="column2" class="span-8 last"> <h3>Column 2</h3> <p>Lorem ipsum sit amet ...</p> </div> </div>
76. Blueprint CSS: notice Add a notice box <div id="content" class="span-16 last"> <h2>Content</h2> <div class="notice"> <h3>Next meeting</h3> <p>University of Strathclyde, Glasgow on Friday 17 April 2009.</p> </div> <p>Lorem ipsum sit amet ...</p> ... </div> ... we'll also remove showgrid from the container div.
98. Middle of the presentation Time for half-time oranges
99. Conclusion Get things done much faster Continuity across sites Standard way of doing things Flexible and maintainable
100. < / Using a CSS Framework > Gareth J M Saunders, Scottish Web Folk, 17 April 2009
101. Image credits Framework photograph by budesigns http://www.sxc.hu/photo/13538 Icons http://www.iconlook.com IE with pins http://www.sajithmr.com/wp-content/uploads/2008/10/internet-explorer-logo-with-pins.jpg Firefox eats IE http://www.bbspot.com/Images/News_Features/2008/06/firefox-eating-ie.jpg Bike with triangluar wheels http://www.dev102.com/2008/11/25/10-ways-to-programaticly-shoot-yourself-in-the-foot-part-b/ Borat with thumbs-up http://img371.imageshack.us/img371/3194/thumbsupag3.jpg Oranges by chris27 http://www.sxc.hu/photo/1149135 http://www.sxc.hu/photo/1149134
102. Creative Commons licence Attribution-Share Alike 2.5 UK: Scotland You are free: to copy, distribute, display and perform the work to make derivative works Under the following conditions: Attribution: You must give the original author credit. Share Alike: If you alter, transform, or build upon this work, you may distribute the resulting work only under a licence identical to this one. For any reuse or distribution, you must make clear to others the licence terms of this work. Any of these conditions can be waived if you get permission from the copyright holder. Nothing in this license impairs or restricts the author's moral rights. Gareth J M Saunders [email_address]