SlideShare a Scribd company logo
1 of 9
CSS Style Guide
Presented by :
Andrew Mykhalchuk
Front-end Developer
Direct Wines
Direct Wines
Now… Let’s talk about
2
Stylesheets and modules structure
Direct Wines
SUGGESTED
STRUCTURE
One common stylesheet for all brands. Includes all essential modules
4
header.scss
nav.scss
footer.scss
global.scss
bootstrap.scss
font_awesome.scss
Direct Wines
SUGGESTED
STRUCTURE
One common stylesheet for all brands. Includes all essential modules
5
buttons.scss
brand.scss
variables.scss
global.scss
fonts.scss
Direct Wines
account.css
HTML OUTPUT
Link these files to each page
6
brand.css
This compiled css will include all brand specific
and global css for general styling (utilities,
header, footer, nav, etc.) and will be used on all
pages.
This compiled css file will include all page
specific modules (account, registration,
product, etc.) and will be used only on that
particular page.
Direct Wines 7
Now… Let’s talk about
NAMING
CONVENTIONS
Direct Wines
WHAT CAN WE DO
8
Use dashes in css No camel casing
Use underscore for file
names
No underscores
Use higher specificity
selectors to override rules
No div.container
selectors
Direct Wines
SELECTORS SPECIFICITY
Specificity is calculated by counting various components of your CSS and expressing them in a form (a,b,c,d)
3
Calculating specificity
❖ Element, Pseudo Element: d = 1 – (0,0,0,1)
❖ Class, Pseudo class, Attribute: c = 1 –
(0,0,1,0)
❖ Id: b = 1 – (0,1,0,0)
❖ Inline Style: a = 1 – (1,0,0,0)
Direct Wines 3
Sylesheet Page Template
brand_homepage.scss Home homepage_template_responsive.jsp
us_registration.scss Log in/Registration registration_template.jsp
About Us aboutus_template.jsp
us_customerservice.scss Customer Service customerservice_template.jsp
brand_cmlp.scss Latest Offers cm_template.jsp
Wine Clubs walkup_template.jsp
us_offer_list.scss Our Top Picks offerlist_template_responsive.jsp
us_search_results.scss Search base_template.jsp
us_product.scss Product product_template_responsive.jsp
us_checkout.scss Checkout shoppingcart_template.jsp
Your Guide about_wine.jsp
us_account.scss Account responsive_template.jsp

More Related Content

Similar to CSS Style Guide Structure Modules Naming Conventions

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
 
Vskills certified css designer Notes
Vskills certified css designer NotesVskills certified css designer Notes
Vskills certified css designer NotesVskills
 
Creating Style Guides with Modularity in Mind
Creating Style Guides with Modularity in MindCreating Style Guides with Modularity in Mind
Creating Style Guides with Modularity in MindNadya Rodionenko
 
GTU Web Designing Interview Questions And Answers for freshers
GTU Web Designing Interview Questions And Answers for freshersGTU Web Designing Interview Questions And Answers for freshers
GTU Web Designing Interview Questions And Answers for freshersTOPS Technologies
 
Css Founder.com | Cssfounder se
Css Founder.com | Cssfounder seCss Founder.com | Cssfounder se
Css Founder.com | Cssfounder seCss Founder
 
Intermediate Web Design
Intermediate Web DesignIntermediate Web Design
Intermediate Web Designmlincol2
 
Component Driven Design and Development
Component Driven Design and DevelopmentComponent Driven Design and Development
Component Driven Design and DevelopmentCristina Chumillas
 
Chapter 3 - CSS.pdf
Chapter 3 - CSS.pdfChapter 3 - CSS.pdf
Chapter 3 - CSS.pdfwubiederebe1
 
Intermediate Web Design.doc
Intermediate Web Design.docIntermediate Web Design.doc
Intermediate Web Design.docbutest
 
Intermediate Web Design.doc
Intermediate Web Design.docIntermediate Web Design.doc
Intermediate Web Design.docbutest
 
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
 
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
 
Improving your responsive workflow with style guides
Improving your responsive workflow with style guidesImproving your responsive workflow with style guides
Improving your responsive workflow with style guidesLuke Brooker
 
Intro to CSS in MadCap Flare - MadWorld 2016, Scott DeLoach, ClickStart
Intro to CSS in MadCap Flare - MadWorld 2016, Scott DeLoach, ClickStartIntro to CSS in MadCap Flare - MadWorld 2016, Scott DeLoach, ClickStart
Intro to CSS in MadCap Flare - MadWorld 2016, Scott DeLoach, ClickStartScott DeLoach
 
April 2016 - MiniCamp Atlanta - SMACSS - Preparing Drupal 8 CSS Organization
April 2016 - MiniCamp Atlanta - SMACSS - Preparing Drupal 8 CSS OrganizationApril 2016 - MiniCamp Atlanta - SMACSS - Preparing Drupal 8 CSS Organization
April 2016 - MiniCamp Atlanta - SMACSS - Preparing Drupal 8 CSS OrganizationEric Sembrat
 
Upstate CSCI 450 WebDev Chapter 3
Upstate CSCI 450 WebDev Chapter 3Upstate CSCI 450 WebDev Chapter 3
Upstate CSCI 450 WebDev Chapter 3DanWooster1
 
Css week11 2020 2021 for g10 by eng.osama ghandour
Css week11 2020 2021 for g10 by eng.osama ghandourCss week11 2020 2021 for g10 by eng.osama ghandour
Css week11 2020 2021 for g10 by eng.osama ghandourOsama Ghandour Geris
 

Similar to CSS Style Guide Structure Modules Naming Conventions (20)

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
 
Vskills certified css designer Notes
Vskills certified css designer NotesVskills certified css designer Notes
Vskills certified css designer Notes
 
HTML CSS & Javascript
HTML CSS & JavascriptHTML CSS & Javascript
HTML CSS & Javascript
 
Creating Style Guides with Modularity in Mind
Creating Style Guides with Modularity in MindCreating Style Guides with Modularity in Mind
Creating Style Guides with Modularity in Mind
 
Team styles
Team stylesTeam styles
Team styles
 
GTU Web Designing Interview Questions And Answers for freshers
GTU Web Designing Interview Questions And Answers for freshersGTU Web Designing Interview Questions And Answers for freshers
GTU Web Designing Interview Questions And Answers for freshers
 
Css Founder.com | Cssfounder se
Css Founder.com | Cssfounder seCss Founder.com | Cssfounder se
Css Founder.com | Cssfounder se
 
Intermediate Web Design
Intermediate Web DesignIntermediate Web Design
Intermediate Web Design
 
Component Driven Design and Development
Component Driven Design and DevelopmentComponent Driven Design and Development
Component Driven Design and Development
 
Chapter 3 - CSS.pdf
Chapter 3 - CSS.pdfChapter 3 - CSS.pdf
Chapter 3 - CSS.pdf
 
Intermediate Web Design.doc
Intermediate Web Design.docIntermediate Web Design.doc
Intermediate Web Design.doc
 
Intermediate Web Design.doc
Intermediate Web Design.docIntermediate Web Design.doc
Intermediate Web Design.doc
 
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
 
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
 
Improving your responsive workflow with style guides
Improving your responsive workflow with style guidesImproving your responsive workflow with style guides
Improving your responsive workflow with style guides
 
Intro to CSS in MadCap Flare - MadWorld 2016, Scott DeLoach, ClickStart
Intro to CSS in MadCap Flare - MadWorld 2016, Scott DeLoach, ClickStartIntro to CSS in MadCap Flare - MadWorld 2016, Scott DeLoach, ClickStart
Intro to CSS in MadCap Flare - MadWorld 2016, Scott DeLoach, ClickStart
 
Thuray css3
Thuray css3Thuray css3
Thuray css3
 
April 2016 - MiniCamp Atlanta - SMACSS - Preparing Drupal 8 CSS Organization
April 2016 - MiniCamp Atlanta - SMACSS - Preparing Drupal 8 CSS OrganizationApril 2016 - MiniCamp Atlanta - SMACSS - Preparing Drupal 8 CSS Organization
April 2016 - MiniCamp Atlanta - SMACSS - Preparing Drupal 8 CSS Organization
 
Upstate CSCI 450 WebDev Chapter 3
Upstate CSCI 450 WebDev Chapter 3Upstate CSCI 450 WebDev Chapter 3
Upstate CSCI 450 WebDev Chapter 3
 
Css week11 2020 2021 for g10 by eng.osama ghandour
Css week11 2020 2021 for g10 by eng.osama ghandourCss week11 2020 2021 for g10 by eng.osama ghandour
Css week11 2020 2021 for g10 by eng.osama ghandour
 

CSS Style Guide Structure Modules Naming Conventions

  • 1. CSS Style Guide Presented by : Andrew Mykhalchuk Front-end Developer Direct Wines
  • 2. Direct Wines Now… Let’s talk about 2 Stylesheets and modules structure
  • 3. Direct Wines SUGGESTED STRUCTURE One common stylesheet for all brands. Includes all essential modules 4 header.scss nav.scss footer.scss global.scss bootstrap.scss font_awesome.scss
  • 4. Direct Wines SUGGESTED STRUCTURE One common stylesheet for all brands. Includes all essential modules 5 buttons.scss brand.scss variables.scss global.scss fonts.scss
  • 5. Direct Wines account.css HTML OUTPUT Link these files to each page 6 brand.css This compiled css will include all brand specific and global css for general styling (utilities, header, footer, nav, etc.) and will be used on all pages. This compiled css file will include all page specific modules (account, registration, product, etc.) and will be used only on that particular page.
  • 6. Direct Wines 7 Now… Let’s talk about NAMING CONVENTIONS
  • 7. Direct Wines WHAT CAN WE DO 8 Use dashes in css No camel casing Use underscore for file names No underscores Use higher specificity selectors to override rules No div.container selectors
  • 8. Direct Wines SELECTORS SPECIFICITY Specificity is calculated by counting various components of your CSS and expressing them in a form (a,b,c,d) 3 Calculating specificity ❖ Element, Pseudo Element: d = 1 – (0,0,0,1) ❖ Class, Pseudo class, Attribute: c = 1 – (0,0,1,0) ❖ Id: b = 1 – (0,1,0,0) ❖ Inline Style: a = 1 – (1,0,0,0)
  • 9. Direct Wines 3 Sylesheet Page Template brand_homepage.scss Home homepage_template_responsive.jsp us_registration.scss Log in/Registration registration_template.jsp About Us aboutus_template.jsp us_customerservice.scss Customer Service customerservice_template.jsp brand_cmlp.scss Latest Offers cm_template.jsp Wine Clubs walkup_template.jsp us_offer_list.scss Our Top Picks offerlist_template_responsive.jsp us_search_results.scss Search base_template.jsp us_product.scss Product product_template_responsive.jsp us_checkout.scss Checkout shoppingcart_template.jsp Your Guide about_wine.jsp us_account.scss Account responsive_template.jsp