SlideShare a Scribd company logo
1 of 17
London, 8 October 2012 | | 1
SASS
Installation


Download .exe file from the following URL:

http://rubyinstaller.org/downloads/

Install and run the command prompt with
ruby

Sass -- watch style.sass:style.css

Sass – watch <sass filename>:<css
filename>
SASS

•   SASS (Syntactically Awesome Stylesheets) is a
    stylesheet language designed by Hampton Catlin and
    developed by Nathan Weizenbaum.

•   SASS is a scripting languages and it is interpreted to
    CSS.

•   SASS uses indentation to separate code blocks and
    semicolons to separate rules
Variables

• SASS allows variables. Variables are defined with “$”
  dollar sign and variable assignment is done using “:”
  colon. They can be used throughtout the stylesheet.

• Variables can be arguments or results of the several
  functions. During translation, the values of the variables
  are inserted in the output css
Examples


$red : #ff0000         OUTPUT:

$margin : 16px         .nav {

                        border-color: red;

.nav                    margin: 8px; }

 border-color : $red

 margin: $margin / 2
Nesting

• It allows code to be inserted within each other
table.hl                         OUTPUT:

 margin: 2em 0                   table.hl {

 td.ln                            margin: 2em 0; }

  text-align: right               table.hl td.ln {

                                   text-align: right; }
Mixins

• Mixins is defined with directive “@mixin”

• Variables can be arguments or results of the several
  functions. During translation, the values of the variables
  are inserted in the output css
Examples 1

@mixin table-base {
                              OUTPUT:
    th {
                              .data th {
        text-align: center;
                                  text-align: center;
        font-weight: bold;
                                  font-weight: bold;
    }
                              }
    td, th {padding: 2px}
                              .data td, .data th {
}
                                  padding: 2px;
.data {
                              }
    @include table-base;

}
Example 2

@mixin spacing($dist)
                                    OUTPUT:

 margin: 0 $dist 0 $dist            .content {

.content                             margin: 0 10px 0 10px; }

 @include spacing(10px)
                                    .nav ul li {

@mixin primNav                       display: inline-block;

 display: inline-block               width: 100%;

 width: 100%                         border-top: 1px solid #e6e6e6;

 border-top: 1px solid #e6e6e6       border-bottom: 1px solid #e6e6e6; }

 border-bottom: 1px solid #e6e6e6

 .nav ul li

 @include primNav
Selector inheritance


• Allows the selector to inherit all the
 properties to another selector

• Duplication of code can be avoided
Example1

.heading            OUTPUT:
 color: red         .heading, .big-heading {

                     color: red; }

.big-heading

 @extend .heading   .big-heading {

 font-size: 48px     font-size: 48px; }
Example2

clearfix              OUTPUT:
 content: "."         .clearfix, .data:after {

 display: block        content: ".";

 height: 0             display: block;

 clear: both           height: 0;

 visibility: hidden    clear: both;

.data:after            visibility: hidden; }

 @extend .clearfix
Advantages


• Css styles can be reused

• Common css styles can be brought
 together through nesting

• It includes features like nesting, variables,
 mixins which makes it more manageable
Disadvantages


• Need thorough learning to understand
 sass

• Generated css is not aligned properly

• Difficult to understand since the syntax
 has no curly braces to distinguish and very
 confusing since all the styles are written
 one after another.
Links referred


•https://gist.github.com/674726

•http://sass-lang.com/
End

More Related Content

Similar to Sass

Sass and Compass - Getting Started
Sass and Compass - Getting StartedSass and Compass - Getting Started
Sass and Compass - Getting Startededgincvg
 
LESS(CSS preprocessor)
LESS(CSS preprocessor)LESS(CSS preprocessor)
LESS(CSS preprocessor)VIPIN KUMAR
 
Doing More With Less
Doing More With LessDoing More With Less
Doing More With LessDavid Engel
 
Getting Started with Sass & Compass
Getting Started with Sass & CompassGetting Started with Sass & Compass
Getting Started with Sass & CompassRob Davarnia
 
Css preprocessor-140606115334-phpapp01
Css preprocessor-140606115334-phpapp01Css preprocessor-140606115334-phpapp01
Css preprocessor-140606115334-phpapp01Anam Hossain
 
CSS preprocessor: why and how
CSS preprocessor: why and howCSS preprocessor: why and how
CSS preprocessor: why and howmirahman
 
Big Design Conference: CSS3
Big Design Conference: CSS3 Big Design Conference: CSS3
Big Design Conference: CSS3 Wynn Netherland
 
Deep dive into sass
Deep dive into sassDeep dive into sass
Deep dive into sassKnoldus Inc.
 
Software programming tools for creating/managing CSS files
Software programming tools for creating/managing CSS filesSoftware programming tools for creating/managing CSS files
Software programming tools for creating/managing CSS filesDinu Suman
 
CSS Less framework overview, Pros and Cons
CSS Less framework overview, Pros and ConsCSS Less framework overview, Pros and Cons
CSS Less framework overview, Pros and ConsSanjoy Kr. Paul
 
LESS : The dynamic stylesheet language
LESS : The dynamic stylesheet languageLESS : The dynamic stylesheet language
LESS : The dynamic stylesheet languageKatsunori Tanaka
 
Scss talk CSS Meetup
Scss talk CSS Meetup Scss talk CSS Meetup
Scss talk CSS Meetup Caleb Yang
 

Similar to Sass (20)

Sass and Compass - Getting Started
Sass and Compass - Getting StartedSass and Compass - Getting Started
Sass and Compass - Getting Started
 
Intro to SASS CSS
Intro to SASS CSSIntro to SASS CSS
Intro to SASS CSS
 
LESS(CSS preprocessor)
LESS(CSS preprocessor)LESS(CSS preprocessor)
LESS(CSS preprocessor)
 
Less css
Less cssLess css
Less css
 
Theming and Sass
Theming and SassTheming and Sass
Theming and Sass
 
Doing More With Less
Doing More With LessDoing More With Less
Doing More With Less
 
Getting Started with Sass & Compass
Getting Started with Sass & CompassGetting Started with Sass & Compass
Getting Started with Sass & Compass
 
Why less?
Why less?Why less?
Why less?
 
Css preprocessor-140606115334-phpapp01
Css preprocessor-140606115334-phpapp01Css preprocessor-140606115334-phpapp01
Css preprocessor-140606115334-phpapp01
 
CSS preprocessor: why and how
CSS preprocessor: why and howCSS preprocessor: why and how
CSS preprocessor: why and how
 
Big Design Conference: CSS3
Big Design Conference: CSS3 Big Design Conference: CSS3
Big Design Conference: CSS3
 
Deep dive into sass
Deep dive into sassDeep dive into sass
Deep dive into sass
 
Software programming tools for creating/managing CSS files
Software programming tools for creating/managing CSS filesSoftware programming tools for creating/managing CSS files
Software programming tools for creating/managing CSS files
 
Sass Essentials
Sass EssentialsSass Essentials
Sass Essentials
 
CSS - Basics
CSS - BasicsCSS - Basics
CSS - Basics
 
CSS Less framework overview, Pros and Cons
CSS Less framework overview, Pros and ConsCSS Less framework overview, Pros and Cons
CSS Less framework overview, Pros and Cons
 
LESS : The dynamic stylesheet language
LESS : The dynamic stylesheet languageLESS : The dynamic stylesheet language
LESS : The dynamic stylesheet language
 
Scss talk CSS Meetup
Scss talk CSS Meetup Scss talk CSS Meetup
Scss talk CSS Meetup
 
Accelerated Stylesheets
Accelerated StylesheetsAccelerated Stylesheets
Accelerated Stylesheets
 
Sass_Cubet seminar
Sass_Cubet seminarSass_Cubet seminar
Sass_Cubet seminar
 

Recently uploaded

Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 

Recently uploaded (20)

Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

Sass

  • 1. London, 8 October 2012 | | 1
  • 3. Installation Download .exe file from the following URL: http://rubyinstaller.org/downloads/ Install and run the command prompt with ruby Sass -- watch style.sass:style.css Sass – watch <sass filename>:<css filename>
  • 4. SASS • SASS (Syntactically Awesome Stylesheets) is a stylesheet language designed by Hampton Catlin and developed by Nathan Weizenbaum. • SASS is a scripting languages and it is interpreted to CSS. • SASS uses indentation to separate code blocks and semicolons to separate rules
  • 5. Variables • SASS allows variables. Variables are defined with “$” dollar sign and variable assignment is done using “:” colon. They can be used throughtout the stylesheet. • Variables can be arguments or results of the several functions. During translation, the values of the variables are inserted in the output css
  • 6. Examples $red : #ff0000 OUTPUT: $margin : 16px .nav { border-color: red; .nav margin: 8px; } border-color : $red margin: $margin / 2
  • 7. Nesting • It allows code to be inserted within each other table.hl OUTPUT: margin: 2em 0 table.hl { td.ln margin: 2em 0; } text-align: right table.hl td.ln { text-align: right; }
  • 8. Mixins • Mixins is defined with directive “@mixin” • Variables can be arguments or results of the several functions. During translation, the values of the variables are inserted in the output css
  • 9. Examples 1 @mixin table-base { OUTPUT: th { .data th { text-align: center; text-align: center; font-weight: bold; font-weight: bold; } } td, th {padding: 2px} .data td, .data th { } padding: 2px; .data { } @include table-base; }
  • 10. Example 2 @mixin spacing($dist) OUTPUT: margin: 0 $dist 0 $dist .content { .content margin: 0 10px 0 10px; } @include spacing(10px) .nav ul li { @mixin primNav display: inline-block; display: inline-block width: 100%; width: 100% border-top: 1px solid #e6e6e6; border-top: 1px solid #e6e6e6 border-bottom: 1px solid #e6e6e6; } border-bottom: 1px solid #e6e6e6 .nav ul li @include primNav
  • 11. Selector inheritance • Allows the selector to inherit all the properties to another selector • Duplication of code can be avoided
  • 12. Example1 .heading OUTPUT: color: red .heading, .big-heading { color: red; } .big-heading @extend .heading .big-heading { font-size: 48px font-size: 48px; }
  • 13. Example2 clearfix OUTPUT: content: "." .clearfix, .data:after { display: block content: "."; height: 0 display: block; clear: both height: 0; visibility: hidden clear: both; .data:after visibility: hidden; } @extend .clearfix
  • 14. Advantages • Css styles can be reused • Common css styles can be brought together through nesting • It includes features like nesting, variables, mixins which makes it more manageable
  • 15. Disadvantages • Need thorough learning to understand sass • Generated css is not aligned properly • Difficult to understand since the syntax has no curly braces to distinguish and very confusing since all the styles are written one after another.
  • 17. End