smacss-2012-08-21.pdf

(1107 KB) Pobierz
{
Scalable and Modular
Architecture for CSS
A flexible guide to developing
sites small and large.
by Jonathan Snook
}
Scalable and Modular
Architecture for CSS
By Jonathan Snook
Copyright 2012 Jonathan Snook
All Rights Reserved
SMACSS: Scalable and Modular Architecture for CSS
http://smacss.com
ISBN 978-0-9856321-0-6
Snook.ca Web Development, Inc.
Ottawa, Ontario, Canada
http://snook.ca
Second edition
About the Author
Hi, my name is Jonathan Snook. I am a web developer and designer
who has been building websites as a hobby since 1994 and as a pro-
fessional since 1999.
I maintain a blog at Snook.ca where I write tips, tricks and book-
marks on web development. I also speak at conferences and work-
shops and have been thankful to have been able to travel the world
to share what I know.
I’ve co-authored two books to date: The Art and Science of CSS
(from Sitepoint) and Accelerated DOM Scripting (from Apress). I’ve
also written for .net magazine, A List Apart, Sitepoint.com, and
many more resources online and off.
Having worked on hundreds of web projects, including most recent-
ly on the successful Yahoo! Mail redesign, I’ve written this book to
share my experience with building websites small and large.
I’d like to express my deepest gratitude to everybody within the
community. Each and every one of you make this a career that I
continue to enjoy having. A special thank you to Kitt Hodsden for
pushing me to write this and share it with everyone. Lastly, to my
boys, Hayden and Lucas, who continue to push me to be a better
person.
Scalable and Modular Architecture for CSS
1
Introduction
I have long lost count of how many websites I’ve built. You would
think after having built a few hundred of them I would have discov-
ered the “one true way” of doing it. I don’t think there is one true
way. What I
have
discovered are techniques that can keep CSS more
organized and more structured, leading to code that is easier to
build and easier to maintain.
I have been analyzing my process (and the process of those around
me) and figuring out how best to structure code for projects on a
larger scale. The concepts were vaguely there with the smaller sites
that I had worked on but have become more concrete as a result of
working on increasingly complex projects. Small sites don’t often
hit the same pain points as larger sites or working with larger
teams; small sites aren’t as complex and don’t change as often.
However, what I describe in these pages is an approach that works
equally well for sites small and large.
SMACSS (pronounced “smacks”) is more style guide than rigid
framework. There is no library within here for you to download or
install. SMACSS is a way to examine your design process and as a
way to fit those rigid frameworks into a flexible thought process. It
is an attempt to document a consistent approach to site develop-
ment when using CSS. And really, who isn’t building a site with CSS
these days?! Feel free to take this in its entirety or use only the
parts that work best for you. Or don’t use it at all. I understand
that this won’t be everybody’s cup of tea. When it comes to web de-
velopment, the answer to most questions is “it depends”.
2
Scalable and Modular Architecture for CSS
Zgłoś jeśli naruszono regulamin