Joomla!dagen Nederland 2014
OOCSS - Keep it small
Babs Gösgens
e @babsgosgens
#jd14nl
www.crossinghippos.com
er @crossinghippos
Joomla!dagen Nederland 2014
Modular CSS
–Hugo Giraudel (@HugoGiraudel )
“CSS has become more interesting and more
complicated.”
h p://www.sitepoint.com/architecture-sass-project/
WET
Be er ?
Context
Be er ?
Re-usability
Be er ?
(Cross media) Semantics
Be er ?
Persistent Grid
Be er ?
Facebook
• 6498 colour declarations
• 548 unique colours
• 261 shades of “Facebook” blue
• 3668 padding declarations
• 511 heading selectors
Source: thekmiecs.com
Media Object
• 5 Lines of CSS
• A small HTML snippet
Media Object
Nicole Sullivan
OOCSS in 2009
(@stubbornella)
Source: Joshua Kulpa via Flickr CC
OOCSS
• Separate structure and skin
• Separate container and content







Modular
f
DRY
f
Scalable
f
+ =
Small sites can grow big
Source: Harry Roberts (@csswizardry)
less CSS = faster site
Object
• HTML
• CSS
• JavaScript
• …
OOCSS Systemen
• OOCSS
• SMACCS
• BEM
• Atomic CSS
• …
BEM
Block-Element-Modifier
Block
• Independent Entity
• Blocks can contain other blocks

Bron: h p://bem.info/method/definitions/
Element
• Smallest part of a block
• Context-dependent
Bron: h p://bem.info/method/definitions/
Modifier
• Extra, or different property
• Multiple modifiers
Bron: h p://bem.info/method/definitions/
BEM Classes
.block { }
.block__element { }
.block--modifier { }
Person
Media Object in BEM
Not everything is BEM
–W3C
“Good names don’t change.”
h p://www.w3.org/QA/Tips/goodclassnames
Class names
• a warning, important, submenu
• b border4px, ligh ext, pre ybackground



h p://www.w3.org/QA/Tips/goodclassnames
Classisitis
• Repeating classes are excellent
candidates for compression



Source: h p://www.staceyreid.com
Good habits
• Use shallow selectors
• Separate skin and behavior
• Avoid repetition (DRY)
• Avoid context
• Avoid having to rewrite properties
• Comments, comments and comments
Bad habits
• Overqualified selectors
• Overly specific selectors
• Universal selector
• ID’s for styling
• !important
.menu#mainmenu.block > .block__element*
Specificity
• Universal selectors
• Tag (type) selectors
• Class selectors
• A ribute selectors
• Pseudo-classes & Pseudo-elements
• ID selectors
• Inline styles
*a, div, article.block[type=“checkbox”]:first-child, ::before#mainmenustyle=“color: #f00;”
bad!
Methods
• Structure
• Ordering
• Context
• Comments
• Semantics (for us)
CSS Preprocessors
• Variables
• Functions
• Mixins & placeholders
• Inheritance
• Operators & directives
• Maps
– J.R.R. Tolkien (& Hugo Giraudel)
“One file to rule them all,
One file to find them,
One file to bring them all,
And in the Sass way merge them.”
Partials
• Every component in its own file
• Individual files are pulled in 

to create a single stylesheet
• Much easier to maintain
Source: h p://www.sitepoint.com/architecture-sass-project/
SASS & BEM
SASS & BEM
Abstraction exercise
Object Oriented CSS - Joomla!dagen Nederland 2014
Abstraction exercise
Sources
• h p://bem.info/
• h p://bradfrostweb.com/blog/post/atomic-web-design/
• h p://clubmate.fi/oocss-acss-bem-smacss-what-are-they-
what-should-i-use/
• h p://coding.smashingmagazine.com/2011/12/12/an-
introduction-to-object-oriented-css-oocss/
• h p://csswizardry.com/2011/09/writing-efficient-css-
selectors/
• h p://csswizardry.com/2013/01/mindbemding-ge ing-
your-head-round-bem-syntax/
• h p://hugogiraudel.com/
• h p://nicoespeon.com/en/2013/05/dive-into-oocss/
• h p://nicolasgallagher.com/about-html-semantics-front-
end-architecture/
• h p://rhodesmill.org/brandon/2011/concentric-css/
• h p://sass-lang.com/
• h p://smacss.com/
• h p://snook.ca/
• h p://www.alwaystwisted.com/post.php?s=2014-02-27-
even-easier-bem-ing-with-sass-33
• h p://www.bre jankord.com/2013/02/09/thoughts-on-
semantic-html-class-names-and-maintainability/
• h p://www.mathayward.com/modular-css-with-sass-
and-bem/
• h p://www.sitepoint.com/architecture-sass-project/
• h p://www.sitepoint.com/css-sass-styleguide/
• h p://www.slideshare.net/maxdesign/css-oocss-and-
smacss
• h ps://github.com/necolas/idiomatic-css
• h ps://github.com/stubbornella/oocss/wiki
a
www.facebook.com/crossinghippos

h p://www.slideshare.net/babsgosgens

More Related Content

DOCX
Web designing course content
PPTX
Android app development - Java Programming for Android
KEY
Front end-design and best practices
PPTX
Oooh shiny
KEY
WordPress as a CMS (short version)
PPTX
Hammersmith fundamentals html fundamentals
PPTX
WEBD 162: Intro to CSS
PPTX
Blogging with drupal
Web designing course content
Android app development - Java Programming for Android
Front end-design and best practices
Oooh shiny
WordPress as a CMS (short version)
Hammersmith fundamentals html fundamentals
WEBD 162: Intro to CSS
Blogging with drupal

What's hot (15)

PPT
Drupal - Introduction to Drupal Template Design
PPTX
160712 wiki lecture
PPTX
%&*#! Stupid Puzzles
PPTX
Geocaching Puzzle Resources
PDF
Basic-CSS-tutorial
PDF
Introduction to ruby
PPTX
Tarea de Geometria Juanpi
PPT
Content Strategy for WordPress
PPTX
Geb: Abstracting Page Templates
PDF
Internet Marketing Institute in Delhi
PPTX
css v1 guru
PPT
Content Strategy for WordPress: Case Study
PPTX
Social Sciences Librarians Boot Camp 2012: Zotero and Mendeley
PDF
Introduction to Browser DOM
PPTX
CSS Learnup for Live Chat
Drupal - Introduction to Drupal Template Design
160712 wiki lecture
%&*#! Stupid Puzzles
Geocaching Puzzle Resources
Basic-CSS-tutorial
Introduction to ruby
Tarea de Geometria Juanpi
Content Strategy for WordPress
Geb: Abstracting Page Templates
Internet Marketing Institute in Delhi
css v1 guru
Content Strategy for WordPress: Case Study
Social Sciences Librarians Boot Camp 2012: Zotero and Mendeley
Introduction to Browser DOM
CSS Learnup for Live Chat
Ad

Viewers also liked (15)

PDF
Exploring Flexbox with Chris Sauvé
PDF
a11yTO - Web Accessibility for Developers
PDF
OOCSS in the Real World: A Case Study from the CBC
PPTX
OOCSS presentation
PDF
Building & Scaling a Front End Practice & Team
PDF
OOCSS in the Real World: A Case Study from the CBC - Revisited
PDF
Tech Headline - CSS Naming Conventions: Improve your code with OOCSS, SMACSS,...
KEY
The Cascade, Grids, Headings, and Selectors from an OOCSS Perspective, Ajax ...
PDF
Refreshing Your UI with HTML5, Bootstrap and CSS3
PPTX
Responsive web-design through bootstrap
PDF
CSS - OOCSS, SMACSS and more
PPTX
Bootstrap ppt
KEY
Object Oriented CSS
PPTX
OOCSS and SMACSS Case Study
PDF
Introduction to Bootstrap
Exploring Flexbox with Chris Sauvé
a11yTO - Web Accessibility for Developers
OOCSS in the Real World: A Case Study from the CBC
OOCSS presentation
Building & Scaling a Front End Practice & Team
OOCSS in the Real World: A Case Study from the CBC - Revisited
Tech Headline - CSS Naming Conventions: Improve your code with OOCSS, SMACSS,...
The Cascade, Grids, Headings, and Selectors from an OOCSS Perspective, Ajax ...
Refreshing Your UI with HTML5, Bootstrap and CSS3
Responsive web-design through bootstrap
CSS - OOCSS, SMACSS and more
Bootstrap ppt
Object Oriented CSS
OOCSS and SMACSS Case Study
Introduction to Bootstrap
Ad

Similar to Object Oriented CSS - Joomla!dagen Nederland 2014 (20)

PDF
What is Modular CSS?
PDF
OOCSS, SMACSS or BEM, what is the question...
PDF
OOCSS, SMACSS or BEM?
PDF
Css Systems
PPTX
Rock Solid CSS Architecture
PDF
Atlanta Drupal User's Group - April 2015 - Sasstronauts: Advanced Sass Topics
PDF
Intro to OOCSS Workshop
PPTX
Css methods architecture
PPTX
Php Indonesia x Bliblidotcom - Architecting Scalable CSS
PDF
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...
PDF
ZURB Foundation 5: Clean + Organized
PDF
Modular HTML & CSS
PDF
Object Oriented CSS for rapid, scalable and maintainable development
PPTX
Scalable and Modular CSS FTW!
PPTX
Architecture for css
PDF
Sane CSS - A modern approach to CSS
PDF
Perfect Styling - How to write better CSS
KEY
WordCamp NYC - DRY CSS
PDF
Decoupling the Front-end with Modular CSS
What is Modular CSS?
OOCSS, SMACSS or BEM, what is the question...
OOCSS, SMACSS or BEM?
Css Systems
Rock Solid CSS Architecture
Atlanta Drupal User's Group - April 2015 - Sasstronauts: Advanced Sass Topics
Intro to OOCSS Workshop
Css methods architecture
Php Indonesia x Bliblidotcom - Architecting Scalable CSS
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...
ZURB Foundation 5: Clean + Organized
Modular HTML & CSS
Object Oriented CSS for rapid, scalable and maintainable development
Scalable and Modular CSS FTW!
Architecture for css
Sane CSS - A modern approach to CSS
Perfect Styling - How to write better CSS
WordCamp NYC - DRY CSS
Decoupling the Front-end with Modular CSS

Recently uploaded (20)

PDF
Architecture types and enterprise applications.pdf
PDF
The influence of sentiment analysis in enhancing early warning system model f...
PPT
Galois Field Theory of Risk: A Perspective, Protocol, and Mathematical Backgr...
PPTX
Chapter 5: Probability Theory and Statistics
PPTX
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PDF
OpenACC and Open Hackathons Monthly Highlights July 2025
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PDF
“A New Era of 3D Sensing: Transforming Industries and Creating Opportunities,...
PDF
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
PPTX
Build Your First AI Agent with UiPath.pptx
PPTX
GROUP4NURSINGINFORMATICSREPORT-2 PRESENTATION
PPTX
Benefits of Physical activity for teenagers.pptx
PDF
Getting started with AI Agents and Multi-Agent Systems
PPTX
AI IN MARKETING- PRESENTED BY ANWAR KABIR 1st June 2025.pptx
PPTX
Microsoft Excel 365/2024 Beginner's training
PPTX
The various Industrial Revolutions .pptx
PDF
Taming the Chaos: How to Turn Unstructured Data into Decisions
DOCX
search engine optimization ppt fir known well about this
PDF
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
Architecture types and enterprise applications.pdf
The influence of sentiment analysis in enhancing early warning system model f...
Galois Field Theory of Risk: A Perspective, Protocol, and Mathematical Backgr...
Chapter 5: Probability Theory and Statistics
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
Final SEM Unit 1 for mit wpu at pune .pptx
OpenACC and Open Hackathons Monthly Highlights July 2025
sustainability-14-14877-v2.pddhzftheheeeee
“A New Era of 3D Sensing: Transforming Industries and Creating Opportunities,...
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
Build Your First AI Agent with UiPath.pptx
GROUP4NURSINGINFORMATICSREPORT-2 PRESENTATION
Benefits of Physical activity for teenagers.pptx
Getting started with AI Agents and Multi-Agent Systems
AI IN MARKETING- PRESENTED BY ANWAR KABIR 1st June 2025.pptx
Microsoft Excel 365/2024 Beginner's training
The various Industrial Revolutions .pptx
Taming the Chaos: How to Turn Unstructured Data into Decisions
search engine optimization ppt fir known well about this
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor

Object Oriented CSS - Joomla!dagen Nederland 2014