SlideShare a Scribd company logo
Scalable CSS
Architecture
Ngoc Tu Nguyen
CSS Features
❖ Two main key features of CSS
❖ Cascade
❖ Inheritence
Cascade
❖ What is cascade?
➢ algorithm used by browser to determine which property should be used
❖ How does it work?
➢ 3 factors
■ Importance
■ Source Order
■ Specificity
Inheritence
❖ What is inheritence?
General Rules
❖ Use classes over IDs (test case: http://bit.ly/2zqOurs)
❖ Avoid long chaining of classes
❖ Avoid overqualyfing
❖ Do not overuse !important declarations
❖ Do not write selectors that are dependent on location
❖ Avoid deep nesting
❖ Document your code
What does it even mean Scalable CSS?
❖ CSS open for future expanding
❖ Easily understandable by other developers, written in systematic way
❖ Component oriented
❖ Manageable codebase
How to achive robust Scalable CSS Architecture?
❖ Introduce naming conventions
❖ Write classes for reusability
❖ The code should be predictable
❖ ITCSS philosophy - Harry Roberts
Naming Conventions
❖ BEM (Block, Element, Modifier)
➢ Yandex
❖ OOCSS (Object Oriented CSS)
➢ Nicole Sulivan
❖ SMACSS (Scalable Modular Architecture CSS)
➢ Jonathan Snook
Improved version of BEM
❖ Basic syntax [BLOCK]__[ELEMENT]--[MODIFIER]
❖ Improved version of BEM by adding prefixes, to indicate what does the
part of the code do
❖ Proposed by Harry Roberts
❖ Examples: “c-” represents a component, “u-” represents utility helper
class, “t-” represents thematical class, “o-” represents an object, also use
“is-”, “has-” to represent states in addition to BEM
Example
Object Oriented CSS
❖ Approach proposed by Nicole Sullivan
❖ Introduced Media Object
❖ Media Object is repeated design pattern
❖ She divided code into code that influences structure and other that
influences only the skin
❖ Object classes are open to extension, closed to modification
❖ “The media object is an image to the left, with descriptive content to the right”
ITCSS Architecture
❖ Inverted triangle CSS architecture
❖ Sane, scalable, managed architecture
❖ It takes advantage of CSS feature - cascade, inheritence
What does each layer represent?
❖ Settings - fonts, colors, variables
❖ Tools - mixins, functions
❖ Generic - resets, normalizers, box-sizing
❖ Elements - bare HTML elements
❖ Objects - class based selectors (wrappers, containers, grids etc.)
❖ Components - specific UI components
❖ Utility - helper classes (eg. text-center, text-left etc.)
Managing CSS Projects [online]. Available at:
http://csswizardry.net/talks/2014/11/itcss-dafed.pdf
ITCSS Talk - Video [online]. Available at:
https://goo.gl/2XXi9U
Sources

More Related Content

Similar to Salsita Tech Talk - Scalable CSS Architecture

slides-students-C04.pdf
slides-students-C04.pdfslides-students-C04.pdf
slides-students-C04.pdf
MonkeyDLuffy708724
 
Web Technology
Web TechnologyWeb Technology
Web Technology
Kirti H Mandal
 
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...
Jer Clarke
 
Modern UI Architecture_ Trends and Technologies in Web Development
Modern UI Architecture_ Trends and Technologies in Web DevelopmentModern UI Architecture_ Trends and Technologies in Web Development
Modern UI Architecture_ Trends and Technologies in Web Development
Suresh Patidar
 
Software Architecture: Principles, Patterns and Practices
Software Architecture: Principles, Patterns and PracticesSoftware Architecture: Principles, Patterns and Practices
Software Architecture: Principles, Patterns and Practices
Ganesh Samarthyam
 
Web design-workflow
Web design-workflowWeb design-workflow
Web design-workflow
Peter Kaizer
 
Expressing Concept Schemes & Competency Frameworks in CTDL
Expressing Concept Schemes & Competency Frameworks in CTDLExpressing Concept Schemes & Competency Frameworks in CTDL
Expressing Concept Schemes & Competency Frameworks in CTDL
Credential Engine
 
What is-sass-by-lucas-castro
What is-sass-by-lucas-castroWhat is-sass-by-lucas-castro
What is-sass-by-lucas-castro
Lucas Castro
 
Stupid Index Block Tricks
Stupid Index Block TricksStupid Index Block Tricks
Stupid Index Block Tricks
hannonhill
 
Scala with mongodb
Scala with mongodbScala with mongodb
Scala with mongodb
Knoldus Inc.
 
DHTML
DHTMLDHTML
Css Systems
Css SystemsCss Systems
Css Systems
Stephen Burgess
 
PresentationofINTERship.pdf
PresentationofINTERship.pdfPresentationofINTERship.pdf
PresentationofINTERship.pdf
goldy810082
 
WordCamp NYC - DRY CSS
WordCamp NYC - DRY CSSWordCamp NYC - DRY CSS
WordCamp NYC - DRY CSS
Jer Clarke
 
Michael stack -the state of apache h base
Michael stack -the state of apache h baseMichael stack -the state of apache h base
Michael stack -the state of apache h base
hdhappy001
 
Scala with MongoDB
Scala with MongoDBScala with MongoDB
Scala with MongoDB
Abdhesh Kumar
 
W3Conf slides - The top web features from caniuse.com you can use today
W3Conf slides - The top web features from caniuse.com you can use todayW3Conf slides - The top web features from caniuse.com you can use today
W3Conf slides - The top web features from caniuse.com you can use today
adeveria
 
Getting Started With CSS
Getting Started With CSSGetting Started With CSS
Getting Started With CSS
Trisha Crowley
 
DW unit 3.pptx
DW unit 3.pptxDW unit 3.pptx
DW unit 3.pptx
SeethaDinesh
 
I Have a NoSQL toaster - DC - August 2017
I Have a NoSQL toaster - DC - August 2017I Have a NoSQL toaster - DC - August 2017
I Have a NoSQL toaster - DC - August 2017
Matthew Groves
 

Similar to Salsita Tech Talk - Scalable CSS Architecture (20)

slides-students-C04.pdf
slides-students-C04.pdfslides-students-C04.pdf
slides-students-C04.pdf
 
Web Technology
Web TechnologyWeb Technology
Web Technology
 
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...
 
Modern UI Architecture_ Trends and Technologies in Web Development
Modern UI Architecture_ Trends and Technologies in Web DevelopmentModern UI Architecture_ Trends and Technologies in Web Development
Modern UI Architecture_ Trends and Technologies in Web Development
 
Software Architecture: Principles, Patterns and Practices
Software Architecture: Principles, Patterns and PracticesSoftware Architecture: Principles, Patterns and Practices
Software Architecture: Principles, Patterns and Practices
 
Web design-workflow
Web design-workflowWeb design-workflow
Web design-workflow
 
Expressing Concept Schemes & Competency Frameworks in CTDL
Expressing Concept Schemes & Competency Frameworks in CTDLExpressing Concept Schemes & Competency Frameworks in CTDL
Expressing Concept Schemes & Competency Frameworks in CTDL
 
What is-sass-by-lucas-castro
What is-sass-by-lucas-castroWhat is-sass-by-lucas-castro
What is-sass-by-lucas-castro
 
Stupid Index Block Tricks
Stupid Index Block TricksStupid Index Block Tricks
Stupid Index Block Tricks
 
Scala with mongodb
Scala with mongodbScala with mongodb
Scala with mongodb
 
DHTML
DHTMLDHTML
DHTML
 
Css Systems
Css SystemsCss Systems
Css Systems
 
PresentationofINTERship.pdf
PresentationofINTERship.pdfPresentationofINTERship.pdf
PresentationofINTERship.pdf
 
WordCamp NYC - DRY CSS
WordCamp NYC - DRY CSSWordCamp NYC - DRY CSS
WordCamp NYC - DRY CSS
 
Michael stack -the state of apache h base
Michael stack -the state of apache h baseMichael stack -the state of apache h base
Michael stack -the state of apache h base
 
Scala with MongoDB
Scala with MongoDBScala with MongoDB
Scala with MongoDB
 
W3Conf slides - The top web features from caniuse.com you can use today
W3Conf slides - The top web features from caniuse.com you can use todayW3Conf slides - The top web features from caniuse.com you can use today
W3Conf slides - The top web features from caniuse.com you can use today
 
Getting Started With CSS
Getting Started With CSSGetting Started With CSS
Getting Started With CSS
 
DW unit 3.pptx
DW unit 3.pptxDW unit 3.pptx
DW unit 3.pptx
 
I Have a NoSQL toaster - DC - August 2017
I Have a NoSQL toaster - DC - August 2017I Have a NoSQL toaster - DC - August 2017
I Have a NoSQL toaster - DC - August 2017
 

Recently uploaded

FUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdfFUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
EMERSON EDUARDO RODRIGUES
 
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
upoux
 
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdfAsymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
felixwold
 
Blood finder application project report (1).pdf
Blood finder application project report (1).pdfBlood finder application project report (1).pdf
Blood finder application project report (1).pdf
Kamal Acharya
 
FULL STACK PROGRAMMING - Both Front End and Back End
FULL STACK PROGRAMMING - Both Front End and Back EndFULL STACK PROGRAMMING - Both Front End and Back End
FULL STACK PROGRAMMING - Both Front End and Back End
PreethaV16
 
openshift technical overview - Flow of openshift containerisatoin
openshift technical overview - Flow of openshift containerisatoinopenshift technical overview - Flow of openshift containerisatoin
openshift technical overview - Flow of openshift containerisatoin
snaprevwdev
 
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
nedcocy
 
Sri Guru Hargobind Ji - Bandi Chor Guru.pdf
Sri Guru Hargobind Ji - Bandi Chor Guru.pdfSri Guru Hargobind Ji - Bandi Chor Guru.pdf
Sri Guru Hargobind Ji - Bandi Chor Guru.pdf
Balvir Singh
 
Call Girls Chennai +91-8824825030 Vip Call Girls Chennai
Call Girls Chennai +91-8824825030 Vip Call Girls ChennaiCall Girls Chennai +91-8824825030 Vip Call Girls Chennai
Call Girls Chennai +91-8824825030 Vip Call Girls Chennai
paraasingh12 #V08
 
Properties of Fluids, Fluid Statics, Pressure Measurement
Properties of Fluids, Fluid Statics, Pressure MeasurementProperties of Fluids, Fluid Statics, Pressure Measurement
Properties of Fluids, Fluid Statics, Pressure Measurement
Indrajeet sahu
 
Accident detection system project report.pdf
Accident detection system project report.pdfAccident detection system project report.pdf
Accident detection system project report.pdf
Kamal Acharya
 
paper relate Chozhavendhan et al. 2020.pdf
paper relate Chozhavendhan et al. 2020.pdfpaper relate Chozhavendhan et al. 2020.pdf
paper relate Chozhavendhan et al. 2020.pdf
ShurooqTaib
 
Butterfly Valves Manufacturer (LBF Series).pdf
Butterfly Valves Manufacturer (LBF Series).pdfButterfly Valves Manufacturer (LBF Series).pdf
Butterfly Valves Manufacturer (LBF Series).pdf
Lubi Valves
 
comptia-security-sy0-701-exam-objectives-(5-0).pdf
comptia-security-sy0-701-exam-objectives-(5-0).pdfcomptia-security-sy0-701-exam-objectives-(5-0).pdf
comptia-security-sy0-701-exam-objectives-(5-0).pdf
foxlyon
 
Ericsson LTE Throughput Troubleshooting Techniques.ppt
Ericsson LTE Throughput Troubleshooting Techniques.pptEricsson LTE Throughput Troubleshooting Techniques.ppt
Ericsson LTE Throughput Troubleshooting Techniques.ppt
wafawafa52
 
INTRODUCTION TO ARTIFICIAL INTELLIGENCE BASIC
INTRODUCTION TO ARTIFICIAL INTELLIGENCE BASICINTRODUCTION TO ARTIFICIAL INTELLIGENCE BASIC
INTRODUCTION TO ARTIFICIAL INTELLIGENCE BASIC
GOKULKANNANMMECLECTC
 
ELS: 2.4.1 POWER ELECTRONICS Course objectives: This course will enable stude...
ELS: 2.4.1 POWER ELECTRONICS Course objectives: This course will enable stude...ELS: 2.4.1 POWER ELECTRONICS Course objectives: This course will enable stude...
ELS: 2.4.1 POWER ELECTRONICS Course objectives: This course will enable stude...
Kuvempu University
 
OOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming languageOOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming language
PreethaV16
 
SELENIUM CONF -PALLAVI SHARMA - 2024.pdf
SELENIUM CONF -PALLAVI SHARMA - 2024.pdfSELENIUM CONF -PALLAVI SHARMA - 2024.pdf
SELENIUM CONF -PALLAVI SHARMA - 2024.pdf
Pallavi Sharma
 
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
ydzowc
 

Recently uploaded (20)

FUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdfFUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
 
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
 
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdfAsymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
 
Blood finder application project report (1).pdf
Blood finder application project report (1).pdfBlood finder application project report (1).pdf
Blood finder application project report (1).pdf
 
FULL STACK PROGRAMMING - Both Front End and Back End
FULL STACK PROGRAMMING - Both Front End and Back EndFULL STACK PROGRAMMING - Both Front End and Back End
FULL STACK PROGRAMMING - Both Front End and Back End
 
openshift technical overview - Flow of openshift containerisatoin
openshift technical overview - Flow of openshift containerisatoinopenshift technical overview - Flow of openshift containerisatoin
openshift technical overview - Flow of openshift containerisatoin
 
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
 
Sri Guru Hargobind Ji - Bandi Chor Guru.pdf
Sri Guru Hargobind Ji - Bandi Chor Guru.pdfSri Guru Hargobind Ji - Bandi Chor Guru.pdf
Sri Guru Hargobind Ji - Bandi Chor Guru.pdf
 
Call Girls Chennai +91-8824825030 Vip Call Girls Chennai
Call Girls Chennai +91-8824825030 Vip Call Girls ChennaiCall Girls Chennai +91-8824825030 Vip Call Girls Chennai
Call Girls Chennai +91-8824825030 Vip Call Girls Chennai
 
Properties of Fluids, Fluid Statics, Pressure Measurement
Properties of Fluids, Fluid Statics, Pressure MeasurementProperties of Fluids, Fluid Statics, Pressure Measurement
Properties of Fluids, Fluid Statics, Pressure Measurement
 
Accident detection system project report.pdf
Accident detection system project report.pdfAccident detection system project report.pdf
Accident detection system project report.pdf
 
paper relate Chozhavendhan et al. 2020.pdf
paper relate Chozhavendhan et al. 2020.pdfpaper relate Chozhavendhan et al. 2020.pdf
paper relate Chozhavendhan et al. 2020.pdf
 
Butterfly Valves Manufacturer (LBF Series).pdf
Butterfly Valves Manufacturer (LBF Series).pdfButterfly Valves Manufacturer (LBF Series).pdf
Butterfly Valves Manufacturer (LBF Series).pdf
 
comptia-security-sy0-701-exam-objectives-(5-0).pdf
comptia-security-sy0-701-exam-objectives-(5-0).pdfcomptia-security-sy0-701-exam-objectives-(5-0).pdf
comptia-security-sy0-701-exam-objectives-(5-0).pdf
 
Ericsson LTE Throughput Troubleshooting Techniques.ppt
Ericsson LTE Throughput Troubleshooting Techniques.pptEricsson LTE Throughput Troubleshooting Techniques.ppt
Ericsson LTE Throughput Troubleshooting Techniques.ppt
 
INTRODUCTION TO ARTIFICIAL INTELLIGENCE BASIC
INTRODUCTION TO ARTIFICIAL INTELLIGENCE BASICINTRODUCTION TO ARTIFICIAL INTELLIGENCE BASIC
INTRODUCTION TO ARTIFICIAL INTELLIGENCE BASIC
 
ELS: 2.4.1 POWER ELECTRONICS Course objectives: This course will enable stude...
ELS: 2.4.1 POWER ELECTRONICS Course objectives: This course will enable stude...ELS: 2.4.1 POWER ELECTRONICS Course objectives: This course will enable stude...
ELS: 2.4.1 POWER ELECTRONICS Course objectives: This course will enable stude...
 
OOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming languageOOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming language
 
SELENIUM CONF -PALLAVI SHARMA - 2024.pdf
SELENIUM CONF -PALLAVI SHARMA - 2024.pdfSELENIUM CONF -PALLAVI SHARMA - 2024.pdf
SELENIUM CONF -PALLAVI SHARMA - 2024.pdf
 
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
 

Salsita Tech Talk - Scalable CSS Architecture

  • 2. CSS Features ❖ Two main key features of CSS ❖ Cascade ❖ Inheritence
  • 3. Cascade ❖ What is cascade? ➢ algorithm used by browser to determine which property should be used ❖ How does it work? ➢ 3 factors ■ Importance ■ Source Order ■ Specificity
  • 4. Inheritence ❖ What is inheritence?
  • 5. General Rules ❖ Use classes over IDs (test case: http://bit.ly/2zqOurs) ❖ Avoid long chaining of classes ❖ Avoid overqualyfing ❖ Do not overuse !important declarations ❖ Do not write selectors that are dependent on location ❖ Avoid deep nesting ❖ Document your code
  • 6. What does it even mean Scalable CSS? ❖ CSS open for future expanding ❖ Easily understandable by other developers, written in systematic way ❖ Component oriented ❖ Manageable codebase
  • 7. How to achive robust Scalable CSS Architecture? ❖ Introduce naming conventions ❖ Write classes for reusability ❖ The code should be predictable ❖ ITCSS philosophy - Harry Roberts
  • 8. Naming Conventions ❖ BEM (Block, Element, Modifier) ➢ Yandex ❖ OOCSS (Object Oriented CSS) ➢ Nicole Sulivan ❖ SMACSS (Scalable Modular Architecture CSS) ➢ Jonathan Snook
  • 9. Improved version of BEM ❖ Basic syntax [BLOCK]__[ELEMENT]--[MODIFIER] ❖ Improved version of BEM by adding prefixes, to indicate what does the part of the code do ❖ Proposed by Harry Roberts ❖ Examples: “c-” represents a component, “u-” represents utility helper class, “t-” represents thematical class, “o-” represents an object, also use “is-”, “has-” to represent states in addition to BEM
  • 11.
  • 12. Object Oriented CSS ❖ Approach proposed by Nicole Sullivan ❖ Introduced Media Object ❖ Media Object is repeated design pattern ❖ She divided code into code that influences structure and other that influences only the skin ❖ Object classes are open to extension, closed to modification ❖ “The media object is an image to the left, with descriptive content to the right”
  • 13.
  • 14. ITCSS Architecture ❖ Inverted triangle CSS architecture ❖ Sane, scalable, managed architecture ❖ It takes advantage of CSS feature - cascade, inheritence
  • 15.
  • 16. What does each layer represent? ❖ Settings - fonts, colors, variables ❖ Tools - mixins, functions ❖ Generic - resets, normalizers, box-sizing ❖ Elements - bare HTML elements ❖ Objects - class based selectors (wrappers, containers, grids etc.) ❖ Components - specific UI components ❖ Utility - helper classes (eg. text-center, text-left etc.)
  • 17.
  • 18.
  • 19.
  • 20.
  • 21. Managing CSS Projects [online]. Available at: http://csswizardry.net/talks/2014/11/itcss-dafed.pdf ITCSS Talk - Video [online]. Available at: https://goo.gl/2XXi9U Sources