5. The problem
w/ css in large scale use
• Code is rarely being reused
3
6. The problem
w/ css in large scale use
• Code is rarely being reused
• File size keeps getting bigger
3
7. The problem
w/ css in large scale use
• Code is rarely being reused
• File size keeps getting bigger
• Code can easily be broken
3
8. The problem
w/ css in large scale use
• Code is rarely being reused
• File size keeps getting bigger
• Code can easily be broken
• Hard for new people to join the team
3
9. The problem
w/ css in large scale use
• Code is rarely being reused
• File size keeps getting bigger
• Code can easily be broken
• Hard for new people to join the team
• One guy does most of the work (*cough*me*cough*)
3
12. A solution: OOCSS
• Breaks down pages into “components” or “objects”
• Can be put together to create unique pages
4
13. A solution: OOCSS
• Breaks down pages into “components” or “objects”
• Can be put together to create unique pages
• Breaks down dependency between container and contents
4
15. So...what is OOCSS?
OOCSS is a method in which CSS is written to be reusable
and easily maintained
5
16. So...what is OOCSS?
OOCSS is a method in which CSS is written to be reusable
and easily maintained
A way of writing scalable, sane, maintainable CSS
- Nicole Sullivan
5
17. So...what is OOCSS?
OOCSS is a method in which CSS is written to be reusable
and easily maintained
A way of writing scalable, sane, maintainable CSS
- Nicole Sullivan
Best use is in large applications and/or large teams
5
18. So...what is OOCSS?
OOCSS is a method in which CSS is written to be reusable
and easily maintained
A way of writing scalable, sane, maintainable CSS
- Nicole Sullivan
Best use is in large applications and/or large teams
NOT A FRAMEWORK
But there is a framework called OOCSS (huh?)
5
22. Advantages
• Keeps file sizes down
• Reusing code is faster than making new CSS
• Minimal new CSS created
6
23. Advantages
• Keeps file sizes down
• Reusing code is faster than making new CSS
• Minimal new CSS created
• Easy to adapt to teams
6
24. Advantages
• Keeps file sizes down
• Reusing code is faster than making new CSS
• Minimal new CSS created
• Easy to adapt to teams
• Extends what can be done with markup
6
25. Advantages
• Keeps file sizes down
• Reusing code is faster than making new CSS
• Minimal new CSS created
• Easy to adapt to teams
• Extends what can be done with markup
• Consistent design = clean code = fast site (& happy dev guys)
6
71. Where to start
• Start building separate, reusable components (objects)
• Could be headings, boxes, buttons, etc.
18
72. Where to start
• Start building separate, reusable components (objects)
• Could be headings, boxes, buttons, etc.
• Use a grid
• Let grid control width & content control height
18
73. Where to start
• Start building separate, reusable components (objects)
• Could be headings, boxes, buttons, etc.
• Use a grid
• Let grid control width & content control height
• Separate structure and appearance
18
74. Where to start
• Start building separate, reusable components (objects)
• Could be headings, boxes, buttons, etc.
• Use a grid
• Let grid control width & content control height
• Separate structure and appearance
• Use consistent, semantic styles (duh)
18
76. Tip & tricks
• Be generic w/ your classes
• class=”warning-message-box-page” - bad
• class=”warning message pagelvl” - good
19
77. Tip & tricks
• Be generic w/ your classes
• class=”warning-message-box-page” - bad
• class=”warning message pagelvl” - good
• Assign unique IDs
• id=”eventcal_location”
• id=”profile_comments”
19
78. Tip & tricks
• Be generic w/ your classes
• class=”warning-message-box-page” - bad
• class=”warning message pagelvl” - good
• Assign unique IDs
• id=”eventcal_location”
• id=”profile_comments”
• Leave your code open
• div.error not .error
19
79. Tip & tricks
• Be generic w/ your classes
• class=”warning-message-box-page” - bad
• class=”warning message pagelvl” - good
• Assign unique IDs
• id=”eventcal_location”
• id=”profile_comments”
• Leave your code open
• div.error not .error
• Minimal use of float (it’s very possible!)
19
82. OOCSS resources
• OOCSS Framework - Nicole Sullivan
•http://wiki.github.com/stubbornella/oocss
• First Look : Object Oriented CSS
•http://www.sitepoint.com/blogs/2009/06/16/first-look-object-oriented-css/
• OOCSS and Being Generic with Your Base Classes
•http://www.bennadel.com/blog/1675-Object-Oriented-CSS-OOCSS-And-Being-
Generic-With-Your-Base-CSS-Classes.htm
20
OOCSS can be used across a company for multiple projects
OOCSS can be used across a company for multiple projects
OOCSS can be used across a company for multiple projects
An overall concept of oocss is to be able to reuse css easily
The base / modifier class can help
An overall concept of oocss is to be able to reuse css easily
The base / modifier class can help
An overall concept of oocss is to be able to reuse css easily
The base / modifier class can help
An overall concept of oocss is to be able to reuse css easily
The base / modifier class can help
An overall concept of oocss is to be able to reuse css easily
The base / modifier class can help
An overall concept of oocss is to be able to reuse css easily
The base / modifier class can help
1 here is the basic box element
2 once we start adding modifying classes, it changes
1 here is the basic box element
2 once we start adding modifying classes, it changes
1 here is the basic box element
2 once we start adding modifying classes, it changes
write your css to easily extend
write your css to easily extend
write your css to easily extend
here is an example of a grid i use w/ MF.
Notice i name all the columns with unique names
(CLICK) now this is breakdown of individual box elements i have on this page
here is an example of a grid i use w/ MF.
Notice i name all the columns with unique names
(CLICK) now this is breakdown of individual box elements i have on this page
here is an example of a grid i use w/ MF.
Notice i name all the columns with unique names
(CLICK) now this is breakdown of individual box elements i have on this page
here is an example of a grid i use w/ MF.
Notice i name all the columns with unique names
(CLICK) now this is breakdown of individual box elements i have on this page
here is an example of a grid i use w/ MF.
Notice i name all the columns with unique names
(CLICK) now this is breakdown of individual box elements i have on this page
Leave your code open
- in the same way you should leave your elements open, you should leave your styles open
- dont add div to a class. you or someone else may want to expand the element later
Avoid using float
- general practice
- easier to come back and change things without breaking elements
Leave your code open
- in the same way you should leave your elements open, you should leave your styles open
- dont add div to a class. you or someone else may want to expand the element later
Avoid using float
- general practice
- easier to come back and change things without breaking elements
Leave your code open
- in the same way you should leave your elements open, you should leave your styles open
- dont add div to a class. you or someone else may want to expand the element later
Avoid using float
- general practice
- easier to come back and change things without breaking elements
Leave your code open
- in the same way you should leave your elements open, you should leave your styles open
- dont add div to a class. you or someone else may want to expand the element later
Avoid using float
- general practice
- easier to come back and change things without breaking elements
1. Nicole Sullivan actually made a framework from her OOCSS code
A METHOD, or PRACTICE
1. Nicole Sullivan actually made a framework from her OOCSS code
A METHOD, or PRACTICE