SlideShare a Scribd company logo
1 of 60
Object Oriented CSS

                      Graeme Blackwood
                      Creative Director
                      Deeson Online
                      twitter.com/graemeblackwood
Спонсоры
     Организатор      Генеральный спонсор




 Серебряный спонсор   Серебряный спонсор




 Бронзовый спонсор     Бронзовый спонсор




                                    2
Graeme Blackwood
Creative Director, Deeson Online


deeson-online.co.uk
@graemeblackwood
Object
Oriented
CSS
Props
• Nicole Sullivan, http://www.stubbornella.org
• Jonathan Snook (SMACSS), http://smacss.com
• Everyone at http://thesassway.com
• Chris Eppstein, http://compass-style.org
• Kevin Poulton http://www.flickr.com/photos/kevinpoulton
• And loads more!
Some misconceptions
OO CSS !=
OO Programming

But an OOP mindset can be 
applied to CSS
OOCSS does not
require any newer
technologies

It works in IE6 – no need for CSS3, 
HTML5 etc
Semantic markup is
very helpful, but
usually not essential

Semantic is better though!
The traditional
approach to CSS
Style output
as needed
Each item / page 
individually...
Target styles by
drilling down
through nested
elements
Problems with
traditional CSS
Coding takes
a lot longer
It gets
bloated
It is difficult to read
and hard to reuse
Traditional CSS is
tough to maintain
Object Oriented CSS
A new way of thinking
Separate layout from theme(Use 
a grid system!)
Separate the container
from the content
Look for shared styles
You will see them everywhere
Why should
I care?
Reusable code
Faster
development
                        QuickTime™ and a
                      H.264 decompressor
                 are needed to see this picture.




Less effort to code
Easier to maintain
Less code,
smaller files
Getting started
Using a grid system?
You are already on the right track!
Use a reset
stylesheet
HTML5 boilerplate’s 
normalize.css
Set good base styles
To minimise later overrides

* {box­sizing: border­box} is pretty handy
Build HTMLbase stylesTo 
Set good prototypeswith 
Drupal in mind...
minimise later overrides
Clean up what Drupal
throws at you
Don’t just style,
theme!
Lose unnecessary
markup if it affects you
            Some divs are 
            totally pointless!
PHP code not for you?
I find Drupal modules like
Display Suite and Skinr helpful
Check out TWIG
We’re working on making Drupal 8 a lot 
easier to theme.

http://twig.sensiolabs.org/
Don’t be too obsessed
with perfect markup
Just enough is ok
“Now, this is just a simulation of what the blocks 
    will look like once they’re assembled”
Let’s look at some real
world applications...
.block = inherited base styles only.grid-4 = grid class.theme-a = theme
class, H3 and p inherit colour.padded is a class I add to the grid
framework for situations like this
<div class=”grid-4 theme-a block”>
  <h3>Block title</h3>
  <p>Hello world!</p>
</div>




.grid-4 comes from your grid framework

.theme-a {
  background-color: #580174;
  border-radius: 6px;
  color: #fff; //H3 and p inherit this
}
Carousel nav tabsObject is a Drupal menu 
– UL with a class of .sidebar­menu. Custom jQuery targets the ID.
Also used on a listingAnd it
to the container
99% of the styles are reused,
targeted through .right
.sidebar-menu only to flip the
active item
Carousel items
With a class of .product­box
Reused on listing
pages
Same layout as product
listings and carousel, flexed
to image size
What about
SASS and LESS?
Why bother with presentational classes 
in markup anymore?
Not everyone wants to use a CSS preprocessorAnd the mindset of reduce, reuse & recycle is just as important even with one
Use SASS wisely – it’s
another layer to debug
Be particularly careful
with nested selectors
http://thesassway.com/beginner/the­inception­rule

http://37signals.com/svn/posts/3003­css­taking­control­of­the­cascade
Disregarding the other
principles of OOCSS may
create pain later
You could end up with generated CSS bloated 
even more than if you had hand­coded it
Summary
• OOCSS is as much a mindset as a technique
• The principles are to reduce, reuse and recycle code
• This is done through separating layout from theme
• and the container from the content
• It relies primarily on reused classes and markup
• We are working on Drupal 8 to make it much easier to
  change markup. In the meantime, try Display Suite or Skinr
  for node theming
Summary

• CSS preprocessors like SASS and LESS are great
• But they create another layer to debug
• And the code they generate can be very bloated
• Preprocessors are not an excuse to be lazy
• They still need to be used with an OO mindset
Спасибо за внимание

Вопросы?
            Graeme Blackwood
            Creative Director
            Deeson Online
            @graemeblackwood
Спонсоры
     Организатор      Генеральный спонсор




 Серебряный спонсор   Серебряный спонсор




 Бронзовый спонсор     Бронзовый спонсор




                                    60

More Related Content

What's hot

What's Object-Oriented CSS (japanese)
What's Object-Oriented CSS (japanese)What's Object-Oriented CSS (japanese)
What's Object-Oriented CSS (japanese)shinobu tsutsui
 
Dallas Drupal Days 2012 - Introduction to less sass-compass
Dallas Drupal Days 2012  - Introduction to less sass-compassDallas Drupal Days 2012  - Introduction to less sass-compass
Dallas Drupal Days 2012 - Introduction to less sass-compassChris Lee
 
css_trends
css_trendscss_trends
css_trendshazzaz
 
Spectrum 2015 going online with style - an intro to css
Spectrum 2015   going online with style - an intro to cssSpectrum 2015   going online with style - an intro to css
Spectrum 2015 going online with style - an intro to cssNeil Perlin
 
Structuring your CSS for maintainability: rules and guile lines to write CSS
Structuring your CSS for maintainability: rules and guile lines to write CSSStructuring your CSS for maintainability: rules and guile lines to write CSS
Structuring your CSS for maintainability: rules and guile lines to write CSSSanjoy Kr. Paul
 
Sass - Getting Started with Sass!
Sass - Getting Started with Sass!Sass - Getting Started with Sass!
Sass - Getting Started with Sass!Eric Sembrat
 
Layout absolute poz
Layout absolute pozLayout absolute poz
Layout absolute pozAnn Foley
 
Design for Developers: Introduction to Bootstrap 3
Design for Developers: Introduction to Bootstrap 3Design for Developers: Introduction to Bootstrap 3
Design for Developers: Introduction to Bootstrap 3John Bertucci
 

What's hot (20)

Layout & css lecture
Layout & css lectureLayout & css lecture
Layout & css lecture
 
SASS - CSS with Superpower
SASS - CSS with SuperpowerSASS - CSS with Superpower
SASS - CSS with Superpower
 
Web
WebWeb
Web
 
What's Object-Oriented CSS (japanese)
What's Object-Oriented CSS (japanese)What's Object-Oriented CSS (japanese)
What's Object-Oriented CSS (japanese)
 
CSS Modules
CSS ModulesCSS Modules
CSS Modules
 
Drupal - Introduction to Drupal Template Design
Drupal - Introduction to Drupal Template DesignDrupal - Introduction to Drupal Template Design
Drupal - Introduction to Drupal Template Design
 
Dallas Drupal Days 2012 - Introduction to less sass-compass
Dallas Drupal Days 2012  - Introduction to less sass-compassDallas Drupal Days 2012  - Introduction to less sass-compass
Dallas Drupal Days 2012 - Introduction to less sass-compass
 
Psd 2 Drupal
Psd 2 DrupalPsd 2 Drupal
Psd 2 Drupal
 
Untitleddocument (1)
Untitleddocument (1)Untitleddocument (1)
Untitleddocument (1)
 
Css In Iterations
Css In IterationsCss In Iterations
Css In Iterations
 
css_trends
css_trendscss_trends
css_trends
 
Css home
Css   homeCss   home
Css home
 
Spectrum 2015 going online with style - an intro to css
Spectrum 2015   going online with style - an intro to cssSpectrum 2015   going online with style - an intro to css
Spectrum 2015 going online with style - an intro to css
 
Structuring your CSS for maintainability: rules and guile lines to write CSS
Structuring your CSS for maintainability: rules and guile lines to write CSSStructuring your CSS for maintainability: rules and guile lines to write CSS
Structuring your CSS for maintainability: rules and guile lines to write CSS
 
Sass - Getting Started with Sass!
Sass - Getting Started with Sass!Sass - Getting Started with Sass!
Sass - Getting Started with Sass!
 
Make your CSS beautiful again
Make your CSS beautiful againMake your CSS beautiful again
Make your CSS beautiful again
 
Layout absolute poz
Layout absolute pozLayout absolute poz
Layout absolute poz
 
Design for Developers: Introduction to Bootstrap 3
Design for Developers: Introduction to Bootstrap 3Design for Developers: Introduction to Bootstrap 3
Design for Developers: Introduction to Bootstrap 3
 
The Dark Arts of CSS
The Dark Arts of CSSThe Dark Arts of CSS
The Dark Arts of CSS
 
Css
CssCss
Css
 

Viewers also liked

построение внутренней ссылочной структуры сайта на Drupal 7 (seo) костин алексей
построение внутренней ссылочной структуры сайта на Drupal 7 (seo) костин алексейпостроение внутренней ссылочной структуры сайта на Drupal 7 (seo) костин алексей
построение внутренней ссылочной структуры сайта на Drupal 7 (seo) костин алексейdrupalconf
 
Task1 nme analysis
Task1 nme analysisTask1 nme analysis
Task1 nme analysisdenhamj1
 
Sheriff's Office Mobile App
Sheriff's Office Mobile AppSheriff's Office Mobile App
Sheriff's Office Mobile AppJim Cox
 
Kostin drupalconf-2011-presentation
Kostin drupalconf-2011-presentationKostin drupalconf-2011-presentation
Kostin drupalconf-2011-presentationdrupalconf
 
Kostin drupal conf-2011-winter
Kostin drupal conf-2011-winterKostin drupal conf-2011-winter
Kostin drupal conf-2011-winterdrupalconf
 
Caching on highload drupal site roman arkharov (eng)
Caching on highload drupal site  roman arkharov (eng)Caching on highload drupal site  roman arkharov (eng)
Caching on highload drupal site roman arkharov (eng)drupalconf
 
Drush and drupal. администрирование волчек михаил
Drush and drupal. администрирование  волчек михаилDrush and drupal. администрирование  волчек михаил
Drush and drupal. администрирование волчек михаилdrupalconf
 
фотосток на Drupal+maestro житарёв антон
фотосток на Drupal+maestro житарёв антонфотосток на Drupal+maestro житарёв антон
фотосток на Drupal+maestro житарёв антонdrupalconf
 
опыт Clickberry.com стартап на drupal в облаке павел загор
опыт Clickberry.com   стартап на drupal в облаке павел загоропыт Clickberry.com   стартап на drupal в облаке павел загор
опыт Clickberry.com стартап на drupal в облаке павел загорdrupalconf
 
Marshalkina drupalconf multilingual
Marshalkina drupalconf multilingualMarshalkina drupalconf multilingual
Marshalkina drupalconf multilingualdrupalconf
 
Drupal and mobile devices komelin konstanin (eng)
Drupal and mobile devices komelin konstanin (eng)Drupal and mobile devices komelin konstanin (eng)
Drupal and mobile devices komelin konstanin (eng)drupalconf
 
опыт использования схемы Drupal+varnish+nginx руслан исай
опыт использования схемы Drupal+varnish+nginx руслан исайопыт использования схемы Drupal+varnish+nginx руслан исай
опыт использования схемы Drupal+varnish+nginx руслан исайdrupalconf
 
Multilingual solutions florian loretan
Multilingual solutions florian loretanMultilingual solutions florian loretan
Multilingual solutions florian loretandrupalconf
 
Рекламная студия "Медиа Партнер"
Рекламная студия "Медиа Партнер"Рекламная студия "Медиа Партнер"
Рекламная студия "Медиа Партнер"alladvertising
 

Viewers also liked (20)

Spring Media
Spring MediaSpring Media
Spring Media
 
построение внутренней ссылочной структуры сайта на Drupal 7 (seo) костин алексей
построение внутренней ссылочной структуры сайта на Drupal 7 (seo) костин алексейпостроение внутренней ссылочной структуры сайта на Drupal 7 (seo) костин алексей
построение внутренней ссылочной структуры сайта на Drupal 7 (seo) костин алексей
 
Task1 nme analysis
Task1 nme analysisTask1 nme analysis
Task1 nme analysis
 
Sheriff's Office Mobile App
Sheriff's Office Mobile AppSheriff's Office Mobile App
Sheriff's Office Mobile App
 
Kostin drupalconf-2011-presentation
Kostin drupalconf-2011-presentationKostin drupalconf-2011-presentation
Kostin drupalconf-2011-presentation
 
Kostin drupal conf-2011-winter
Kostin drupal conf-2011-winterKostin drupal conf-2011-winter
Kostin drupal conf-2011-winter
 
Drupal distro
Drupal distroDrupal distro
Drupal distro
 
Caching on highload drupal site roman arkharov (eng)
Caching on highload drupal site  roman arkharov (eng)Caching on highload drupal site  roman arkharov (eng)
Caching on highload drupal site roman arkharov (eng)
 
Drush and drupal. администрирование волчек михаил
Drush and drupal. администрирование  волчек михаилDrush and drupal. администрирование  волчек михаил
Drush and drupal. администрирование волчек михаил
 
фотосток на Drupal+maestro житарёв антон
фотосток на Drupal+maestro житарёв антонфотосток на Drupal+maestro житарёв антон
фотосток на Drupal+maestro житарёв антон
 
AR Conference
AR ConferenceAR Conference
AR Conference
 
опыт Clickberry.com стартап на drupal в облаке павел загор
опыт Clickberry.com   стартап на drupal в облаке павел загоропыт Clickberry.com   стартап на drupal в облаке павел загор
опыт Clickberry.com стартап на drupal в облаке павел загор
 
Novikov TV
Novikov TVNovikov TV
Novikov TV
 
Prez drupal
Prez drupalPrez drupal
Prez drupal
 
Marshalkina drupalconf multilingual
Marshalkina drupalconf multilingualMarshalkina drupalconf multilingual
Marshalkina drupalconf multilingual
 
Drupal and mobile devices komelin konstanin (eng)
Drupal and mobile devices komelin konstanin (eng)Drupal and mobile devices komelin konstanin (eng)
Drupal and mobile devices komelin konstanin (eng)
 
опыт использования схемы Drupal+varnish+nginx руслан исай
опыт использования схемы Drupal+varnish+nginx руслан исайопыт использования схемы Drupal+varnish+nginx руслан исай
опыт использования схемы Drupal+varnish+nginx руслан исай
 
Multilingual solutions florian loretan
Multilingual solutions florian loretanMultilingual solutions florian loretan
Multilingual solutions florian loretan
 
Ipc
IpcIpc
Ipc
 
Рекламная студия "Медиа Партнер"
Рекламная студия "Медиа Партнер"Рекламная студия "Медиа Партнер"
Рекламная студия "Медиа Партнер"
 

Similar to Object oriented css graeme blackwood

Object oriented css. Graeme Blackwood
Object oriented css. Graeme BlackwoodObject oriented css. Graeme Blackwood
Object oriented css. Graeme BlackwoodPVasili
 
Css week10 2019 2020 for g10 by eng.osama ghandour
Css week10 2019 2020 for g10 by eng.osama ghandourCss week10 2019 2020 for g10 by eng.osama ghandour
Css week10 2019 2020 for g10 by eng.osama ghandourOsama Ghandour Geris
 
Advanced CSS Troubleshooting
Advanced CSS TroubleshootingAdvanced CSS Troubleshooting
Advanced CSS TroubleshootingDenise Jacobs
 
Minimalist Theming: How to Build a Lean, Mean Drupal 8 Theme
Minimalist Theming: How to Build a Lean, Mean Drupal 8 ThemeMinimalist Theming: How to Build a Lean, Mean Drupal 8 Theme
Minimalist Theming: How to Build a Lean, Mean Drupal 8 ThemeSuzanne Dergacheva
 
Let's dig into the Omega Theme!
Let's dig into the Omega Theme!Let's dig into the Omega Theme!
Let's dig into the Omega Theme!Mediacurrent
 
Drupaldelphia Shortcuts Cheats And Cheap Stunts
Drupaldelphia  Shortcuts Cheats And Cheap StuntsDrupaldelphia  Shortcuts Cheats And Cheap Stunts
Drupaldelphia Shortcuts Cheats And Cheap Stuntscanarymason
 
Architecting with Style
Architecting with StyleArchitecting with Style
Architecting with StyleTimothy Knight
 
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 ThemeCreating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 ThemeAcquia
 
The Future State of Layout
The Future State of LayoutThe Future State of Layout
The Future State of LayoutStephen Hay
 
CSS Framework + Progressive Enhacements
CSS Framework + Progressive EnhacementsCSS Framework + Progressive Enhacements
CSS Framework + Progressive EnhacementsMario Hernandez
 
Front end-design and best practices
Front end-design and best practicesFront end-design and best practices
Front end-design and best practicesMario Hernandez
 
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 Maintainable10Clouds
 
Css masterclass book
Css masterclass bookCss masterclass book
Css masterclass bookPhoenix
 
Oooh shiny
Oooh shinyOooh shiny
Oooh shinywcto2017
 
The Coding Designer's Survival Kit - Capital Camp
The Coding Designer's Survival Kit - Capital CampThe Coding Designer's Survival Kit - Capital Camp
The Coding Designer's Survival Kit - Capital Campcanarymason
 
WordCamp NYC - DRY CSS
WordCamp NYC - DRY CSSWordCamp NYC - DRY CSS
WordCamp NYC - DRY CSSJer Clarke
 

Similar to Object oriented css graeme blackwood (20)

Object oriented css. Graeme Blackwood
Object oriented css. Graeme BlackwoodObject oriented css. Graeme Blackwood
Object oriented css. Graeme Blackwood
 
Css week10 2019 2020 for g10 by eng.osama ghandour
Css week10 2019 2020 for g10 by eng.osama ghandourCss week10 2019 2020 for g10 by eng.osama ghandour
Css week10 2019 2020 for g10 by eng.osama ghandour
 
Advanced CSS Troubleshooting
Advanced CSS TroubleshootingAdvanced CSS Troubleshooting
Advanced CSS Troubleshooting
 
Minimalist Theming: How to Build a Lean, Mean Drupal 8 Theme
Minimalist Theming: How to Build a Lean, Mean Drupal 8 ThemeMinimalist Theming: How to Build a Lean, Mean Drupal 8 Theme
Minimalist Theming: How to Build a Lean, Mean Drupal 8 Theme
 
Let's dig into the Omega Theme!
Let's dig into the Omega Theme!Let's dig into the Omega Theme!
Let's dig into the Omega Theme!
 
Drupaldelphia Shortcuts Cheats And Cheap Stunts
Drupaldelphia  Shortcuts Cheats And Cheap StuntsDrupaldelphia  Shortcuts Cheats And Cheap Stunts
Drupaldelphia Shortcuts Cheats And Cheap Stunts
 
Efficient theming in Drupal
Efficient theming in DrupalEfficient theming in Drupal
Efficient theming in Drupal
 
Architecting with Style
Architecting with StyleArchitecting with Style
Architecting with Style
 
LESS is More
LESS is MoreLESS is More
LESS is More
 
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 ThemeCreating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
 
The Future State of Layout
The Future State of LayoutThe Future State of Layout
The Future State of Layout
 
CSS Framework + Progressive Enhacements
CSS Framework + Progressive EnhacementsCSS Framework + Progressive Enhacements
CSS Framework + Progressive Enhacements
 
Front end-design and best practices
Front end-design and best practicesFront end-design and best practices
Front end-design and best practices
 
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
 
Css masterclass book
Css masterclass bookCss masterclass book
Css masterclass book
 
PSD to Theme: The SMACSS Way
PSD to Theme: The SMACSS WayPSD to Theme: The SMACSS Way
PSD to Theme: The SMACSS Way
 
Css
CssCss
Css
 
Oooh shiny
Oooh shinyOooh shiny
Oooh shiny
 
The Coding Designer's Survival Kit - Capital Camp
The Coding Designer's Survival Kit - Capital CampThe Coding Designer's Survival Kit - Capital Camp
The Coding Designer's Survival Kit - Capital Camp
 
WordCamp NYC - DRY CSS
WordCamp NYC - DRY CSSWordCamp NYC - DRY CSS
WordCamp NYC - DRY CSS
 

More from drupalconf

инструкция по оптимизации сайтов на Drupal херени даниэл
инструкция по оптимизации сайтов на Drupal херени даниэлинструкция по оптимизации сайтов на Drupal херени даниэл
инструкция по оптимизации сайтов на Drupal херени даниэлdrupalconf
 
Fotostock on drupal zhitarev anton (eng)
Fotostock on drupal zhitarev anton (eng)Fotostock on drupal zhitarev anton (eng)
Fotostock on drupal zhitarev anton (eng)drupalconf
 
3 reasons to contribute to drupal florian loretan (eng)
3 reasons to contribute to drupal florian loretan (eng)3 reasons to contribute to drupal florian loretan (eng)
3 reasons to contribute to drupal florian loretan (eng)drupalconf
 
идеология Drupal 8 уже в drupal 7 вячеслав касихин
идеология Drupal 8 уже в drupal 7 вячеслав касихинидеология Drupal 8 уже в drupal 7 вячеслав касихин
идеология Drupal 8 уже в drupal 7 вячеслав касихинdrupalconf
 
кеширование на высоконагруженном Drupal сайте архаров роман (rus)
кеширование на высоконагруженном Drupal сайте архаров роман (rus)кеширование на высоконагруженном Drupal сайте архаров роман (rus)
кеширование на высоконагруженном Drupal сайте архаров роман (rus)drupalconf
 
опыт использования схемы Drupal+varnish+nginx руслан исай
опыт использования схемы Drupal+varnish+nginx руслан исайопыт использования схемы Drupal+varnish+nginx руслан исай
опыт использования схемы Drupal+varnish+nginx руслан исайdrupalconf
 
инструкция по оптимизации сайтов на Drupal херени даниэл
инструкция по оптимизации сайтов на Drupal херени даниэлинструкция по оптимизации сайтов на Drupal херени даниэл
инструкция по оптимизации сайтов на Drupal херени даниэлdrupalconf
 
Business friendly drupal павел прищепа
Business friendly drupal павел прищепаBusiness friendly drupal павел прищепа
Business friendly drupal павел прищепаdrupalconf
 
непрерывная интеграция шаг к непрерывному деплою родионов игорь
непрерывная интеграция   шаг к непрерывному деплою родионов игорьнепрерывная интеграция   шаг к непрерывному деплою родионов игорь
непрерывная интеграция шаг к непрерывному деплою родионов игорьdrupalconf
 
Easy authcache 2 кеширование для pro родионов игорь
Easy authcache 2   кеширование для pro родионов игорьEasy authcache 2   кеширование для pro родионов игорь
Easy authcache 2 кеширование для pro родионов игорьdrupalconf
 
Drupal and the keys to successful communities martin mayer
Drupal and the keys to successful communities martin mayerDrupal and the keys to successful communities martin mayer
Drupal and the keys to successful communities martin mayerdrupalconf
 
практическое использование модуля Panels богуцкий виктор
практическое использование модуля Panels богуцкий викторпрактическое использование модуля Panels богуцкий виктор
практическое использование модуля Panels богуцкий викторdrupalconf
 
как зарабатывать друпал разработчику клют иван
как зарабатывать друпал разработчику клют иванкак зарабатывать друпал разработчику клют иван
как зарабатывать друпал разработчику клют иванdrupalconf
 
Drupal и мобильные устройства комелин константин
Drupal и мобильные устройства комелин константинDrupal и мобильные устройства комелин константин
Drupal и мобильные устройства комелин константинdrupalconf
 
Kolosov drupalconf2011 2_kolosov
Kolosov drupalconf2011 2_kolosovKolosov drupalconf2011 2_kolosov
Kolosov drupalconf2011 2_kolosovdrupalconf
 
Zhitarev vsyo chto_vy_hoteli_znat_o_maestro
Zhitarev vsyo chto_vy_hoteli_znat_o_maestroZhitarev vsyo chto_vy_hoteli_znat_o_maestro
Zhitarev vsyo chto_vy_hoteli_znat_o_maestrodrupalconf
 
Kozhemyakin dcm2011 1
Kozhemyakin dcm2011 1Kozhemyakin dcm2011 1
Kozhemyakin dcm2011 1drupalconf
 
Lozovickiy uvelichenie kachestva_dlya_razrabotchika
Lozovickiy uvelichenie kachestva_dlya_razrabotchikaLozovickiy uvelichenie kachestva_dlya_razrabotchika
Lozovickiy uvelichenie kachestva_dlya_razrabotchikadrupalconf
 

More from drupalconf (20)

инструкция по оптимизации сайтов на Drupal херени даниэл
инструкция по оптимизации сайтов на Drupal херени даниэлинструкция по оптимизации сайтов на Drupal херени даниэл
инструкция по оптимизации сайтов на Drupal херени даниэл
 
Fotostock on drupal zhitarev anton (eng)
Fotostock on drupal zhitarev anton (eng)Fotostock on drupal zhitarev anton (eng)
Fotostock on drupal zhitarev anton (eng)
 
3 reasons to contribute to drupal florian loretan (eng)
3 reasons to contribute to drupal florian loretan (eng)3 reasons to contribute to drupal florian loretan (eng)
3 reasons to contribute to drupal florian loretan (eng)
 
идеология Drupal 8 уже в drupal 7 вячеслав касихин
идеология Drupal 8 уже в drupal 7 вячеслав касихинидеология Drupal 8 уже в drupal 7 вячеслав касихин
идеология Drupal 8 уже в drupal 7 вячеслав касихин
 
кеширование на высоконагруженном Drupal сайте архаров роман (rus)
кеширование на высоконагруженном Drupal сайте архаров роман (rus)кеширование на высоконагруженном Drupal сайте архаров роман (rus)
кеширование на высоконагруженном Drupal сайте архаров роман (rus)
 
опыт использования схемы Drupal+varnish+nginx руслан исай
опыт использования схемы Drupal+varnish+nginx руслан исайопыт использования схемы Drupal+varnish+nginx руслан исай
опыт использования схемы Drupal+varnish+nginx руслан исай
 
инструкция по оптимизации сайтов на Drupal херени даниэл
инструкция по оптимизации сайтов на Drupal херени даниэлинструкция по оптимизации сайтов на Drupal херени даниэл
инструкция по оптимизации сайтов на Drupal херени даниэл
 
Business friendly drupal павел прищепа
Business friendly drupal павел прищепаBusiness friendly drupal павел прищепа
Business friendly drupal павел прищепа
 
непрерывная интеграция шаг к непрерывному деплою родионов игорь
непрерывная интеграция   шаг к непрерывному деплою родионов игорьнепрерывная интеграция   шаг к непрерывному деплою родионов игорь
непрерывная интеграция шаг к непрерывному деплою родионов игорь
 
Easy authcache 2 кеширование для pro родионов игорь
Easy authcache 2   кеширование для pro родионов игорьEasy authcache 2   кеширование для pro родионов игорь
Easy authcache 2 кеширование для pro родионов игорь
 
Drupal and the keys to successful communities martin mayer
Drupal and the keys to successful communities martin mayerDrupal and the keys to successful communities martin mayer
Drupal and the keys to successful communities martin mayer
 
практическое использование модуля Panels богуцкий виктор
практическое использование модуля Panels богуцкий викторпрактическое использование модуля Panels богуцкий виктор
практическое использование модуля Panels богуцкий виктор
 
как зарабатывать друпал разработчику клют иван
как зарабатывать друпал разработчику клют иванкак зарабатывать друпал разработчику клют иван
как зарабатывать друпал разработчику клют иван
 
Drupal и мобильные устройства комелин константин
Drupal и мобильные устройства комелин константинDrupal и мобильные устройства комелин константин
Drupal и мобильные устройства комелин константин
 
Azure
AzureAzure
Azure
 
Kolosov drupalconf2011 2_kolosov
Kolosov drupalconf2011 2_kolosovKolosov drupalconf2011 2_kolosov
Kolosov drupalconf2011 2_kolosov
 
Zhitarev vsyo chto_vy_hoteli_znat_o_maestro
Zhitarev vsyo chto_vy_hoteli_znat_o_maestroZhitarev vsyo chto_vy_hoteli_znat_o_maestro
Zhitarev vsyo chto_vy_hoteli_znat_o_maestro
 
Kozhemyakin dcm2011 1
Kozhemyakin dcm2011 1Kozhemyakin dcm2011 1
Kozhemyakin dcm2011 1
 
Lozovickiy uvelichenie kachestva_dlya_razrabotchika
Lozovickiy uvelichenie kachestva_dlya_razrabotchikaLozovickiy uvelichenie kachestva_dlya_razrabotchika
Lozovickiy uvelichenie kachestva_dlya_razrabotchika
 
Yserver
YserverYserver
Yserver
 

Recently uploaded

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 

Recently uploaded (20)

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 

Object oriented css graeme blackwood

Editor's Notes

  1. Harder to maintain Bloated code is harder to read due to the sheer volume of it If the style of something changes, every instance has to be updated individually, and on bigger sites, this often means something getting missed until the client complains – not cool Adding features to / scaling up a website simply bloats the CSS
  2. So what’s the solution?
  3. What does this involve?
  4. Less likely to break other parts of your site when you change things. Navigating through the code is easier Less conflicting styles Code won’t be littered with importants Scale it right up
  5. CEM
  6. Your love affair with object oriented CSS is about to begin
  7. If not, this is the first step toward OOCSS. It could be a grid system you wrote yourself, or one like 960gs, blueprint etc. In fact, I recommend using a responsive grid system.
  8. I probably don’t have to say this... Boilerplate’s CSS works even if you’re not using HTML5 Better than Eric Meyer’s reset.css, which causes problems with Drupal.
  9. Good base styles are particularly important for typography. It may even be worth separating your typographic styles into a separate stylesheet. Border-box is incredibly useful for controlling sizes when needing to use padding and borders. And it works in IE7!
  10. Focus on getting the code right before tackling Drupal’s way Helps me really understand my frontend code before I theme But think of the developers/themers if you’re not the one doing the implementation
  11. Controversial It can feel faster to just style the output and forget about it But this means all the downsides already mentioned will become realities Once classes start going in, the theme falls into place rapidly It is just as fast, and the more you do, the faster it gets
  12. Drupal’s output is currently not very semantic Fortunately this is starting to improve thanks to you guys I find Display Suite a massive help, and it is very simple to learn I output views as HTML Lists and then theme them to add my classes
  13. Notice how it reads like normal language too
  14. The grid-4 class provides the div with its layout styles The theme-a class provides it with its theme Because the base styles for H3s and Ps don’t have colours assigned, they will inherit the colour in the theme
  15. It flexes to the container No extra styling, markup changes or classes needed
  16. CSS authoring frameworks like Compass and preprocessors like SASS and LESS can make life for the frontend dev a lot easier They are also a great way to get your head into Object Oriented CSS (the SCSS syntax is closer to normal CSS so I recommend using that) Variables, mixins, nesting etc can formalise the whole Object Oriented approach Compass Generating vendor prefixes for you is particularly handy!
  17. But for those that aren’t ready to make the move to a new way of authoring CSS, the principles I have been discussing will work right now.
  18. Firebug is generated CSS You have to trace back through to the SASS to fix
  19. Not only is SASS another layer to debug if something isn’t working properly (particularly for cross-browser testing) It can also make things nasty with nested selectors and overrides – the very things OOCSS is trying to avoid.
  20. Also CSS preprocessors shouldn’t just be used to facilitate a new type of lazy coding. I have seen some generated CSS files three times the size of hand-coded ones – that’s over 110Kb or 5,000 lines for a file that could be 35Kb/1,700 lines or so.