Movatterモバイル変換


[0]ホーム

URL:


Julie Cameron, profile picture
Uploaded byJulie Cameron
PDF, PPTX11,036 views

Decoupling the Front-end with Modular CSS

The document discusses the challenges of managing CSS within codebases, highlighting issues like specificity hell and the coupling of HTML and CSS. It advocates for modular CSS practices such as Object-Oriented CSS (OOCSS), BEM, and SMACSS to create scalable, maintainable, and predictable styling. The document emphasizes best practices for naming conventions, separation of structure from skin, and the importance of documentation in CSS architecture.

Embed presentation

Download as PDF, PPTX
Decoupling the Front-end withModular CSSJulie Cameron@jewlofthelotus#OSCON 2015bit.ly/decoupling-css
DERP.@jewlofthelotus | #OSCON
@jewlofthelotus | #OSCON
articulate.com@jewlofthelotus | #OSCON
girldevelopit.com@jewlofthelotus | #OSCON
OOCSS@jewlofthelotus | #OSCON
Got CSS?@jewlofthelotus | #OSCON
@jewlofthelotus | #OSCON
#cascade {div.is {span.delicate {position: absolute !important;}}}@jewlofthelotus | #OSCON
@jewlofthelotus | #OSCON
“It’s almost a challenge to find a developmentteam that’s working on a codebase that’s morethan a couple of years old where the CSS isn’tthe most frightening and hated part of thatsystem.”Andy Hume - CSS for Grownups@jewlofthelotus | #OSCON
TOP DOWN CSS=REPETITION & BLOAT@jewlofthelotus | #OSCON
SELECTOR MISUSE=SPECIFICITY HELL@jewlofthelotus | #OSCON
BLOAT+BAD SELECTORS=BAD PERFORMANCE@jewlofthelotus | #OSCON
!IMPORTANT=THE DEVIL@jewlofthelotus | #OSCON
NONE OF THIS ISSCALABLE ORMAINTAINABLE.A hot mess is what it is…@jewlofthelotus | #OSCON
TOPDOWNOVERLYSPECIFICCSSHTML@jewlofthelotus | #OSCON
WE’VE BEENCOUPLING OURHTML & CSS@jewlofthelotus | #OSCON
WE’VE BEENCOUPLING OURHTML & CSSAnd sometimes our CSS & JavaScript.@jewlofthelotus | #OSCON
WE’VE BEENCOUPLING OURHTML & CSSAnd sometimes our CSS & JavaScript. …and Feature Specs, too.@jewlofthelotus | #OSCON
Coupled CSS Selectors@jewlofthelotus | #OSCON
STOP USINGCSS SELECTORSFOR NON-CSSData Attributes. FTW.@jewlofthelotus | #OSCON
Functionality Selectors@jewlofthelotus | #OSCON
START USINGMODULAR CSS@jewlofthelotus | #OSCON
WHY?@jewlofthelotus | #OSCON
MODULAR@jewlofthelotus | #OSCON
PREDICTABLE@jewlofthelotus | #OSCON
MAINTAINABLE@jewlofthelotus | #OSCON
SCALABLE@jewlofthelotus | #OSCON
DRY@jewlofthelotus | #OSCON
ORGANIZED@jewlofthelotus | #OSCON
Modular Solutions• OOCSS• BEM• SMACSS• Atomic Design• CSS for Grownups• CCSS• DRY CSS• and many more…@jewlofthelotus | #OSCON
Object Oriented Cascading StylesheetsOOCSShttps://github.com/stubbornella/oocss/wiki@jewlofthelotus | #OSCON
A scalable, maintainable,semantic, and predictableapproach to writing CSS.@jewlofthelotus | #OSCON
OOCSS was created by Nicole Sullivanwhile working for Facebook.She created a reusable CSS modulecalled the “media object” to savehundreds of lines of code.stubbornella.org@jewlofthelotus | #OSCON
The Media Object“a content block containing a fixed-sizemedia element (e.g. image or video) alongwith other variable-size content (e.g. text)”https://github.com/stubbornella/oocss/wikiAKA a Facebook status.@jewlofthelotus | #OSCON
A Media ObjectMedia to the left and somevariable length content tothe right.img.png@jewlofthelotus | #OSCON
The Foundation of Modular CSSOBJECTS@jewlofthelotus | #OSCON
Objects are theabstraction of repetition.@jewlofthelotus | #OSCON
Object Makeup1. HTML - one or more nodes of the DOMhttps://github.com/stubbornella/oocss/wiki/FAQ@jewlofthelotus | #OSCON
Object Makeup1. HTML - one or more nodes of the DOMhttps://github.com/stubbornella/oocss/wiki/FAQ2. CSS that styles those nodes@jewlofthelotus | #OSCON
Object Makeup1. HTML - one or more nodes of the DOMhttps://github.com/stubbornella/oocss/wiki/FAQ2. CSS that styles those nodes3. JavaScript functionality tied to those nodes@jewlofthelotus | #OSCON
Modules with Variations.btn@jewlofthelotus | #OSCON
Modules with Variations.btn.btn—primary .btn-smallCSS.btn:hover@jewlofthelotus | #OSCON
Modules with Variations.btn.btn.is—disabled .btn.is-activeCSSJS.btn—primary .btn-smallCSS.btn:hover@jewlofthelotus | #OSCON
Module ComponentsObject aka module / component / block .btn, .media@jewlofthelotus | #OSCON
Module ComponentsObject aka module / component / block .btn, .mediaChild Objects .media__img, .media__bodyRelationships@jewlofthelotus | #OSCON
Module ComponentsObject aka module / component / block .btn, .mediaModifiers .media—-inline, .media__img—-rightCSS Design VariationsChild Objects .media__img, .media__bodyRelationships@jewlofthelotus | #OSCON
Module ComponentsObject aka module / component / block .btn, .mediaModifiers .media—-inline, .media__img—-rightCSS Design VariationsStates .media—-collapsed, .media.is-activeCSS / JS Design AdjustmentsChild Objects .media__img, .media__bodyRelationships@jewlofthelotus | #OSCON
BESTPRACTICES@jewlofthelotus | #OSCON
SINGLERESPONSIBILITYDo one thing well and one thing only.@jewlofthelotus | #OSCON
.CLASSES.CLASSES.CLASSESTake that, specificity!@jewlofthelotus | #OSCON
NAMINGCONVENTIONSJust breathe. Everything is going to be okay.@jewlofthelotus | #OSCON
PICK A SYSTEMBE CONSISTENT@jewlofthelotus | #OSCON
Naming Formats.modulename.moduleName.module-name.module_name.bem——style.bem_ _style@jewlofthelotus | #OSCON
Naming PatternsHow do you identify children? States? Modifiers?.objectChild.object-child.object_child.object_ _child.myObject—childObj.object.is—active.objectModifier.object-modifier.object_modifier.object——modifier.myObj-modClass.object.active@jewlofthelotus | #OSCON
BEM.block__element——modifierhttp://bem.info@jewlofthelotus | #OSCON
.block .media@jewlofthelotus | #OSCON
.block .media.block__element .media_ _img@jewlofthelotus | #OSCON
.block .media.block__element .media_ _img.block——modifier .media——inline@jewlofthelotus | #OSCON
.block .media.block__element .media_ _img.block——modifier .media——inline.block__element——modifier .media_ _img——right@jewlofthelotus | #OSCON
SEMANTICVSPRESENTATIONALNAMINGUh oh…@jewlofthelotus | #OSCON
Presentational NamingDescribes how the object looks..grid_ _col——9.btn——small.border——all.color——red.float——left.border——thick@jewlofthelotus | #OSCON
Semantic NamingDescribes what the object is..bookmark.article.callToAction.error.article_ _title.article——flagged@jewlofthelotus | #OSCON
Fewer Semantic ClassesDRY HTMLVSDRY CSSMany Presentational Classes@jewlofthelotus | #OSCON
NO ONE KNOWSWHAT THEY’REDOING.@jewlofthelotus | #OSCON
2 Principlesof OOCSS@jewlofthelotus | #OSCON
Separation ofSTRUCTUREfromSKIN1ST PRINCIPLE@jewlofthelotus | #OSCON
Structure Vs. Skin@jewlofthelotus | #OSCON
Structure Vs. SkinDefine repeating “invisible” patternsas reusable structures.What makes a button look like a button?@jewlofthelotus | #OSCON
Structure Vs. SkinDefine repeating “invisible” patternsas reusable structures.What makes a button look like a button?Define repeating visual patternsas reusable skins.What makes these buttons look different?@jewlofthelotus | #OSCON
StructureRepeating “invisible” patterns.What makes a button look like a button?@jewlofthelotus | #OSCON
StructureRepeating “invisible” patterns.What makes a button look like a button?@jewlofthelotus | #OSCON
SkinRepeating visible patterns.What makes these buttons look different?@jewlofthelotus | #OSCON
SkinRepeating visible patterns.What makes these buttons look different?@jewlofthelotus | #OSCON
Structure + Skin@jewlofthelotus | #OSCON
Structure + Skin.btn .btn—primary.btn—small.btn—block.btn—inverse@jewlofthelotus | #OSCON
Separation ofCONTAINERfromCONTENT2ND PRINCIPLE@jewlofthelotus | #OSCON
Container Vs. ContentObjects should look the sameno matter where you put them.@jewlofthelotus | #OSCON
Location Dependent Styles@jewlofthelotus | #OSCON
Location Dependent Styles@jewlofthelotus | #OSCON
Location Dependent Styles@jewlofthelotus | #OSCON
Better?@jewlofthelotus | #OSCON
Separation OfContainer & ContentWhat is the container?@jewlofthelotus | #OSCON
Separation OfContainer & ContentWhat is the container?@jewlofthelotus | #OSCON
Separation OfContainer & ContentWhat is the content?@jewlofthelotus | #OSCON
Separation OfContainer & ContentAbstract reusable styles into a new object.@jewlofthelotus | #OSCON
With OOCSS, we’re encouraged to givemore forethought to what is commonamong different elements, then separatethose common features into modules, orobjects, that can be reused anywhere.Louis Lazaris — Smashing Magazine@jewlofthelotus | #OSCON
OOCSSStructure vs. SkinContainer vs. Content@jewlofthelotus | #OSCON
CLASSITIS@jewlofthelotus | #OSCON
HTML <3 CSS@jewlofthelotus | #OSCON
HTML <3 CSSCSSSTYLE@jewlofthelotus | #OSCON
The Semantics Debate• Do classes actually have “semantic” value?@jewlofthelotus | #OSCON
The Semantics Debate• Do classes actually have “semantic” value?• To whom are classes semantic to?@jewlofthelotus | #OSCON
The Semantics Debate• Do classes actually have “semantic” value?• To whom are classes semantic to?• Should we stick with one way or the other?@jewlofthelotus | #OSCON
PresentationalArguments• Classes have NO meaning to the browser.@jewlofthelotus | #OSCON
PresentationalArguments• Classes have NO meaning to the browser.• Classes ARE semantic to developers.@jewlofthelotus | #OSCON
PresentationalArguments• Classes have NO meaning to the browser.• Classes ARE semantic to developers.• Content describes itself, classes don’t need to.@jewlofthelotus | #OSCON
SemanticDRY HTMLVSDRY CSSPresentational@jewlofthelotus | #OSCON
SMACSSScalable & Modular Architecture with CSShttp://smacss.comJonathan Snook@jewlofthelotus | #OSCON
CATEGORIZATION@jewlofthelotus | #OSCON
• Base• Layout• Module• State• ThemeSMACSS Categories@jewlofthelotus | #OSCON
CSS Resets+Default StylesWhat things should generally look like.SMACSS Base Objects@jewlofthelotus | #OSCON
Containers+GridsHold the modules together.SMACSS Layout Objects#IDs for single use “major” components.classes for reusable “minor” components@jewlofthelotus | #OSCON
Reusable Parts+ 
Subclasses(Modifiers)The good stuff.SMACSS Modules@jewlofthelotus | #OSCON
Tacked on to layout& module objectsIndicate a JavaScript dependency.SMACSS State Objects!important is allowed and even recommended!@jewlofthelotus | #OSCON
Tacked on to layout& module objectsIndicate a JavaScript dependency.SMACSS State Objects!important is allowed and even recommended!Module-specificState objectsInclude module name & reside with it.pseudo & @media query states included.@jewlofthelotus | #OSCON
Themes canapply to all otherobject typesIn the case that your site has multipleholistic themes.SMACSS Themes@jewlofthelotus | #OSCON
ATOMICDESIGNhttp://bradfrost.com/blog/post/atomic-web-designBrad Frost@jewlofthelotus | #OSCON
ASSEMBLING@jewlofthelotus | #OSCON
Atomic Designatoms molecules organisms templates pages@jewlofthelotus | #OSCON
Atomic Designatoms molecules organisms templates pages+@jewlofthelotus | #OSCON
The basic buildingblocks of matter.Single element. Global styles.Atoms@jewlofthelotus | #OSCON
Groups of atomsbonded together.Simple combinations built for reuse.Molecules@jewlofthelotus | #OSCON
Groups of moleculesjoined together.Complex, distinct sections of an interface.Organisms@jewlofthelotus | #OSCON
http://patternlab.ioA collection of tools to help you createatomic design systems.Pattern Lab
WHATNOW?@jewlofthelotus | #OSCON
ORGANIZEOPTIMIZEREPEAT@jewlofthelotus | #OSCON
ITERATING ONABSTRACTION@jewlofthelotus | #OSCON
FINDING THE RIGHTGRANULARITY@jewlofthelotus | #OSCON
ESTABLISHCONVENTIONS@jewlofthelotus | #OSCON
DOCUMENTEVERYTHING@jewlofthelotus | #OSCON
ARCHITECT ASTYLEGUIDE@jewlofthelotus | #OSCON
UTILIZE A CSSPREPROCESSOR@jewlofthelotus | #OSCON
STOP USINGCSS SELECTORSFOR NON-CSS@jewlofthelotus | #OSCON
http://github.com/davidtheclark/scalable-css-reading-listhttp://bit.ly/dc-scrlLEARNMORE@jewlofthelotus | #OSCON
Questions?Decoupling the Front-end withModular CSSJulie Cameron@jewlofthelotus#OSCON 2015bit.ly/decoupling-css

Recommended

PDF
Intro to OOCSS Workshop
PDF
OOCSS Lightening Talk
PDF
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...
PDF
Responsive Web Design: Clever Tips and Techniques
PPTX
Scalable and Modular CSS FTW!
 
PDF
[HEWEBAR 2012] Beyond Desktop Browsing (HTML5)
KEY
The Fast And The Fabulous
KEY
What is Object Oriented CSS?
PDF
Component Driven Design and Development
PDF
CSS Lessons Learned the Hard Way (Generate Conf)
PDF
[PSU Web 2011] HTML5 Design
PDF
ACSS: Rethinking CSS Best Practices
PPTX
Basics of Front End Web Dev PowerPoint
PDF
[O'Reilly] HTML5 Design
PDF
Creating Living Style Guides to Improve Performance
PDF
CSS - OOCSS, SMACSS and more
PPTX
PDF
Modern Front-End Development
PDF
HTML5 & CSS3 Flag
PDF
[Access U 2010] HTML5 & Accessibility
PDF
Front End Tooling and Performance - Codeaholics HK 2015
PDF
BEM it!
PDF
The benefits of BEM CSS
PPTX
Bootstrap [part 2]
PPTX
Rapid and Responsive - UX to Prototype with Bootstrap
PDF
Prototyping w/HTML5 and CSS3
KEY
Slow kinda sucks
PDF
網頁程式設計
PDF
Steamで同人ゲームをリリースする ~パブリッシャーになって検証してみた~
PDF
SassConf: Managing Complex Projects with Design Components

More Related Content

PDF
Intro to OOCSS Workshop
PDF
OOCSS Lightening Talk
PDF
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...
PDF
Responsive Web Design: Clever Tips and Techniques
PPTX
Scalable and Modular CSS FTW!
 
PDF
[HEWEBAR 2012] Beyond Desktop Browsing (HTML5)
KEY
The Fast And The Fabulous
KEY
What is Object Oriented CSS?
Intro to OOCSS Workshop
OOCSS Lightening Talk
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...
Responsive Web Design: Clever Tips and Techniques
Scalable and Modular CSS FTW!
 
[HEWEBAR 2012] Beyond Desktop Browsing (HTML5)
The Fast And The Fabulous
What is Object Oriented CSS?

What's hot

PDF
Component Driven Design and Development
PDF
CSS Lessons Learned the Hard Way (Generate Conf)
PDF
[PSU Web 2011] HTML5 Design
PDF
ACSS: Rethinking CSS Best Practices
PPTX
Basics of Front End Web Dev PowerPoint
PDF
[O'Reilly] HTML5 Design
PDF
Creating Living Style Guides to Improve Performance
PDF
CSS - OOCSS, SMACSS and more
PPTX
PDF
Modern Front-End Development
PDF
HTML5 & CSS3 Flag
PDF
[Access U 2010] HTML5 & Accessibility
PDF
Front End Tooling and Performance - Codeaholics HK 2015
PDF
BEM it!
PDF
The benefits of BEM CSS
PPTX
Bootstrap [part 2]
PPTX
Rapid and Responsive - UX to Prototype with Bootstrap
PDF
Prototyping w/HTML5 and CSS3
KEY
Slow kinda sucks
PDF
網頁程式設計
Component Driven Design and Development
CSS Lessons Learned the Hard Way (Generate Conf)
[PSU Web 2011] HTML5 Design
ACSS: Rethinking CSS Best Practices
Basics of Front End Web Dev PowerPoint
[O'Reilly] HTML5 Design
Creating Living Style Guides to Improve Performance
CSS - OOCSS, SMACSS and more
Modern Front-End Development
HTML5 & CSS3 Flag
[Access U 2010] HTML5 & Accessibility
Front End Tooling and Performance - Codeaholics HK 2015
BEM it!
The benefits of BEM CSS
Bootstrap [part 2]
Rapid and Responsive - UX to Prototype with Bootstrap
Prototyping w/HTML5 and CSS3
Slow kinda sucks
網頁程式設計

Viewers also liked

PDF
Steamで同人ゲームをリリースする ~パブリッシャーになって検証してみた~
PDF
SassConf: Managing Complex Projects with Design Components
PPTX
THETAでモバイルVRコンテンツ開発
PDF
クラウド会計ソフトFreee 初期設定ガイド
PDF
Object-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSS
PDF
H2O x mrubyで人はどれだけ幸せになれるのか
Steamで同人ゲームをリリースする ~パブリッシャーになって検証してみた~
SassConf: Managing Complex Projects with Design Components
THETAでモバイルVRコンテンツ開発
クラウド会計ソフトFreee 初期設定ガイド
Object-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSS
H2O x mrubyで人はどれだけ幸せになれるのか

Similar to Decoupling the Front-end with Modular CSS

ZIP
OOCSS for Javascript pirates at jQueryPgh meetup
PDF
Object Oriented CSS for rapid, scalable and maintainable development
PDF
OOCSS for JavaScript Pirates jQcon Boston
PPTX
Css methods architecture
PPT
Object oriented css. Graeme Blackwood
PDF
What is Modular CSS?
PPT
Object oriented css graeme blackwood
PDF
Object Oriented CSS - Joomla!dagen Nederland 2014
PDF
Css Systems
PPTX
Rock Solid CSS Architecture
PDF
OOCSS, SMACSS or BEM, what is the question...
PDF
OOCSS, SMACSS or BEM?
PDF
More of less (take 2)
PPTX
CSS Walktrough Internship Course
PDF
Evolution of CSS
PPTX
Css training
PDF
CSS vs. JavaScript - Trust vs. Control
PPTX
Lecture-8.pptx
PDF
presentation
PPTX
Designing for the web - 101
OOCSS for Javascript pirates at jQueryPgh meetup
Object Oriented CSS for rapid, scalable and maintainable development
OOCSS for JavaScript Pirates jQcon Boston
Css methods architecture
Object oriented css. Graeme Blackwood
What is Modular CSS?
Object oriented css graeme blackwood
Object Oriented CSS - Joomla!dagen Nederland 2014
Css Systems
Rock Solid CSS Architecture
OOCSS, SMACSS or BEM, what is the question...
OOCSS, SMACSS or BEM?
More of less (take 2)
CSS Walktrough Internship Course
Evolution of CSS
Css training
CSS vs. JavaScript - Trust vs. Control
Lecture-8.pptx
presentation
Designing for the web - 101

Recently uploaded

PPTX
PRITHVI theater, A true artist. Newzfeaturez.pptx
PPTX
COĞRAFYA ödevi 70 sayfa güzeldir hayırlı olsun
PPT
Lecture_3 Network Securityeyeyggegeg.ppt
PPTX
Lesson 3 - Methodology of Green Computing - part2 - dela cruz.pptx
PDF
ARTIFICIAL INTELLIGENCE DEVELOPMENT SERVICE
PPTX
Types of Cryptograph Symmetric Ceaser cipher and also about Assymetric
PPT
html-forms in web development-courseICT.
 
PPTX
SriLank SLT LTE Network Sharing V2.pptx
PPT
Memory Organization In Assembly Language
PDF
Here are the winners of KALIDASA SAMMAN.
PDF
Key Duties and Roles of an Ecommerce Developer Singapore
PPT
Lecture_3 Network Securityyyeyeyyeeyyeywy.ppt
PPTX
Ideathon template.pptx it is a ideathon template
PPTX
Abhishek Jaiswal.ppt.pptx for you it is very useful for me and I am sharing w...
PPTX
Computer Science Degree for College .pptx
PPTX
Bibhav Singh.pptx it's very useful for us it's in very good and very nice
PPTX
Lesson 5 - Cyber attack Pt 3 - Matsuhashi.pptx
PPTX
CaseStudy-CloudMigration -For USE CASE -Customer Success Info -6-Aug-25.pptx
PDF
tokiohotellistening.pdf for tokiohotelfans
PPTX
mc l2 Overview of Computer and Web-Technology.pptx
PRITHVI theater, A true artist. Newzfeaturez.pptx
COĞRAFYA ödevi 70 sayfa güzeldir hayırlı olsun
Lecture_3 Network Securityeyeyggegeg.ppt
Lesson 3 - Methodology of Green Computing - part2 - dela cruz.pptx
ARTIFICIAL INTELLIGENCE DEVELOPMENT SERVICE
Types of Cryptograph Symmetric Ceaser cipher and also about Assymetric
html-forms in web development-courseICT.
 
SriLank SLT LTE Network Sharing V2.pptx
Memory Organization In Assembly Language
Here are the winners of KALIDASA SAMMAN.
Key Duties and Roles of an Ecommerce Developer Singapore
Lecture_3 Network Securityyyeyeyyeeyyeywy.ppt
Ideathon template.pptx it is a ideathon template
Abhishek Jaiswal.ppt.pptx for you it is very useful for me and I am sharing w...
Computer Science Degree for College .pptx
Bibhav Singh.pptx it's very useful for us it's in very good and very nice
Lesson 5 - Cyber attack Pt 3 - Matsuhashi.pptx
CaseStudy-CloudMigration -For USE CASE -Customer Success Info -6-Aug-25.pptx
tokiohotellistening.pdf for tokiohotelfans
mc l2 Overview of Computer and Web-Technology.pptx

Decoupling the Front-end with Modular CSS


[8]ページ先頭

©2009-2025 Movatter.jp