SlideShare a Scribd company logo
1 of 83
and why you probably need it
                    a derekbender joint




             1
2
2
The problem
w/ css in large scale use




                            3
The problem
                    w/ css in large scale use

• Code is rarely being reused




                                                3
The problem
                      w/ css in large scale use

• Code is rarely being reused
• File size keeps getting bigger




                                                  3
The problem
                      w/ css in large scale use

• Code is rarely being reused
• File size keeps getting bigger
• Code can easily be broken




                                                  3
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
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
A solution: OOCSS




                    4
A solution: OOCSS

• Breaks down pages into “components” or “objects”




                                                     4
A solution: OOCSS

• Breaks down pages into “components” or “objects”
• Can be put together to create unique pages




                                                     4
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
So...what is OOCSS?




                      5
So...what is OOCSS?
OOCSS is a method in which CSS is written to be reusable
and easily maintained




                                                           5
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
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
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
Advantages




             6
Advantages
• Keeps file sizes down




                                  6
Advantages
• Keeps file sizes down
• Reusing code is faster than making new CSS




                                               6
Advantages
• Keeps file sizes down
• Reusing code is faster than making new CSS
• Minimal new CSS created




                                               6
Advantages
• Keeps file sizes down
• Reusing code is faster than making new CSS
• Minimal new CSS created
• Easy to adapt to teams




                                               6
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
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
Who should use it




                    7
Who should use it
• Any large scale web applications




                                     7
Who should use it
• Any large scale web applications

• Large websites (50+ pages w/ different layouts)




                                                    7
Who should use it
• Any large scale web applications

• Large websites (50+ pages w/ different layouts)

• Projects w/ large teams




                                                    7
8
Examples in code


                   8
Base & modifier classes




                         9
Base & modifier classes




                         9
Base & modifier classes


• box




                                 9
Base & modifier classes


• box
• box warning




                                    9
Base & modifier classes


• box
• box warning
• box help




                                      9
Base & modifier classes


• box
• box warning
• box help
• box help alt



                                      9
Base & modifier classes


• box
• box warning
• box help
• box help alt
• box help alt list


                                      9
Base & modifier classes




                         10
Base & modifier classes
• <a>




                                 10
Base & modifier classes
• <a>
• <a> w/ .btn




                                    10
Base & modifier classes
• <a>
• <a> w/ .btn
• <a> w/ .btn & .small




                                     10
Base & modifier classes
• <a>
• <a> w/ .btn
• <a> w/ .btn & .small
• <a> w/ .btn & .small & .blue




                                     10
OOCSS in practice




                    11
OOCSS in practice




                    11
OOCSS in practice




                    11
OOCSS in practice




                    11
OOCSS in practice




                    12
OOCSS in practice




                    12
OOCSS in practice




                    12
OOCSS in practice




                    12
OOCSS in practice
     Great until...




                      12
OOCSS in practice




                    13
OOCSS in practice
    ...I designed this




                         13
OOCSS in practice




                    14
OOCSS in practice




                    14
OOCSS in practice
Keep objects as open as possible




                                   14
CSS modifiers in action




                         15
CSS modifiers in action




                         15
CSS modifiers in action




                         15
CSS modifiers in action




                         15
The grid




           16
The grid




           16
The grid
left_col           wide_col




           middle_col         right_col




                                          16
The grid
left_col             wide_col
                       brief




           middle_col
              box               right_col
                                    box




               box                 box




                                   box




                                            16
Objects & the grid




                     17
Objects & the grid




                     17
Objects & the grid



middle_col




                          17
Objects & the grid



middle_col


                          right_col



                                      17
Where to start




                 18
Where to start
• Start building separate, reusable components (objects)
 • Could be headings, boxes, buttons, etc.




                                                           18
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
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
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
Tip & tricks




               19
Tip & tricks
• Be generic w/ your classes
 • class=”warning-message-box-page” - bad
 • class=”warning message pagelvl” - good




                                            19
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
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
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
OOCSS resources
• OOCSS Framework - Nicole Sullivan
 •http://wiki.github.com/stubbornella/oocss




                                              20
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/




                                                                             20
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
Thank you
I’m derekbender
 twitter: @derekbender
 url: derekbender.com
 slideshare: slideshare.net/derekbender


 memberfuse.com
 nfistudios.com


                                          21

More Related Content

Similar to Object Oriented CSS

Sass: The Future of Stylesheets
Sass: The Future of StylesheetsSass: The Future of Stylesheets
Sass: The Future of Stylesheets
chriseppstein
 
Austin NoSQL 2011-07-06
Austin NoSQL 2011-07-06Austin NoSQL 2011-07-06
Austin NoSQL 2011-07-06
jimbojsb
 

Similar to Object Oriented CSS (20)

BDUG Responsive Web Theming - 7/23/12
BDUG Responsive Web Theming - 7/23/12BDUG Responsive Web Theming - 7/23/12
BDUG Responsive Web Theming - 7/23/12
 
Css masterclass book
Css masterclass bookCss masterclass book
Css masterclass book
 
Scalable CSS | An Origin Story. (Part 1 of 3)
Scalable CSS | An Origin Story. (Part 1 of 3)Scalable CSS | An Origin Story. (Part 1 of 3)
Scalable CSS | An Origin Story. (Part 1 of 3)
 
Php Indonesia x Bliblidotcom - Architecting Scalable CSS
Php Indonesia x Bliblidotcom - Architecting Scalable CSSPhp Indonesia x Bliblidotcom - Architecting Scalable CSS
Php Indonesia x Bliblidotcom - Architecting Scalable CSS
 
6 Steps to Make Your CSS Code More Maintainable
6 Steps to Make Your CSS Code More Maintainable6 Steps to Make Your CSS Code More Maintainable
6 Steps to Make Your CSS Code More Maintainable
 
Multi-content Containers in dotCMS 3.0
Multi-content Containers in dotCMS 3.0Multi-content Containers in dotCMS 3.0
Multi-content Containers in dotCMS 3.0
 
CSS: a rapidly changing world
CSS: a rapidly changing worldCSS: a rapidly changing world
CSS: a rapidly changing world
 
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...
 
Rails traps
Rails trapsRails traps
Rails traps
 
Responsive Web Design - Drupal Camp CPH
Responsive Web Design - Drupal Camp CPHResponsive Web Design - Drupal Camp CPH
Responsive Web Design - Drupal Camp CPH
 
Tpr1
Tpr1Tpr1
Tpr1
 
What is-sass-by-lucas-castro
What is-sass-by-lucas-castroWhat is-sass-by-lucas-castro
What is-sass-by-lucas-castro
 
Sass: The Future of Stylesheets
Sass: The Future of StylesheetsSass: The Future of Stylesheets
Sass: The Future of Stylesheets
 
WordCamp NYC - DRY CSS
WordCamp NYC - DRY CSSWordCamp NYC - DRY CSS
WordCamp NYC - DRY CSS
 
OOCSS
OOCSSOOCSS
OOCSS
 
Reworking our-workflows
Reworking our-workflowsReworking our-workflows
Reworking our-workflows
 
How to build the perfect pattern library
How to build the perfect pattern libraryHow to build the perfect pattern library
How to build the perfect pattern library
 
Austin NoSQL 2011-07-06
Austin NoSQL 2011-07-06Austin NoSQL 2011-07-06
Austin NoSQL 2011-07-06
 
An Introduction to CSS Frameworks
An Introduction to CSS FrameworksAn Introduction to CSS Frameworks
An Introduction to CSS Frameworks
 
Domain Driven Design Demonstrated
Domain Driven Design Demonstrated Domain Driven Design Demonstrated
Domain Driven Design Demonstrated
 

Recently uploaded

Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)
amitlee9823
 
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
amitlee9823
 
➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men 🔝jhansi🔝 Escorts S...
➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men  🔝jhansi🔝   Escorts S...➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men  🔝jhansi🔝   Escorts S...
➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men 🔝jhansi🔝 Escorts S...
amitlee9823
 
Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
amitlee9823
 
Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
amitlee9823
 
Peaches App development presentation deck
Peaches App development presentation deckPeaches App development presentation deck
Peaches App development presentation deck
tbatkhuu1
 
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
home
 
一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证
一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证
一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证
wpkuukw
 

Recently uploaded (20)

AMBER GRAIN EMBROIDERY | Growing folklore elements | Root-based materials, w...
AMBER GRAIN EMBROIDERY | Growing folklore elements |  Root-based materials, w...AMBER GRAIN EMBROIDERY | Growing folklore elements |  Root-based materials, w...
AMBER GRAIN EMBROIDERY | Growing folklore elements | Root-based materials, w...
 
Top Rated Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...
Top Rated  Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...Top Rated  Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...
Top Rated Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...
 
❤Personal Whatsapp Number 8617697112 Samba Call Girls 💦✅.
❤Personal Whatsapp Number 8617697112 Samba Call Girls 💦✅.❤Personal Whatsapp Number 8617697112 Samba Call Girls 💦✅.
❤Personal Whatsapp Number 8617697112 Samba Call Girls 💦✅.
 
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)
 
call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
 
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
 
➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men 🔝jhansi🔝 Escorts S...
➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men  🔝jhansi🔝   Escorts S...➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men  🔝jhansi🔝   Escorts S...
➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men 🔝jhansi🔝 Escorts S...
 
Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
 
Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
 
Hire 💕 8617697112 Meerut Call Girls Service Call Girls Agency
Hire 💕 8617697112 Meerut Call Girls Service Call Girls AgencyHire 💕 8617697112 Meerut Call Girls Service Call Girls Agency
Hire 💕 8617697112 Meerut Call Girls Service Call Girls Agency
 
Peaches App development presentation deck
Peaches App development presentation deckPeaches App development presentation deck
Peaches App development presentation deck
 
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
 
Real service provider college girl Mira Road 8976425520
Real service provider college girl Mira Road 8976425520Real service provider college girl Mira Road 8976425520
Real service provider college girl Mira Road 8976425520
 
VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...
VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...
VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...
 
一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证
一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证
一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证
 
HiFi Call Girl Service Delhi Phone ☞ 9899900591 ☜ Escorts Service at along wi...
HiFi Call Girl Service Delhi Phone ☞ 9899900591 ☜ Escorts Service at along wi...HiFi Call Girl Service Delhi Phone ☞ 9899900591 ☜ Escorts Service at along wi...
HiFi Call Girl Service Delhi Phone ☞ 9899900591 ☜ Escorts Service at along wi...
 
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
 
WhatsApp Chat: 📞 8617697112 Call Girl Baran is experienced
WhatsApp Chat: 📞 8617697112 Call Girl Baran is experiencedWhatsApp Chat: 📞 8617697112 Call Girl Baran is experienced
WhatsApp Chat: 📞 8617697112 Call Girl Baran is experienced
 
Sector 105, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 105, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 105, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 105, Noida Call girls :8448380779 Model Escorts | 100% verified
 
💫✅jodhpur 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATISFACT...
💫✅jodhpur 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATISFACT...💫✅jodhpur 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATISFACT...
💫✅jodhpur 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATISFACT...
 

Object Oriented CSS

  • 1. and why you probably need it a derekbender joint 1
  • 2. 2
  • 3. 2
  • 4. The problem w/ css in large scale use 3
  • 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
  • 11. A solution: OOCSS • Breaks down pages into “components” or “objects” 4
  • 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
  • 21. Advantages • Keeps file sizes down • Reusing code is faster than making new CSS 6
  • 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
  • 27. Who should use it • Any large scale web applications 7
  • 28. Who should use it • Any large scale web applications • Large websites (50+ pages w/ different layouts) 7
  • 29. Who should use it • Any large scale web applications • Large websites (50+ pages w/ different layouts) • Projects w/ large teams 7
  • 30. 8
  • 32. Base & modifier classes 9
  • 33. Base & modifier classes 9
  • 34. Base & modifier classes • box 9
  • 35. Base & modifier classes • box • box warning 9
  • 36. Base & modifier classes • box • box warning • box help 9
  • 37. Base & modifier classes • box • box warning • box help • box help alt 9
  • 38. Base & modifier classes • box • box warning • box help • box help alt • box help alt list 9
  • 39. Base & modifier classes 10
  • 40. Base & modifier classes • <a> 10
  • 41. Base & modifier classes • <a> • <a> w/ .btn 10
  • 42. Base & modifier classes • <a> • <a> w/ .btn • <a> w/ .btn & .small 10
  • 43. Base & modifier classes • <a> • <a> w/ .btn • <a> w/ .btn & .small • <a> w/ .btn & .small & .blue 10
  • 52. OOCSS in practice Great until... 12
  • 54. OOCSS in practice ...I designed this 13
  • 57. OOCSS in practice Keep objects as open as possible 14
  • 58. CSS modifiers in action 15
  • 59. CSS modifiers in action 15
  • 60. CSS modifiers in action 15
  • 61. CSS modifiers in action 15
  • 62. The grid 16
  • 63. The grid 16
  • 64. The grid left_col wide_col middle_col right_col 16
  • 65. The grid left_col wide_col brief middle_col box right_col box box box box 16
  • 66. Objects & the grid 17
  • 67. Objects & the grid 17
  • 68. Objects & the grid middle_col 17
  • 69. Objects & the grid middle_col right_col 17
  • 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
  • 80. OOCSS resources • OOCSS Framework - Nicole Sullivan •http://wiki.github.com/stubbornella/oocss 20
  • 81. 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/ 20
  • 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
  • 83. Thank you I’m derekbender twitter: @derekbender url: derekbender.com slideshare: slideshare.net/derekbender memberfuse.com nfistudios.com 21

Editor's Notes

  1. OOCSS can be used across a company for multiple projects
  2. OOCSS can be used across a company for multiple projects
  3. OOCSS can be used across a company for multiple projects
  4. An overall concept of oocss is to be able to reuse css easily The base / modifier class can help
  5. An overall concept of oocss is to be able to reuse css easily The base / modifier class can help
  6. An overall concept of oocss is to be able to reuse css easily The base / modifier class can help
  7. An overall concept of oocss is to be able to reuse css easily The base / modifier class can help
  8. An overall concept of oocss is to be able to reuse css easily The base / modifier class can help
  9. An overall concept of oocss is to be able to reuse css easily The base / modifier class can help
  10. 1 here is the basic box element 2 once we start adding modifying classes, it changes
  11. 1 here is the basic box element 2 once we start adding modifying classes, it changes
  12. 1 here is the basic box element 2 once we start adding modifying classes, it changes
  13. write your css to easily extend
  14. write your css to easily extend
  15. write your css to easily extend
  16. 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
  17. 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
  18. 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
  19. 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
  20. 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
  21. 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
  22. 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
  23. 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
  24. 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
  25. 1. Nicole Sullivan actually made a framework from her OOCSS code A METHOD, or PRACTICE
  26. 1. Nicole Sullivan actually made a framework from her OOCSS code A METHOD, or PRACTICE