25
OOCSS Object Orientated CSS

OOCSS presentation

Embed Size (px)

DESCRIPTION

Presentation I did at the Tauranga Web Meetup. All credit to Nicole Sullivan for this, I just tried to relay the message.http://oocss.org/http://www.stubbornella.org/

Citation preview

Page 1: OOCSS presentation

OOCSSObject Orientated CSS

Page 2: OOCSS presentation

The problem?

Page 3: OOCSS presentation

BLOAT!

Page 4: OOCSS presentation

Had 700 CSS files

Had 1.9mb of CSS

Page 5: OOCSS presentation

Have to be an expert in the siteto modify or add

Page 6: OOCSS presentation

Each new addition to the site, the CSS grows

Page 7: OOCSS presentation

CSS re-use is almost non-existent

Page 8: OOCSS presentation

Code is fragile, have to be more specific to not break other peoples styling.

CSS specificity bombs!

Page 9: OOCSS presentation

We make a 1:1 relationship of the CSS & the modules we create

Page 10: OOCSS presentation

How to get round it?

OOCSS

Page 11: OOCSS presentation

Create your CSS like Lego blocks

Page 12: OOCSS presentation

Lego blocks can be used to make up many different unique structures from the same

elements

Page 13: OOCSS presentation

Create a Component libraryhttp://oocss.org/ex/library.html

Page 14: OOCSS presentation

Separate container and content

Break the dependency between the container module and the content

Page 15: OOCSS presentation

Build the HTML from the component library

Page 16: OOCSS presentation

Separate structure and skin

Abstract the structure of the block from the skin which is being applied

Page 17: OOCSS presentation

Lego blocks first

Design your individual pages only once you have all the lego blocks in

front of you

Page 18: OOCSS presentation

Rule of thumb

If two modules look too similar to include on the same page, they are two similar to have

on the site.Choose ONE!

Page 19: OOCSS presentation

Mix and match

Container and content objects to achieve high performance design.

Page 20: OOCSS presentation

Never specify element

DO: .classDon’t: div.class

Page 21: OOCSS presentation

Be Flexible

Extensible height and width. Let the grid control the width and the

content control the height.

Page 22: OOCSS presentation

Learn to love grids

Page 23: OOCSS presentation

Mark up and CSS become predictable & consistent

Page 24: OOCSS presentation

Photo creditshttp://www.flickr.com/photos/garlandcannon/4558340132/sizes/l/in/photostream/

http://www.flickr.com/photos/shawno/3869415226/sizes/l/in/photostream/

http://www.flickr.com/photos/wakingphotolife/5341066143/sizes/l/in/photostream/

http://www.flickr.com/photos/evaekeblad/454220744/sizes/o/in/photostream/

http://www.flickr.com/photos/builtbydave/4584358158/sizes/l/in/photostream/

http://www.flickr.com/photos/seyerce/342265015/sizes/l/in/photostream/

http://www.flickr.com/photos/aplumb/3890010967/sizes/l/in/photostream/

http://www.flickr.com/photos/teknokool/117340388/sizes/o/in/photostream/

http://www.flickr.com/photos/21561428@N03/4991300232/sizes/l/in/photostream/

Page 25: OOCSS presentation

More info

• OOCSS framework - https://github.com/stubbornella/oocss/

• Nicole Sullivan’s blog - http://www.stubbornella.org/• Slideshare - http://www.slideshare.net/stubbornella• OOCSS.org - http://oocss.org/• Me:– Twitter: @drewjford– Email: [email protected]