SlideShare a Scribd company logo
Sass – Sassy-CSS
CSS Sample
p {
color: #336699;
font-size: 2em;
}
➔ P = selector.
➔ What follows (the bit inside the curly braces) = declaration block.
➔ The two lines—one defining the color and one defining the font size—are
known as declarations.
➔ Each declaration has a property and a value.
➔ The property in this case is the color or the font size.
➔ The value is the color itself—for example, #336699, blue—or the size of the
font—for example, 20px.
A Small taste of Sass
Color:#EFDECD
Colors are in hex code
In Sass/Scss you can assign these Hex codes to predefined Variables
Example:
$almond:#EFDECD
Another Useful thing is the Compass Framework
Compass enables cross browser CSS easily
Example Scaling an Ytranslation:
Sass Code example:
#div 5: hover{
@include transform(translatey(50%), scale (50%)}
But First
●2 types
●SCSS
●Original Sass
No Browser Directly reads Sass
●So Sass -> CSS -> Browser
●Works with Ruby
Original Sass? What?
Original Sass: A Stripped-down Way to Write Sass
Before SCSS, there was Original Sass, which strips out some
of the unnecessary elements of CSS and SCSS. Original Sass
can be compiled just the same as SCSS, via the Sass engine.
A great example of unnecessary elements are curly braces.
Look at this:
.fab_text {
color: #336699;
font-size: 2em; }
>
We know by the use of . or # that something is a selector.
Using whitespace (two spaces or a soft tab that indents the
properties) helps us. In the example above, the indentation
lets us know that color and font-size refer only to the fab_text
class. The curly braces aren’t needed. Why not just strip them
out?
.fab_text
color: #336699;
font-size: 2em;
>>
While we’re at it, we might as well take away the semicolons
at the end of the values. They don’t add much, do they?
.fab_text
color: #336699
font-size: 2em
Commenting
/* Hey look at this multiline comment
* that we want to show up in our CSS
* output. */
#page {
color: black; }
// These comments are single lines
// and we do not want them to appear
// in our CSS
#sidebar {
color: #336699; }
This compiles to:
/* Hey look at this multiline comment
* that we want to show up in our CSS
* output. */
#page {
color: black; }
#sidebar {
Color: #336699; }
/*! Loud comments */
Compass? Does it actually help>
● Yes! Scss is built on Rails! (ruby on rails anyone?)
● Compass Watch -> automatically updates CSS when
changes made to Sass files
● Partials : resources available easily on the web to help
Normalize Scss across browsers
● @extend can be used to copy styles of an earler style
block
Sass: Simple Nesting
● If you have used CSS, You know the value of specific
selectors
● Example : .sidebar p em is very specific
●
Based on config.rb
Parent > Child
Variables
Font Libraries
Colors!
Easy coloring
@extend
Mixins
● A mixin is a fragment of Sass that can easily be applied to
another selector.
● Let’s say we require a distinct style: blue text with small
caps.
● We need to apply this style to many selectors in our
document.
● We don’t want to have to repeat color: #369; over and over
again.
Mixing In mixins
CSS can be
repetitive
Define use, Use anywhere
How to include a mixin
How to define a mixin
@content
● What if we could easily keep our responsive media style
rules grouped with the content it defines rules for, but not
clutter our file with @media rules?
● It makes much more sense to keep our media rules inline
like this
● For small sites it's not too big of a deal, but when you're
dealing with stylesheets for larger sites, it's a pain to locate
the associated @media rules and make changes in
potentially 4 different locations (default, tablet, mobile,
wide mobile).
@content
@content
Thats it for now
● The End. Thank You for your time.

More Related Content

What's hot

Syntactically awesome stylesheets (Sass)
Syntactically awesome stylesheets (Sass)Syntactically awesome stylesheets (Sass)
Syntactically awesome stylesheets (Sass)
Tahmina Khatoon
 
Pacific Northwest Drupal Summit: Basic & SASS
Pacific Northwest Drupal Summit: Basic & SASSPacific Northwest Drupal Summit: Basic & SASS
Pacific Northwest Drupal Summit: Basic & SASS
Steve Krueger
 
CSS Preprocessors: LESS is more or look SASS-y trying
CSS Preprocessors: LESS is more or look SASS-y tryingCSS Preprocessors: LESS is more or look SASS-y trying
CSS Preprocessors: LESS is more or look SASS-y trying
James Cryer
 
Sass and compass workshop
Sass and compass workshopSass and compass workshop
Sass and compass workshop
Shaho Toofani
 
Sass
SassSass
Write LESS. DO more.
Write LESS. DO more.Write LESS. DO more.
Write LESS. DO more.
Eugene Nor
 
CSS preprocessor: why and how
CSS preprocessor: why and howCSS preprocessor: why and how
CSS preprocessor: why and howmirahman
 
Authoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & SassAuthoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & Sass
chriseppstein
 
.Less - CSS done right
.Less - CSS done right.Less - CSS done right
.Less - CSS done right
Daniel Hölbling
 
CSS
CSSCSS
Bringing sexy back to CSS: SASS/SCSS, LESS and Compass
Bringing sexy back to CSS: SASS/SCSS, LESS and CompassBringing sexy back to CSS: SASS/SCSS, LESS and Compass
Bringing sexy back to CSS: SASS/SCSS, LESS and Compass
Claudina Sarahe
 
Intro to Sass for WordPress Developers
Intro to Sass for WordPress DevelopersIntro to Sass for WordPress Developers
Intro to Sass for WordPress Developers
Suzette Franck
 
CSS 開發加速指南-Sass & Compass
CSS 開發加速指南-Sass & CompassCSS 開發加速指南-Sass & Compass
CSS 開發加速指南-Sass & Compass
Lucien Lee
 
Css to-scss
Css to-scssCss to-scss
Css to-scss
frontendne
 
How to use CSS3 in WordPress - Sacramento
How to use CSS3 in WordPress - SacramentoHow to use CSS3 in WordPress - Sacramento
How to use CSS3 in WordPress - Sacramento
Suzette Franck
 
CSS 101
CSS 101CSS 101
CSS 101
dunclair
 
LESS, the CSS Preprocessor
LESS, the CSS PreprocessorLESS, the CSS Preprocessor
LESS, the CSS Preprocessor
Andrea Tarr
 
Css3
Css3Css3

What's hot (20)

Less css
Less cssLess css
Less css
 
Syntactically awesome stylesheets (Sass)
Syntactically awesome stylesheets (Sass)Syntactically awesome stylesheets (Sass)
Syntactically awesome stylesheets (Sass)
 
Pacific Northwest Drupal Summit: Basic & SASS
Pacific Northwest Drupal Summit: Basic & SASSPacific Northwest Drupal Summit: Basic & SASS
Pacific Northwest Drupal Summit: Basic & SASS
 
CSS Preprocessors: LESS is more or look SASS-y trying
CSS Preprocessors: LESS is more or look SASS-y tryingCSS Preprocessors: LESS is more or look SASS-y trying
CSS Preprocessors: LESS is more or look SASS-y trying
 
Sass and compass workshop
Sass and compass workshopSass and compass workshop
Sass and compass workshop
 
Sass
SassSass
Sass
 
Write LESS. DO more.
Write LESS. DO more.Write LESS. DO more.
Write LESS. DO more.
 
CSS preprocessor: why and how
CSS preprocessor: why and howCSS preprocessor: why and how
CSS preprocessor: why and how
 
Authoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & SassAuthoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & Sass
 
.Less - CSS done right
.Less - CSS done right.Less - CSS done right
.Less - CSS done right
 
CSS
CSSCSS
CSS
 
Bringing sexy back to CSS: SASS/SCSS, LESS and Compass
Bringing sexy back to CSS: SASS/SCSS, LESS and CompassBringing sexy back to CSS: SASS/SCSS, LESS and Compass
Bringing sexy back to CSS: SASS/SCSS, LESS and Compass
 
Intro to Sass for WordPress Developers
Intro to Sass for WordPress DevelopersIntro to Sass for WordPress Developers
Intro to Sass for WordPress Developers
 
CSS 開發加速指南-Sass & Compass
CSS 開發加速指南-Sass & CompassCSS 開發加速指南-Sass & Compass
CSS 開發加速指南-Sass & Compass
 
Css to-scss
Css to-scssCss to-scss
Css to-scss
 
How to use CSS3 in WordPress - Sacramento
How to use CSS3 in WordPress - SacramentoHow to use CSS3 in WordPress - Sacramento
How to use CSS3 in WordPress - Sacramento
 
CSS 101
CSS 101CSS 101
CSS 101
 
LESS, the CSS Preprocessor
LESS, the CSS PreprocessorLESS, the CSS Preprocessor
LESS, the CSS Preprocessor
 
Html Expression Web
Html Expression WebHtml Expression Web
Html Expression Web
 
Css3
Css3Css3
Css3
 

Similar to Sass presentation

CSS preprocessors for designers (CSS-On-Diet)
CSS preprocessors for designers (CSS-On-Diet)CSS preprocessors for designers (CSS-On-Diet)
CSS preprocessors for designers (CSS-On-Diet)
Tomasz Wyderka
 
CSS Basic and Common Errors
CSS Basic and Common ErrorsCSS Basic and Common Errors
CSS Basic and Common ErrorsHock Leng PUAH
 
UNIT 3.ppt
UNIT 3.pptUNIT 3.ppt
UNIT 3.ppt
kavi806657
 
Css tutorial 2012
Css tutorial 2012Css tutorial 2012
Css tutorial 2012
Sudheer Kiran
 
LESS CSS
LESS CSSLESS CSS
Customizing the look and-feel of DSpace
Customizing the look and-feel of DSpaceCustomizing the look and-feel of DSpace
Customizing the look and-feel of DSpace
Bharat Chaudhari
 
CSS
CSSCSS
INTRODUCTIONS OF CSS
INTRODUCTIONS OF CSSINTRODUCTIONS OF CSS
INTRODUCTIONS OF CSS
SURYANARAYANBISWAL1
 
Cordova training - Day 2 Introduction to CSS 3
Cordova training - Day 2 Introduction to CSS 3Cordova training - Day 2 Introduction to CSS 3
Cordova training - Day 2 Introduction to CSS 3
Binu Paul
 
Advance Web Designing - Lecture 02 / 30
Advance Web Designing - Lecture 02 / 30Advance Web Designing - Lecture 02 / 30
Advance Web Designing - Lecture 02 / 30
alishanvr
 
CSS Methodology
CSS MethodologyCSS Methodology
CSS MethodologyZohar Arad
 
Css Basics
Css BasicsCss Basics
Css Basics
Jay Patel
 
Basics Of Css And Some Common Mistakes
Basics Of Css And Some Common MistakesBasics Of Css And Some Common Mistakes
Basics Of Css And Some Common Mistakessanjay2211
 
Css training tutorial css3 & css4 essentials
Css training tutorial css3 & css4 essentialsCss training tutorial css3 & css4 essentials
Css training tutorial css3 & css4 essentials
QA TrainingHub
 

Similar to Sass presentation (20)

CSS preprocessors for designers (CSS-On-Diet)
CSS preprocessors for designers (CSS-On-Diet)CSS preprocessors for designers (CSS-On-Diet)
CSS preprocessors for designers (CSS-On-Diet)
 
CSS Basic and Common Errors
CSS Basic and Common ErrorsCSS Basic and Common Errors
CSS Basic and Common Errors
 
Btk creative-web-03
Btk creative-web-03Btk creative-web-03
Btk creative-web-03
 
UNIT 3.ppt
UNIT 3.pptUNIT 3.ppt
UNIT 3.ppt
 
Css tutorial 2012
Css tutorial 2012Css tutorial 2012
Css tutorial 2012
 
LESS CSS
LESS CSSLESS CSS
LESS CSS
 
Customizing the look and-feel of DSpace
Customizing the look and-feel of DSpaceCustomizing the look and-feel of DSpace
Customizing the look and-feel of DSpace
 
CSS
CSSCSS
CSS
 
Css
CssCss
Css
 
INTRODUCTIONS OF CSS
INTRODUCTIONS OF CSSINTRODUCTIONS OF CSS
INTRODUCTIONS OF CSS
 
Cordova training - Day 2 Introduction to CSS 3
Cordova training - Day 2 Introduction to CSS 3Cordova training - Day 2 Introduction to CSS 3
Cordova training - Day 2 Introduction to CSS 3
 
CSS ppt
CSS pptCSS ppt
CSS ppt
 
Class
ClassClass
Class
 
Class
ClassClass
Class
 
Css
CssCss
Css
 
Advance Web Designing - Lecture 02 / 30
Advance Web Designing - Lecture 02 / 30Advance Web Designing - Lecture 02 / 30
Advance Web Designing - Lecture 02 / 30
 
CSS Methodology
CSS MethodologyCSS Methodology
CSS Methodology
 
Css Basics
Css BasicsCss Basics
Css Basics
 
Basics Of Css And Some Common Mistakes
Basics Of Css And Some Common MistakesBasics Of Css And Some Common Mistakes
Basics Of Css And Some Common Mistakes
 
Css training tutorial css3 & css4 essentials
Css training tutorial css3 & css4 essentialsCss training tutorial css3 & css4 essentials
Css training tutorial css3 & css4 essentials
 

Recently uploaded

openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
ShamsuddeenMuhammadA
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
Alina Yurenko
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 

Recently uploaded (20)

openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 

Sass presentation

  • 2. CSS Sample p { color: #336699; font-size: 2em; } ➔ P = selector. ➔ What follows (the bit inside the curly braces) = declaration block. ➔ The two lines—one defining the color and one defining the font size—are known as declarations. ➔ Each declaration has a property and a value. ➔ The property in this case is the color or the font size. ➔ The value is the color itself—for example, #336699, blue—or the size of the font—for example, 20px.
  • 3. A Small taste of Sass Color:#EFDECD Colors are in hex code In Sass/Scss you can assign these Hex codes to predefined Variables Example: $almond:#EFDECD Another Useful thing is the Compass Framework Compass enables cross browser CSS easily Example Scaling an Ytranslation: Sass Code example: #div 5: hover{ @include transform(translatey(50%), scale (50%)}
  • 4. But First ●2 types ●SCSS ●Original Sass No Browser Directly reads Sass ●So Sass -> CSS -> Browser ●Works with Ruby
  • 5. Original Sass? What? Original Sass: A Stripped-down Way to Write Sass Before SCSS, there was Original Sass, which strips out some of the unnecessary elements of CSS and SCSS. Original Sass can be compiled just the same as SCSS, via the Sass engine. A great example of unnecessary elements are curly braces. Look at this: .fab_text { color: #336699; font-size: 2em; }
  • 6. > We know by the use of . or # that something is a selector. Using whitespace (two spaces or a soft tab that indents the properties) helps us. In the example above, the indentation lets us know that color and font-size refer only to the fab_text class. The curly braces aren’t needed. Why not just strip them out? .fab_text color: #336699; font-size: 2em;
  • 7. >> While we’re at it, we might as well take away the semicolons at the end of the values. They don’t add much, do they? .fab_text color: #336699 font-size: 2em
  • 8. Commenting /* Hey look at this multiline comment * that we want to show up in our CSS * output. */ #page { color: black; } // These comments are single lines // and we do not want them to appear // in our CSS #sidebar { color: #336699; } This compiles to: /* Hey look at this multiline comment * that we want to show up in our CSS * output. */ #page { color: black; } #sidebar { Color: #336699; } /*! Loud comments */
  • 9. Compass? Does it actually help> ● Yes! Scss is built on Rails! (ruby on rails anyone?) ● Compass Watch -> automatically updates CSS when changes made to Sass files ● Partials : resources available easily on the web to help Normalize Scss across browsers ● @extend can be used to copy styles of an earler style block
  • 10. Sass: Simple Nesting ● If you have used CSS, You know the value of specific selectors ● Example : .sidebar p em is very specific ●
  • 11.
  • 19. Mixins ● A mixin is a fragment of Sass that can easily be applied to another selector. ● Let’s say we require a distinct style: blue text with small caps. ● We need to apply this style to many selectors in our document. ● We don’t want to have to repeat color: #369; over and over again.
  • 20. Mixing In mixins CSS can be repetitive Define use, Use anywhere
  • 21. How to include a mixin How to define a mixin
  • 22. @content ● What if we could easily keep our responsive media style rules grouped with the content it defines rules for, but not clutter our file with @media rules? ● It makes much more sense to keep our media rules inline like this ● For small sites it's not too big of a deal, but when you're dealing with stylesheets for larger sites, it's a pain to locate the associated @media rules and make changes in potentially 4 different locations (default, tablet, mobile, wide mobile).
  • 25. Thats it for now ● The End. Thank You for your time.