SlideShare a Scribd company logo
Sass
• Syntactically Awesome Stylesheet
• Sass is a CSS pre-processor
• Look like CSS
• Sass is completely compatible with all versions of CSS
• Sass reduces repetition of CSS and therefore saves time
• Sass was designed by Hampton Catlin and developed by Natalie Weizenbaum in 2006
Why Use Sass?
• Stylesheets are getting larger, more complex, and harder to
maintain. This is where a CSS pre-processor can help.
• Sass lets you use features that do not exist in CSS, like variables,
nested rules, mixins, imports, inheritance, built-in functions, and
other stuff.
CodeKit (Paid) Mac
Compass.app (Paid, Open Source) Mac Windows Linux
Ghostlab (Paid) Mac Windows
Hammer (Paid) Mac
Koala (Open Source) Mac Windows Linux
LiveReload (Paid, Open Source) Mac Windows
Prepros (Paid) Mac Windows Linux
Scout-App (Free, Open Source) Windows Linux Mac
When you install Sass on the command line, you'll
be able to run the sass executable to compile .sass
and .scss files to .css files. For example:
Applications Command Line
How to Use/install Sass?
How Does Sass Work?
A browser does not understand Sass code. Therefore, you
will need a Sass pre-processor to convert Sass code into
standard CSS.
A Simple Example
Let's say we have a website with three main colors:
So, many times we type those HEX values.
Instead of typing the above values a lot of times, we can use Sass and write this:
So, when using Sass, and the primary color changes, you only need to change it in one place.
Variables
Variables as a way to store information that you want to reuse throughout your
stylesheet.
Nesting
When writing HTML you've probably noticed that it has a clear nested and visual hierarchy.
Sass will let you nest your CSS selectors in a way that follows the same visual hierarchy of your HTML.
Partials
You can create partial Sass files that contain little snippets of CSS
that you can include in other Sass files. This is a great way to
modularize your CSS and help keep things easier to maintain. A
partial is a Sass file named with a leading underscore. You might
name it something like _partial.scss. The underscore lets Sass know
that the file is only a partial file and that it should not be generated
into a CSS file. Sass partials are used with the @use rule.
Modules
You don't have to write all your Sass in a single file. You can split it up however you want with the @use rule. This
rule loads another Sass file as a moduleUsing a file will also include the CSS it generates in your compiled output!
Notice we're using @use 'base'; in the styles.scss file. When you use a file you don't need to include
the file extension. Sass is smart and will figure it out.
Mixins
Some things in CSS are a bit tedious to write, especially with CSS3 and the many vendor prefixes that exist. A
mixin lets you make groups of CSS declarations that you want to reuse throughout your site. You can even pass
in values to make your mixin more flexible. A good use of a mixin is for vendor prefixes. Here's an example for
transform.
Extend/Inheritance
This is one of the most useful features of Sass. Using @extend lets you share a set of CSS properties from one
selector to another.
Operators
Doing math in your CSS is very helpful. Sass has a handful of standard math operators like +, -, *, /, and %.
SASS AND MEDIA QUERIES
SASS
section.main {
float: left;
width: 65%;
font-size: 16px;
Line-height: 1.4;
@media screen and (max-width: 800px) {
float: none;
width: auto;
}
@media screen and (max-width: 500px) {
font-size: 12px;
line-height: 1.4;
}
}
CSS
section.main {
float: left;
width: 65%;
font-size: 16px;
line-height: 1.4;
}
@media screen and (max-width: 800px) {
section.main {
float: none;
width: auto;
}
}
@media screen and (max-width: 500px) {
section.main {
font-size: 12px;
line-height: 1.4;
}
}
THANK YOU!

More Related Content

PPTX
Bootstrap By Shafeeq
DignitasDigital1
 
PPTX
What is New in Bootstrap 5?
Study Section
 
PPT
Know the reason behind choosing bootstrap as css framework
Omkarsoft Bangalore
 
PPTX
Bootstrap
AvinashChunduri2
 
PPTX
Bootstrap 3
McSoftsis
 
PDF
Best Practices for Building Sites in dotCMS
Michael Fienen
 
PPTX
Multi-content Containers in dotCMS 3.0
Jason Smith
 
PPTX
Bootstrap
John Pereless
 
Bootstrap By Shafeeq
DignitasDigital1
 
What is New in Bootstrap 5?
Study Section
 
Know the reason behind choosing bootstrap as css framework
Omkarsoft Bangalore
 
Bootstrap
AvinashChunduri2
 
Bootstrap 3
McSoftsis
 
Best Practices for Building Sites in dotCMS
Michael Fienen
 
Multi-content Containers in dotCMS 3.0
Jason Smith
 
Bootstrap
John Pereless
 

What's hot (12)

PDF
Forms as Structured Content
dotCMS
 
PPT
Introduction to BOOTSTRAP
Jeanie Arnoco
 
PPTX
Wordpress Custom Post Types
Brent Williams
 
PPTX
Azure Templates for Consistent Deployment
José Maia
 
ODP
Framework
Deepan Sivasankar
 
ODP
Drupal Multi-Site Setup
ylynfatt
 
PPTX
Drupal module development
Rachit Gupta
 
PPTX
Asp folders and web configurations
baabtra.com - No. 1 supplier of quality freshers
 
PPTX
Web programming
Ishucs
 
PDF
Going Multi-Tenant with dotCMS
dotCMS
 
PPTX
Bootstrap 3.1.1
Prasad Parab
 
PPTX
Bootstrap ppt
Ishtdeep Hora
 
Forms as Structured Content
dotCMS
 
Introduction to BOOTSTRAP
Jeanie Arnoco
 
Wordpress Custom Post Types
Brent Williams
 
Azure Templates for Consistent Deployment
José Maia
 
Drupal Multi-Site Setup
ylynfatt
 
Drupal module development
Rachit Gupta
 
Asp folders and web configurations
baabtra.com - No. 1 supplier of quality freshers
 
Web programming
Ishucs
 
Going Multi-Tenant with dotCMS
dotCMS
 
Bootstrap 3.1.1
Prasad Parab
 
Bootstrap ppt
Ishtdeep Hora
 
Ad

Similar to Sass:-Syntactically Awesome Stylesheet by Shafeeq (20)

PPTX
Bliblidotcom - SASS Introduction
Irfan Maulana
 
PPTX
SCSS Implementation
Amey Parab
 
PPTX
Sass
Tayseer_Emam
 
PPT
UNIT 3.ppt
kavi806657
 
PPTX
The sass way - Yatendra Bhardwaj
Yatendra Bhardwaj
 
PPTX
SPS Oslo - Stop your SharePoint CSS becoming a di-sass-ter today!
Stefan Bauer
 
PPS
Why are we using Sass to create Grid Frameworks?
sharjeet
 
PPTX
SASS - Syntactically Awesome Stylesheet
Neha Sharma
 
PDF
Getting Sassy with CSS
Julie Cameron
 
PDF
Intro to Sass for WordPress Developers
Suzette Franck
 
PPTX
Sass_Cubet seminar
Cubet Techno Labs
 
KEY
Authoring Stylesheets with Compass & Sass
chriseppstein
 
PDF
Compass n Sass
Pradeep Saraswathi
 
PDF
The CSS Handbook
jackchenvlo
 
PPTX
Make your CSS beautiful again
spannerspace Hales
 
PPTX
intro_To_HTML_and__CSS_using_presentation.pptx
AsrithaKorupolu
 
PPT
An Introduction to CSS Preprocessors (SASS & LESS)
Folio3 Software
 
PPTX
Sass - basic to advance
Vinita Swamy
 
PDF
European SharePoint Webinar - Make SharePoint Sassy
Stefan Bauer
 
Bliblidotcom - SASS Introduction
Irfan Maulana
 
SCSS Implementation
Amey Parab
 
UNIT 3.ppt
kavi806657
 
The sass way - Yatendra Bhardwaj
Yatendra Bhardwaj
 
SPS Oslo - Stop your SharePoint CSS becoming a di-sass-ter today!
Stefan Bauer
 
Why are we using Sass to create Grid Frameworks?
sharjeet
 
SASS - Syntactically Awesome Stylesheet
Neha Sharma
 
Getting Sassy with CSS
Julie Cameron
 
Intro to Sass for WordPress Developers
Suzette Franck
 
Sass_Cubet seminar
Cubet Techno Labs
 
Authoring Stylesheets with Compass & Sass
chriseppstein
 
Compass n Sass
Pradeep Saraswathi
 
The CSS Handbook
jackchenvlo
 
Make your CSS beautiful again
spannerspace Hales
 
intro_To_HTML_and__CSS_using_presentation.pptx
AsrithaKorupolu
 
An Introduction to CSS Preprocessors (SASS & LESS)
Folio3 Software
 
Sass - basic to advance
Vinita Swamy
 
European SharePoint Webinar - Make SharePoint Sassy
Stefan Bauer
 
Ad

More from DignitasDigital1 (13)

PPTX
Ambush Marketing By Amandeep
DignitasDigital1
 
PPTX
Wireframing with balsamiq by Chandeep
DignitasDigital1
 
PPTX
10 Productive habits for working from home By Shweta
DignitasDigital1
 
PPTX
5 Principles of brand on social media during lockdown By Aman
DignitasDigital1
 
PPTX
Typography By Amit
DignitasDigital1
 
PPTX
Drip Marketing by Abhishek
DignitasDigital1
 
PPTX
7Cs for communication by Shweta
DignitasDigital1
 
PPTX
Overview of Big Data by Sunny
DignitasDigital1
 
PPTX
Flutter by Shubham
DignitasDigital1
 
PPTX
Blue Ocean strategy by Vinita
DignitasDigital1
 
PPTX
Advertising and marketing at zero cost by Jatin
DignitasDigital1
 
PPTX
Ui trends 2019 by Amit
DignitasDigital1
 
PPTX
Kubernetes by Jai
DignitasDigital1
 
Ambush Marketing By Amandeep
DignitasDigital1
 
Wireframing with balsamiq by Chandeep
DignitasDigital1
 
10 Productive habits for working from home By Shweta
DignitasDigital1
 
5 Principles of brand on social media during lockdown By Aman
DignitasDigital1
 
Typography By Amit
DignitasDigital1
 
Drip Marketing by Abhishek
DignitasDigital1
 
7Cs for communication by Shweta
DignitasDigital1
 
Overview of Big Data by Sunny
DignitasDigital1
 
Flutter by Shubham
DignitasDigital1
 
Blue Ocean strategy by Vinita
DignitasDigital1
 
Advertising and marketing at zero cost by Jatin
DignitasDigital1
 
Ui trends 2019 by Amit
DignitasDigital1
 
Kubernetes by Jai
DignitasDigital1
 

Recently uploaded (20)

PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PDF
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
PDF
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
The Future of Artificial Intelligence (AI)
Mukul
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 

Sass:-Syntactically Awesome Stylesheet by Shafeeq

  • 1. Sass • Syntactically Awesome Stylesheet • Sass is a CSS pre-processor • Look like CSS • Sass is completely compatible with all versions of CSS • Sass reduces repetition of CSS and therefore saves time • Sass was designed by Hampton Catlin and developed by Natalie Weizenbaum in 2006
  • 2. Why Use Sass? • Stylesheets are getting larger, more complex, and harder to maintain. This is where a CSS pre-processor can help. • Sass lets you use features that do not exist in CSS, like variables, nested rules, mixins, imports, inheritance, built-in functions, and other stuff.
  • 3. CodeKit (Paid) Mac Compass.app (Paid, Open Source) Mac Windows Linux Ghostlab (Paid) Mac Windows Hammer (Paid) Mac Koala (Open Source) Mac Windows Linux LiveReload (Paid, Open Source) Mac Windows Prepros (Paid) Mac Windows Linux Scout-App (Free, Open Source) Windows Linux Mac When you install Sass on the command line, you'll be able to run the sass executable to compile .sass and .scss files to .css files. For example: Applications Command Line How to Use/install Sass?
  • 4. How Does Sass Work? A browser does not understand Sass code. Therefore, you will need a Sass pre-processor to convert Sass code into standard CSS.
  • 5. A Simple Example Let's say we have a website with three main colors: So, many times we type those HEX values. Instead of typing the above values a lot of times, we can use Sass and write this:
  • 6. So, when using Sass, and the primary color changes, you only need to change it in one place.
  • 7. Variables Variables as a way to store information that you want to reuse throughout your stylesheet.
  • 8. Nesting When writing HTML you've probably noticed that it has a clear nested and visual hierarchy. Sass will let you nest your CSS selectors in a way that follows the same visual hierarchy of your HTML.
  • 9. Partials You can create partial Sass files that contain little snippets of CSS that you can include in other Sass files. This is a great way to modularize your CSS and help keep things easier to maintain. A partial is a Sass file named with a leading underscore. You might name it something like _partial.scss. The underscore lets Sass know that the file is only a partial file and that it should not be generated into a CSS file. Sass partials are used with the @use rule.
  • 10. Modules You don't have to write all your Sass in a single file. You can split it up however you want with the @use rule. This rule loads another Sass file as a moduleUsing a file will also include the CSS it generates in your compiled output! Notice we're using @use 'base'; in the styles.scss file. When you use a file you don't need to include the file extension. Sass is smart and will figure it out.
  • 11. Mixins Some things in CSS are a bit tedious to write, especially with CSS3 and the many vendor prefixes that exist. A mixin lets you make groups of CSS declarations that you want to reuse throughout your site. You can even pass in values to make your mixin more flexible. A good use of a mixin is for vendor prefixes. Here's an example for transform.
  • 12. Extend/Inheritance This is one of the most useful features of Sass. Using @extend lets you share a set of CSS properties from one selector to another.
  • 13. Operators Doing math in your CSS is very helpful. Sass has a handful of standard math operators like +, -, *, /, and %.
  • 14. SASS AND MEDIA QUERIES SASS section.main { float: left; width: 65%; font-size: 16px; Line-height: 1.4; @media screen and (max-width: 800px) { float: none; width: auto; } @media screen and (max-width: 500px) { font-size: 12px; line-height: 1.4; } } CSS section.main { float: left; width: 65%; font-size: 16px; line-height: 1.4; } @media screen and (max-width: 800px) { section.main { float: none; width: auto; } } @media screen and (max-width: 500px) { section.main { font-size: 12px; line-height: 1.4; } }