SlideShare a Scribd company logo
1 of 26
Download to read offline
CSS Workflow
pre & post processing
• In General
• CSS pre-processing (with SASS)
• CSS post-processing (with PostCSS)
CSS Workflow
CSS Workflow
css browser
you're
here
When you build a house, would you want to use a
hammer, a hand saw, and some nails, or would
you rather use a power drill, a miter saw, and
some screws?
CSS itself is pretty dumb.
You target bits of your document with selectors, and
you style them with properties. That's pretty much
it.
Little Silly Demo 1
small_example.scss
Little Silly Demo 2
Show them compiled bootstrap grid.
Introducing CSS Preprocessors.
css browser
you're
here
pre -
css
compile
• Clever automations.
• Re-use across projects. Introduce Mixins.
• Variables can be tweaked in one place, having
huge impact on the application CSS as a whole.
• More structural and modular CSS.
• They make you work smarter.
Introducing CSS Preprocessors.
Why?
SASS vs LESS vs STYLUS
???
great link 1
great link 2
.scss vs .sass
???
great link 3
$blue: #3bbfce
$margin: 16px
.content-navigation
border-color: $blue
color: darken($blue, 9%)
.border
padding: $margin / 2
margin: $margin / 2
border-color: $blue
$blue: #3bbfce;
$margin: 16px;
.content-navigation {
border-color: $blue;
color: darken($blue, 9%);
}
.border {
padding: $margin / 2;
margin: $margin / 2;
border-color: $blue;
}
.scss .sass
1. Partials
2. Variables
3. Nesting Selectors
4. Inheriting (or Extending) Properties
5. Mixins
6. A lot more: sass-lang.com
Discovering SASS
1. Partials
sass/
|
|-- helpers/
| |-- _variables.scss
| |-- _mixins.scss
|
|-- base/
| |-- _reset.scss
| |-- _grid.scss
| |-- _typography.scss
|
|-- layout/
| |-- _header.scss
| |-- _footer.scss
| |-- _sidebar.scss
| |-- _forms.scss
|
|-- components/
| |-- _buttons.scss
| |-- _dropdown.scss
| |-- _navigation.scss
|
|- styles.scss
1. Partials
// styles.scss
@import 'helpers/variables';
@import 'helpers/mixins';
@import 'base/reset';
@import 'base/grid';
@import 'base/typography';
@import 'layout/header';
@import 'layout/footer';
@import 'layout/sidebar';
@import 'layout/forms';
@import 'components/buttons';
@import 'components/dropdown';
@import 'components/navigation';
For more ways to organize your Sass projects, check out these blog posts:
• www.sitepoint.com/architecture-sass-project/
• www.thesassway.com/beginner/how-to-structure-a-sass-project
• www.sitepoint.com/look-different-sass-architectures/
2. Variables
$logo_color : #083B91;
h1 {
color: $logo_color;
}
// variables.scss
// fonts
$font-serif: 'PF Regal Text Pro', Georgia, 'Times New Roman', Times, serif;
$font-sans: 'Proxima Nova', sans-serif;
$base-font-size: 14px;
$header-font-size: $base-font-size * 2;
// color
$white: #fff;
$light-gray: #e6e6e6;
$medium-gray: #b3b3b3;
$dark-gray: #262626;
$primary: #b88b58;
More on SASS MATH:
• https://scotch.io/tutorials/getting-started-with-sass#math,
• https://css-tricks.com/video-screencasts/132-quick-useful-case-sass-math-mixins/
• http://sass-lang.com/documentation/file.SASS_REFERENCE.html#operations
3. Nesting Selectors
.nav {
display: flex;
justify-content: space-around;
list-style-type: none;
li {
width: 30%;
background-color: #FFEED5;
padding: 5px;
text-align: center;
}
a {

text-decoration: none;
}
}
.nav {
display: flex;
justify-content: space-around;
list-style-type: none;
}

.nav li {
width: 30%;
background-color: #FFEED5;
padding: 5px;
text-align: center;
}

.nav a {
text-decoration: none;
}
.css .scss
3. Nesting Selectors
a {

color: blue;
&:hover {
color: green;
}
}
a {
color: blue;
}
a:hover {
color: green;
}
.css .scss
4. Extending
// sass
.class1 {
padding: 16px 8px;
border: 1px solid gray;
color: red;
}
.class2 {
@extend .class1;
color: green;
}
// output: https://gist.github.com/Dosant/eb6d30125d706e466f36fd568e0f19bd
5. Mixins
// sass
@mixin sexy-line-under{
border-bottom: 1px dashed #ffc0cb;
}
.some-element {
@include sexy-line-under;
}
////// or with arguments:
@mixin sexy-line-under($color){
border-bottom: 1px dashed $color;
}
.some-element {
@include sexy-line-under(#ffc0cb);
}
// output: https://gist.github.com/Dosant/4beaf156202d32b50f0ee8d2d97540d4
Demo
New Css Workflow
css browser
you're
here
sass
sass
compiler
Introduce Super CSS
css
super
css
you're
here
sass
sass
compiler
browser
• improve
• analize
• lint
compile
PostCSS
• PostCSS — just a JavaScript tool to read and
transform you css.
• PostCSS plugins — all the deal.
www.postcss.parts
• You can write your own plugin to transform ||
analize your css.
More on PostCSS
• https://github.com/postcss/postcss
• http://julian.io/some-things-you-may-think-about-postcss-and-you-might-be-wrong/
• https://habrahabr.ru/post/265449/
• https://medium.com/@svilen/getting-started-with-postcss-a-quick-guide-for-sass-
users-90c8b675d5f4#.a3chjrpgp
Demo
postCSS/autoprefixer
postCSS/doiuse
CSS Workflow
css
super
css
you're
here
sass
sass
compiler
browser
• improve
• analize
• lint
PostCSS
compile

More Related Content

What's hot

SC5 Style Guide Generator
SC5 Style Guide GeneratorSC5 Style Guide Generator
SC5 Style Guide Generator
Varya Stepanova
 
Drupal Theming with CSS Frameworks (960grid)
Drupal Theming with CSS Frameworks (960grid)Drupal Theming with CSS Frameworks (960grid)
Drupal Theming with CSS Frameworks (960grid)
Ryan Cross
 
Who is she in tunis advanced webmaster administration session
Who is she in tunis   advanced webmaster administration sessionWho is she in tunis   advanced webmaster administration session
Who is she in tunis advanced webmaster administration session
Michael Bryder
 

What's hot (20)

Tech talk on Tailwind CSS
Tech talk on Tailwind CSSTech talk on Tailwind CSS
Tech talk on Tailwind CSS
 
CSS Custom Properties (aka CSS Variable)
CSS Custom Properties (aka CSS Variable)CSS Custom Properties (aka CSS Variable)
CSS Custom Properties (aka CSS Variable)
 
A modern front end development workflow for Magnolia at Atlassian
A modern front end development workflow for Magnolia at AtlassianA modern front end development workflow for Magnolia at Atlassian
A modern front end development workflow for Magnolia at Atlassian
 
Create SASSy web parts in SPFx
Create SASSy web parts in SPFxCreate SASSy web parts in SPFx
Create SASSy web parts in SPFx
 
Front End Development - Beyond Javascript (Robin Cannon)
Front End Development - Beyond Javascript (Robin Cannon)Front End Development - Beyond Javascript (Robin Cannon)
Front End Development - Beyond Javascript (Robin Cannon)
 
SC5 Style Guide Generator
SC5 Style Guide GeneratorSC5 Style Guide Generator
SC5 Style Guide Generator
 
Advanced sass/compass
Advanced sass/compassAdvanced sass/compass
Advanced sass/compass
 
Smarter Grids with Sass and Susy
Smarter Grids with Sass and SusySmarter Grids with Sass and Susy
Smarter Grids with Sass and Susy
 
Drupal Theming with CSS Frameworks (960grid)
Drupal Theming with CSS Frameworks (960grid)Drupal Theming with CSS Frameworks (960grid)
Drupal Theming with CSS Frameworks (960grid)
 
Syntactically awesome stylesheets (Sass)
Syntactically awesome stylesheets (Sass)Syntactically awesome stylesheets (Sass)
Syntactically awesome stylesheets (Sass)
 
Tailwind CSS - KanpurJS
Tailwind CSS - KanpurJSTailwind CSS - KanpurJS
Tailwind CSS - KanpurJS
 
A Rubyist Tries AngularJS
A Rubyist Tries AngularJSA Rubyist Tries AngularJS
A Rubyist Tries AngularJS
 
Responsive web design
Responsive web designResponsive web design
Responsive web design
 
Making Your Own CSS Framework
Making Your Own CSS FrameworkMaking Your Own CSS Framework
Making Your Own CSS Framework
 
Diving into the deep end: SVG, Angular and Accessibility
Diving into the deep end: SVG, Angular and AccessibilityDiving into the deep end: SVG, Angular and Accessibility
Diving into the deep end: SVG, Angular and Accessibility
 
Meet the grids - Web design using Grids
Meet the grids - Web design using GridsMeet the grids - Web design using Grids
Meet the grids - Web design using Grids
 
Custom Properties: Long Llive CSS!
Custom Properties: Long Llive CSS!Custom Properties: Long Llive CSS!
Custom Properties: Long Llive CSS!
 
Write LESS. DO more.
Write LESS. DO more.Write LESS. DO more.
Write LESS. DO more.
 
Who is she in tunis advanced webmaster administration session
Who is she in tunis   advanced webmaster administration sessionWho is she in tunis   advanced webmaster administration session
Who is she in tunis advanced webmaster administration session
 
Compass n Sass
Compass n SassCompass n Sass
Compass n Sass
 

Similar to CSS Workflow. Pre & Post

SASS is more than LESS
SASS is more than LESSSASS is more than LESS
SASS is more than LESS
Itai Koren
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Erin M. Kidwell
 

Similar to CSS Workflow. Pre & Post (20)

SPS Oslo - Stop your SharePoint CSS becoming a di-sass-ter today!
SPS Oslo - Stop your SharePoint CSS becoming a di-sass-ter today!SPS Oslo - Stop your SharePoint CSS becoming a di-sass-ter today!
SPS Oslo - Stop your SharePoint CSS becoming a di-sass-ter today!
 
Responsive Design in Drupal with Zen and Zen Grids
Responsive Design in Drupal with Zen and Zen GridsResponsive Design in Drupal with Zen and Zen Grids
Responsive Design in Drupal with Zen and Zen Grids
 
[Bauer] SASSy web parts with SPFX
[Bauer] SASSy web parts with SPFX[Bauer] SASSy web parts with SPFX
[Bauer] SASSy web parts with SPFX
 
SASS is more than LESS
SASS is more than LESSSASS is more than LESS
SASS is more than LESS
 
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
 
Create SASSY Web Parts - SPSMilan
Create SASSY Web Parts - SPSMilan Create SASSY Web Parts - SPSMilan
Create SASSY Web Parts - SPSMilan
 
UNIT 3.ppt
UNIT 3.pptUNIT 3.ppt
UNIT 3.ppt
 
Css framework
Css frameworkCss framework
Css framework
 
Css framework
Css frameworkCss framework
Css framework
 
SCSS Implementation
SCSS ImplementationSCSS Implementation
SCSS Implementation
 
SASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockSASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, Greensock
 
CSS3
CSS3CSS3
CSS3
 
Modern Front-End Development
Modern Front-End DevelopmentModern Front-End Development
Modern Front-End Development
 
Team styles
Team stylesTeam styles
Team styles
 
From CSS to Sass in WordPress
From CSS to Sass in WordPressFrom CSS to Sass in WordPress
From CSS to Sass in WordPress
 
Stop your share point css become a di-sass-ter today - SPS Munich
Stop your share point css become a di-sass-ter today - SPS MunichStop your share point css become a di-sass-ter today - SPS Munich
Stop your share point css become a di-sass-ter today - SPS Munich
 
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
 
Beautifying senc
Beautifying sencBeautifying senc
Beautifying senc
 
Beautifying Sencha Touch
Beautifying Sencha TouchBeautifying Sencha Touch
Beautifying Sencha Touch
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
 

Recently uploaded

如何办理(UCI毕业证书)加利福尼亚大学尔湾分校毕业证成绩单本科硕士学位证留信学历认证
如何办理(UCI毕业证书)加利福尼亚大学尔湾分校毕业证成绩单本科硕士学位证留信学历认证如何办理(UCI毕业证书)加利福尼亚大学尔湾分校毕业证成绩单本科硕士学位证留信学历认证
如何办理(UCI毕业证书)加利福尼亚大学尔湾分校毕业证成绩单本科硕士学位证留信学历认证
ugzga
 
ECHOES OF GENIUS - A Tribute to Nari Gandhi's Architectural Legacy. .pdf
ECHOES OF GENIUS - A Tribute to Nari Gandhi's Architectural Legacy. .pdfECHOES OF GENIUS - A Tribute to Nari Gandhi's Architectural Legacy. .pdf
ECHOES OF GENIUS - A Tribute to Nari Gandhi's Architectural Legacy. .pdf
Sarbjit Bahga
 
Week 11 Mini-Tasks.pptxjjjjjjjjjjjjjjjjjjjj
Week 11 Mini-Tasks.pptxjjjjjjjjjjjjjjjjjjjjWeek 11 Mini-Tasks.pptxjjjjjjjjjjjjjjjjjjjj
Week 11 Mini-Tasks.pptxjjjjjjjjjjjjjjjjjjjj
joshuaclack73
 
Evaluating natural frequencies and mode shapes.pptx
Evaluating natural frequencies and mode shapes.pptxEvaluating natural frequencies and mode shapes.pptx
Evaluating natural frequencies and mode shapes.pptx
joshuaclack73
 
Resume all my skills and educations and achievement
Resume all my skills and educations and  achievement Resume all my skills and educations and  achievement
Resume all my skills and educations and achievement
210303105569
 
NO1 Best Best Black Magic Specialist Near Me Spiritual Healer Powerful Love S...
NO1 Best Best Black Magic Specialist Near Me Spiritual Healer Powerful Love S...NO1 Best Best Black Magic Specialist Near Me Spiritual Healer Powerful Love S...
NO1 Best Best Black Magic Specialist Near Me Spiritual Healer Powerful Love S...
Amil baba
 
如何办理(ArtEZ毕业证书)ArtEZ艺术学院毕业证成绩单本科硕士学位证留信学历认证
如何办理(ArtEZ毕业证书)ArtEZ艺术学院毕业证成绩单本科硕士学位证留信学历认证如何办理(ArtEZ毕业证书)ArtEZ艺术学院毕业证成绩单本科硕士学位证留信学历认证
如何办理(ArtEZ毕业证书)ArtEZ艺术学院毕业证成绩单本科硕士学位证留信学历认证
ugzga
 
如何办理(Columbia College毕业证书)纽约市哥伦比亚大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(Columbia College毕业证书)纽约市哥伦比亚大学毕业证成绩单本科硕士学位证留信学历认证如何办理(Columbia College毕业证书)纽约市哥伦比亚大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(Columbia College毕业证书)纽约市哥伦比亚大学毕业证成绩单本科硕士学位证留信学历认证
ugzga
 
Abortion Clinic in Springs +27791653574 Springs WhatsApp Abortion Clinic Serv...
Abortion Clinic in Springs +27791653574 Springs WhatsApp Abortion Clinic Serv...Abortion Clinic in Springs +27791653574 Springs WhatsApp Abortion Clinic Serv...
Abortion Clinic in Springs +27791653574 Springs WhatsApp Abortion Clinic Serv...
mikehavy0
 
挂科办理天主教大学毕业证成绩单一模一样品质
挂科办理天主教大学毕业证成绩单一模一样品质挂科办理天主教大学毕业证成绩单一模一样品质
挂科办理天主教大学毕业证成绩单一模一样品质
yzeoq
 

Recently uploaded (20)

如何办理(UCI毕业证书)加利福尼亚大学尔湾分校毕业证成绩单本科硕士学位证留信学历认证
如何办理(UCI毕业证书)加利福尼亚大学尔湾分校毕业证成绩单本科硕士学位证留信学历认证如何办理(UCI毕业证书)加利福尼亚大学尔湾分校毕业证成绩单本科硕士学位证留信学历认证
如何办理(UCI毕业证书)加利福尼亚大学尔湾分校毕业证成绩单本科硕士学位证留信学历认证
 
Spring Summer 2026 Inspirations trend book Peclers Paris
Spring Summer 2026 Inspirations trend book Peclers ParisSpring Summer 2026 Inspirations trend book Peclers Paris
Spring Summer 2026 Inspirations trend book Peclers Paris
 
ECHOES OF GENIUS - A Tribute to Nari Gandhi's Architectural Legacy. .pdf
ECHOES OF GENIUS - A Tribute to Nari Gandhi's Architectural Legacy. .pdfECHOES OF GENIUS - A Tribute to Nari Gandhi's Architectural Legacy. .pdf
ECHOES OF GENIUS - A Tribute to Nari Gandhi's Architectural Legacy. .pdf
 
CADD 141 - Puzzle Cube Project - Product Photos
CADD 141 - Puzzle Cube Project - Product PhotosCADD 141 - Puzzle Cube Project - Product Photos
CADD 141 - Puzzle Cube Project - Product Photos
 
Spring Summer 26 Colors Trend Book Peclers Paris
Spring Summer 26 Colors Trend Book Peclers ParisSpring Summer 26 Colors Trend Book Peclers Paris
Spring Summer 26 Colors Trend Book Peclers Paris
 
Week 11 Mini-Tasks.pptxjjjjjjjjjjjjjjjjjjjj
Week 11 Mini-Tasks.pptxjjjjjjjjjjjjjjjjjjjjWeek 11 Mini-Tasks.pptxjjjjjjjjjjjjjjjjjjjj
Week 11 Mini-Tasks.pptxjjjjjjjjjjjjjjjjjjjj
 
The concept of motion graphics and its applications.
The concept of motion graphics and its applications.The concept of motion graphics and its applications.
The concept of motion graphics and its applications.
 
Bit Dhrumi shah Graphic Designer portfolio
Bit Dhrumi shah Graphic Designer portfolioBit Dhrumi shah Graphic Designer portfolio
Bit Dhrumi shah Graphic Designer portfolio
 
Morgenbooster: Storytelling in Identity Design
Morgenbooster: Storytelling in Identity DesignMorgenbooster: Storytelling in Identity Design
Morgenbooster: Storytelling in Identity Design
 
Evaluating natural frequencies and mode shapes.pptx
Evaluating natural frequencies and mode shapes.pptxEvaluating natural frequencies and mode shapes.pptx
Evaluating natural frequencies and mode shapes.pptx
 
Resume all my skills and educations and achievement
Resume all my skills and educations and  achievement Resume all my skills and educations and  achievement
Resume all my skills and educations and achievement
 
CADD 141 - BIRD Scooter - Cup Holder Photos.pdf
CADD 141 - BIRD Scooter - Cup Holder Photos.pdfCADD 141 - BIRD Scooter - Cup Holder Photos.pdf
CADD 141 - BIRD Scooter - Cup Holder Photos.pdf
 
NO1 Best Best Black Magic Specialist Near Me Spiritual Healer Powerful Love S...
NO1 Best Best Black Magic Specialist Near Me Spiritual Healer Powerful Love S...NO1 Best Best Black Magic Specialist Near Me Spiritual Healer Powerful Love S...
NO1 Best Best Black Magic Specialist Near Me Spiritual Healer Powerful Love S...
 
如何办理(ArtEZ毕业证书)ArtEZ艺术学院毕业证成绩单本科硕士学位证留信学历认证
如何办理(ArtEZ毕业证书)ArtEZ艺术学院毕业证成绩单本科硕士学位证留信学历认证如何办理(ArtEZ毕业证书)ArtEZ艺术学院毕业证成绩单本科硕士学位证留信学历认证
如何办理(ArtEZ毕业证书)ArtEZ艺术学院毕业证成绩单本科硕士学位证留信学历认证
 
Naer VR: Advanced Research and Usability Testing Project
Naer VR: Advanced Research and Usability Testing ProjectNaer VR: Advanced Research and Usability Testing Project
Naer VR: Advanced Research and Usability Testing Project
 
Game Pitch- Heroes of Niflheim (a mobile game).pdf
Game Pitch- Heroes of Niflheim (a mobile game).pdfGame Pitch- Heroes of Niflheim (a mobile game).pdf
Game Pitch- Heroes of Niflheim (a mobile game).pdf
 
如何办理(Columbia College毕业证书)纽约市哥伦比亚大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(Columbia College毕业证书)纽约市哥伦比亚大学毕业证成绩单本科硕士学位证留信学历认证如何办理(Columbia College毕业证书)纽约市哥伦比亚大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(Columbia College毕业证书)纽约市哥伦比亚大学毕业证成绩单本科硕士学位证留信学历认证
 
Abortion Clinic in Springs +27791653574 Springs WhatsApp Abortion Clinic Serv...
Abortion Clinic in Springs +27791653574 Springs WhatsApp Abortion Clinic Serv...Abortion Clinic in Springs +27791653574 Springs WhatsApp Abortion Clinic Serv...
Abortion Clinic in Springs +27791653574 Springs WhatsApp Abortion Clinic Serv...
 
Top 10 Website Designing Hacks for Beginners.pptx.pptx
Top 10 Website Designing Hacks for Beginners.pptx.pptxTop 10 Website Designing Hacks for Beginners.pptx.pptx
Top 10 Website Designing Hacks for Beginners.pptx.pptx
 
挂科办理天主教大学毕业证成绩单一模一样品质
挂科办理天主教大学毕业证成绩单一模一样品质挂科办理天主教大学毕业证成绩单一模一样品质
挂科办理天主教大学毕业证成绩单一模一样品质
 

CSS Workflow. Pre & Post

  • 1. CSS Workflow pre & post processing
  • 2. • In General • CSS pre-processing (with SASS) • CSS post-processing (with PostCSS) CSS Workflow
  • 4. When you build a house, would you want to use a hammer, a hand saw, and some nails, or would you rather use a power drill, a miter saw, and some screws?
  • 5. CSS itself is pretty dumb. You target bits of your document with selectors, and you style them with properties. That's pretty much it.
  • 6. Little Silly Demo 1 small_example.scss
  • 7. Little Silly Demo 2 Show them compiled bootstrap grid.
  • 8. Introducing CSS Preprocessors. css browser you're here pre - css compile
  • 9. • Clever automations. • Re-use across projects. Introduce Mixins. • Variables can be tweaked in one place, having huge impact on the application CSS as a whole. • More structural and modular CSS. • They make you work smarter. Introducing CSS Preprocessors. Why?
  • 10. SASS vs LESS vs STYLUS ??? great link 1 great link 2
  • 12. $blue: #3bbfce $margin: 16px .content-navigation border-color: $blue color: darken($blue, 9%) .border padding: $margin / 2 margin: $margin / 2 border-color: $blue $blue: #3bbfce; $margin: 16px; .content-navigation { border-color: $blue; color: darken($blue, 9%); } .border { padding: $margin / 2; margin: $margin / 2; border-color: $blue; } .scss .sass
  • 13. 1. Partials 2. Variables 3. Nesting Selectors 4. Inheriting (or Extending) Properties 5. Mixins 6. A lot more: sass-lang.com Discovering SASS
  • 14. 1. Partials sass/ | |-- helpers/ | |-- _variables.scss | |-- _mixins.scss | |-- base/ | |-- _reset.scss | |-- _grid.scss | |-- _typography.scss | |-- layout/ | |-- _header.scss | |-- _footer.scss | |-- _sidebar.scss | |-- _forms.scss | |-- components/ | |-- _buttons.scss | |-- _dropdown.scss | |-- _navigation.scss | |- styles.scss
  • 15. 1. Partials // styles.scss @import 'helpers/variables'; @import 'helpers/mixins'; @import 'base/reset'; @import 'base/grid'; @import 'base/typography'; @import 'layout/header'; @import 'layout/footer'; @import 'layout/sidebar'; @import 'layout/forms'; @import 'components/buttons'; @import 'components/dropdown'; @import 'components/navigation'; For more ways to organize your Sass projects, check out these blog posts: • www.sitepoint.com/architecture-sass-project/ • www.thesassway.com/beginner/how-to-structure-a-sass-project • www.sitepoint.com/look-different-sass-architectures/
  • 16. 2. Variables $logo_color : #083B91; h1 { color: $logo_color; } // variables.scss // fonts $font-serif: 'PF Regal Text Pro', Georgia, 'Times New Roman', Times, serif; $font-sans: 'Proxima Nova', sans-serif; $base-font-size: 14px; $header-font-size: $base-font-size * 2; // color $white: #fff; $light-gray: #e6e6e6; $medium-gray: #b3b3b3; $dark-gray: #262626; $primary: #b88b58; More on SASS MATH: • https://scotch.io/tutorials/getting-started-with-sass#math, • https://css-tricks.com/video-screencasts/132-quick-useful-case-sass-math-mixins/ • http://sass-lang.com/documentation/file.SASS_REFERENCE.html#operations
  • 17. 3. Nesting Selectors .nav { display: flex; justify-content: space-around; list-style-type: none; li { width: 30%; background-color: #FFEED5; padding: 5px; text-align: center; } a {
 text-decoration: none; } } .nav { display: flex; justify-content: space-around; list-style-type: none; }
 .nav li { width: 30%; background-color: #FFEED5; padding: 5px; text-align: center; }
 .nav a { text-decoration: none; } .css .scss
  • 18. 3. Nesting Selectors a {
 color: blue; &:hover { color: green; } } a { color: blue; } a:hover { color: green; } .css .scss
  • 19. 4. Extending // sass .class1 { padding: 16px 8px; border: 1px solid gray; color: red; } .class2 { @extend .class1; color: green; } // output: https://gist.github.com/Dosant/eb6d30125d706e466f36fd568e0f19bd
  • 20. 5. Mixins // sass @mixin sexy-line-under{ border-bottom: 1px dashed #ffc0cb; } .some-element { @include sexy-line-under; } ////// or with arguments: @mixin sexy-line-under($color){ border-bottom: 1px dashed $color; } .some-element { @include sexy-line-under(#ffc0cb); } // output: https://gist.github.com/Dosant/4beaf156202d32b50f0ee8d2d97540d4
  • 21. Demo
  • 22. New Css Workflow css browser you're here sass sass compiler
  • 24. PostCSS • PostCSS — just a JavaScript tool to read and transform you css. • PostCSS plugins — all the deal. www.postcss.parts • You can write your own plugin to transform || analize your css. More on PostCSS • https://github.com/postcss/postcss • http://julian.io/some-things-you-may-think-about-postcss-and-you-might-be-wrong/ • https://habrahabr.ru/post/265449/ • https://medium.com/@svilen/getting-started-with-postcss-a-quick-guide-for-sass- users-90c8b675d5f4#.a3chjrpgp