SlideShare a Scribd company logo
1 of 21
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

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 DevelopmentSuresh Patidar
 
Software Architecture: Principles, Patterns and Practices
Software Architecture: Principles, Patterns and PracticesSoftware Architecture: Principles, Patterns and Practices
Software Architecture: Principles, Patterns and PracticesGanesh Samarthyam
 
Web design-workflow
Web design-workflowWeb design-workflow
Web design-workflowPeter 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 CTDLCredential Engine
 
What is-sass-by-lucas-castro
What is-sass-by-lucas-castroWhat is-sass-by-lucas-castro
What is-sass-by-lucas-castroLucas Castro
 
Stupid Index Block Tricks
Stupid Index Block TricksStupid Index Block Tricks
Stupid Index Block Trickshannonhill
 
Scala with mongodb
Scala with mongodbScala with mongodb
Scala with mongodbKnoldus Inc.
 
PresentationofINTERship.pdf
PresentationofINTERship.pdfPresentationofINTERship.pdf
PresentationofINTERship.pdfgoldy810082
 
WordCamp NYC - DRY CSS
WordCamp NYC - DRY CSSWordCamp NYC - DRY CSS
WordCamp NYC - DRY CSSJer 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 basehdhappy001
 
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 todayadeveria
 
Getting Started With CSS
Getting Started With CSSGetting Started With CSS
Getting Started With CSSTrisha Crowley
 
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 2017Matthew 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

INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 
welding defects observed during the welding
welding defects observed during the weldingwelding defects observed during the welding
welding defects observed during the weldingMuhammadUzairLiaqat
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
Transport layer issues and challenges - Guide
Transport layer issues and challenges - GuideTransport layer issues and challenges - Guide
Transport layer issues and challenges - GuideGOPINATHS437943
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
Vishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsVishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsSachinPawar510423
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
computer application and construction management
computer application and construction managementcomputer application and construction management
computer application and construction managementMariconPadriquez1
 
Piping Basic stress analysis by engineering
Piping Basic stress analysis by engineeringPiping Basic stress analysis by engineering
Piping Basic stress analysis by engineeringJuanCarlosMorales19600
 
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitterShivangiSharma879191
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substationstephanwindworld
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Class 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm SystemClass 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm Systemirfanmechengr
 

Recently uploaded (20)

INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 
welding defects observed during the welding
welding defects observed during the weldingwelding defects observed during the welding
welding defects observed during the welding
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
Transport layer issues and challenges - Guide
Transport layer issues and challenges - GuideTransport layer issues and challenges - Guide
Transport layer issues and challenges - Guide
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
Vishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsVishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documents
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
computer application and construction management
computer application and construction managementcomputer application and construction management
computer application and construction management
 
Piping Basic stress analysis by engineering
Piping Basic stress analysis by engineeringPiping Basic stress analysis by engineering
Piping Basic stress analysis by engineering
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substation
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Class 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm SystemClass 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm System
 

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