SlideShare ist ein Scribd-Unternehmen logo
1 von 12
INTRO TO SASS CSS
        Kianosh Pourian


     Wifi
     username: BCGUEST
     password: 290Congress
About Me
Kianosh Pourian
Pixel Architect/Independent Contractor
Blog on: http://innovatorylife.com
Twitter: @kianoshp
About Me
Kianosh Pourian
Pixel Architect/Independent Contractor
Blog on: http://innovatorylife.com
Twitter: @kianoshp
SASS CSS
Ruby engine compiler for CSS
Extending the benefits of CSS by allowing nested rules, variables,
mixins, selector inheritance, and more.
http://sass-lang.com/
Other equivalent pre-processors:
  Javascript: LESS - http://lesscss.org/
  Stylus: http://learnboost.github.com/stylus/
  Closure Stylesheets
Pros & Cons of SASS
              Pros                          Cons

•Uniform CSS                    •Reliance of a compiler
•Abstraction of commonly used   •All or nothing
 CSS - mixins                   •Disconnect between CSS and
•Ability to create functions     SASS CSS in dev consoles
•Variables
•Nesting
•Inheritance
•COMPASS!!
Variables
In CSS we widely use common values for different element styles.

For example, we use colors, width, height, etc... throughout our CSS styles.

With variables, these common values can be declared once and re-used throughout the
stylesheets.

Example:
 $tableColor: #F3F1EB;
 $tableBorderColor: #EFEFEF;
 @mixin sortBg {
 !    background:$tableColor url('../img/bg.gif') no-repeat right center;
 !    &:hover {
 !    !     background-color: darken($tableColor, 25%);
 !    }
 }
Nesting
To avoid repetition, nested rules and selectors will help in this effort

Examples

SCSS file                                   CSS output
table.hl {                                  table.hl {
  margin: 2em 0;                              margin: 2em 0;
  td.ln {                                   }
    text-align: right;                      table.hl td.ln {
  }                                           text-align: right;
}                                           }

li {                                        li {
  font: {                                     font-family: serif;
     family: serif;                           font-weight: bold;
     weight: bold;                            font-size: 1.2em;
     size: 1.2em;                           }
  }
}
Mixins
Mixins are a very potent asset of SASS.

With mixins, the most commonly used CSS can be abstracted to a mixin and included as
needed.

Example:

  @mixin handCursor {
  !   cursor: hand;
  !   cursor: pointer;
  }
Mixins - Advanced
Mixins can become very advanced and can contain logic .

Example - setting Linear Gradients - http://kiano.sh/IjEpZm

Example:
@mixin add-border($border-position: all, $border-size: 1px, $border-
pattern: solid, $border-color: #000) {

!   @if $border-position == 'all' {

!   !    border: $border-size $border-pattern $border-color;

!   } @else {

!   !    border-#{$border-position}: $border-size $border-pattern
$border-color;

!   }

}
Functions
Functions allow for computation logic.

Functions return values.

Example:

@function responsiveFontSize($fontSize: 16, $isIE: false) {
!    @if $isIE {
!    !     @return (($fontSize/16) - 0.02) + em;
!    } @else {
!    !     @return ($fontSize/16) + em;
!    }
}
@function rfs($fontSize: 16, $isIE: false) {
!    @return responsiveFontSize($fontSize, $isIE);
}
COMPASS
“...open-source CSS authoring framework which uses the Sass stylesheet language to make
writing stylesheets powerful and easy.”

Provides a number of community-created mixins and modules to help integrate some of the
most popular design patterns on the web.

X-Browser CSS3 mixins: Rounded Corners, Gradients, Box Shadow, Text Shadow, etc...

Common CSS development patterns: reset css, clearfix, sprites, etc...
Further reading
SASS CSS - www.sass-lang.com

COMPASS - http://compass-style.org/

SASS Cocktails - collections of SASS mixins and functions - http://kiano.sh/J89RI9

SASS CSS Boilerplate - http://kiano.sh/IlZt2b

Thoughtbot/bourbon - Series of mixins and functions - http://kiano.sh/IQNOZ6



How to write a well structured CSS - Part 1 http://kiano.sh/Inxxym & Part 2 http://
kiano.sh/LaVS65

Feel free to tweet me a questions, twitter: @kianoshp

blog: http://innovatorylife.com

Weitere ähnliche Inhalte

Was ist angesagt?

Pacific Northwest Drupal Summit: Basic & SASS
Pacific Northwest Drupal Summit: Basic & SASSPacific Northwest Drupal Summit: Basic & SASS
Pacific Northwest Drupal Summit: Basic & SASSSteve Krueger
 
CSS preprocessor: why and how
CSS preprocessor: why and howCSS preprocessor: why and how
CSS preprocessor: why and howmirahman
 
Css basics
Css basicsCss basics
Css basicsASIT
 
4. Web Technology CSS Basics-1
4. Web Technology CSS Basics-14. Web Technology CSS Basics-1
4. Web Technology CSS Basics-1Jyoti Yadav
 
Intro to Sass for WordPress Developers
Intro to Sass for WordPress DevelopersIntro to Sass for WordPress Developers
Intro to Sass for WordPress DevelopersSuzette Franck
 
2 introduction css
2 introduction css2 introduction css
2 introduction cssJalpesh Vasa
 
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 - SacramentoSuzette Franck
 
Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)AakankshaR
 
Cascading Style Sheets(CSS)
Cascading Style Sheets(CSS)Cascading Style Sheets(CSS)
Cascading Style Sheets(CSS)Reshmi Rajan
 
[Worskhop Summits] CSS3 Workshop
[Worskhop Summits] CSS3 Workshop[Worskhop Summits] CSS3 Workshop
[Worskhop Summits] CSS3 WorkshopChristopher Schmitt
 
CSS - OOCSS, SMACSS and more
CSS - OOCSS, SMACSS and moreCSS - OOCSS, SMACSS and more
CSS - OOCSS, SMACSS and moreRuss Weakley
 

Was ist angesagt? (19)

Pacific Northwest Drupal Summit: Basic & SASS
Pacific Northwest Drupal Summit: Basic & SASSPacific Northwest Drupal Summit: Basic & SASS
Pacific Northwest Drupal Summit: Basic & SASS
 
CSS preprocessor: why and how
CSS preprocessor: why and howCSS preprocessor: why and how
CSS preprocessor: why and how
 
CSS 101
CSS 101CSS 101
CSS 101
 
CSS
CSSCSS
CSS
 
Css basics
Css basicsCss basics
Css basics
 
.Less - CSS done right
.Less - CSS done right.Less - CSS done right
.Less - CSS done right
 
4. Web Technology CSS Basics-1
4. Web Technology CSS Basics-14. Web Technology CSS Basics-1
4. Web Technology CSS Basics-1
 
Intro to Sass for WordPress Developers
Intro to Sass for WordPress DevelopersIntro to Sass for WordPress Developers
Intro to Sass for WordPress Developers
 
2 introduction css
2 introduction css2 introduction css
2 introduction css
 
The Dark Arts of CSS
The Dark Arts of CSSThe Dark Arts of CSS
The Dark Arts of CSS
 
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
 
Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)
 
Introduction to css
Introduction to cssIntroduction to css
Introduction to css
 
Css3
Css3Css3
Css3
 
CSS Introduction
CSS IntroductionCSS Introduction
CSS Introduction
 
Cascading Style Sheets(CSS)
Cascading Style Sheets(CSS)Cascading Style Sheets(CSS)
Cascading Style Sheets(CSS)
 
[Worskhop Summits] CSS3 Workshop
[Worskhop Summits] CSS3 Workshop[Worskhop Summits] CSS3 Workshop
[Worskhop Summits] CSS3 Workshop
 
Cascading style sheets - CSS
Cascading style sheets - CSSCascading style sheets - CSS
Cascading style sheets - CSS
 
CSS - OOCSS, SMACSS and more
CSS - OOCSS, SMACSS and moreCSS - OOCSS, SMACSS and more
CSS - OOCSS, SMACSS and more
 

Andere mochten auch

Sass - Getting Started with Sass!
Sass - Getting Started with Sass!Sass - Getting Started with Sass!
Sass - Getting Started with Sass!Eric Sembrat
 
Introduction to SASS
Introduction to SASSIntroduction to SASS
Introduction to SASSJon Dean
 
Syntactically awesome stylesheets (Sass)
Syntactically awesome stylesheets (Sass)Syntactically awesome stylesheets (Sass)
Syntactically awesome stylesheets (Sass)Tahmina Khatoon
 
CSS Best Practices
CSS Best PracticesCSS Best Practices
CSS Best Practicesnolly00
 
Using scss-at-noisestreet
Using scss-at-noisestreetUsing scss-at-noisestreet
Using scss-at-noisestreetWei Pin Teo
 
Getting Started With Sass | WC Philly 2015
Getting Started With Sass | WC Philly 2015Getting Started With Sass | WC Philly 2015
Getting Started With Sass | WC Philly 2015Maura Teal
 
Getting SASSy with front end development
Getting SASSy with front end developmentGetting SASSy with front end development
Getting SASSy with front end developmentMatthew Carleton
 
CSS3 secrets: 10 things you might not know about CSS3
CSS3 secrets: 10 things you might not know about CSS3CSS3 secrets: 10 things you might not know about CSS3
CSS3 secrets: 10 things you might not know about CSS3Lea Verou
 

Andere mochten auch (12)

Sass - Getting Started with Sass!
Sass - Getting Started with Sass!Sass - Getting Started with Sass!
Sass - Getting Started with Sass!
 
Introduction to SASS
Introduction to SASSIntroduction to SASS
Introduction to SASS
 
Syntactically awesome stylesheets (Sass)
Syntactically awesome stylesheets (Sass)Syntactically awesome stylesheets (Sass)
Syntactically awesome stylesheets (Sass)
 
Sass presentation
Sass presentationSass presentation
Sass presentation
 
CSS Best Practices
CSS Best PracticesCSS Best Practices
CSS Best Practices
 
Using scss-at-noisestreet
Using scss-at-noisestreetUsing scss-at-noisestreet
Using scss-at-noisestreet
 
Getting Started With Sass | WC Philly 2015
Getting Started With Sass | WC Philly 2015Getting Started With Sass | WC Philly 2015
Getting Started With Sass | WC Philly 2015
 
Getting SASSy with front end development
Getting SASSy with front end developmentGetting SASSy with front end development
Getting SASSy with front end development
 
Sass: Introduction
Sass: IntroductionSass: Introduction
Sass: Introduction
 
CSS3 secrets: 10 things you might not know about CSS3
CSS3 secrets: 10 things you might not know about CSS3CSS3 secrets: 10 things you might not know about CSS3
CSS3 secrets: 10 things you might not know about CSS3
 
Fundamental CSS3
Fundamental CSS3Fundamental CSS3
Fundamental CSS3
 
Sass
SassSass
Sass
 

Ähnlich wie Intro to SASS CSS

CSS 開發加速指南-Sass & Compass
CSS 開發加速指南-Sass & CompassCSS 開發加速指南-Sass & Compass
CSS 開發加速指南-Sass & CompassLucien Lee
 
Css preprocessor-140606115334-phpapp01
Css preprocessor-140606115334-phpapp01Css preprocessor-140606115334-phpapp01
Css preprocessor-140606115334-phpapp01Anam Hossain
 
Sass and Compass - Getting Started
Sass and Compass - Getting StartedSass and Compass - Getting Started
Sass and Compass - Getting Startededgincvg
 
Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)emrox
 
Simple introduction Sass
Simple introduction SassSimple introduction Sass
Simple introduction SassZeeshan Ahmed
 
An Introduction to CSS Preprocessors (SASS & LESS)
An Introduction to CSS Preprocessors (SASS & LESS)An Introduction to CSS Preprocessors (SASS & LESS)
An Introduction to CSS Preprocessors (SASS & LESS)Folio3 Software
 
Modularization css with sass
Modularization css with sassModularization css with sass
Modularization css with sassHuiyi Yan
 
Preprocessor presentation
Preprocessor presentationPreprocessor presentation
Preprocessor presentationMario Noble
 
Compass And Sass(Tim Riley)
Compass And Sass(Tim Riley)Compass And Sass(Tim Riley)
Compass And Sass(Tim Riley)elliando dias
 

Ähnlich wie Intro to SASS CSS (20)

Advanced sass
Advanced sassAdvanced sass
Advanced sass
 
CSS 開發加速指南-Sass & Compass
CSS 開發加速指南-Sass & CompassCSS 開發加速指南-Sass & Compass
CSS 開發加速指南-Sass & Compass
 
Css preprocessor-140606115334-phpapp01
Css preprocessor-140606115334-phpapp01Css preprocessor-140606115334-phpapp01
Css preprocessor-140606115334-phpapp01
 
Sass and Compass - Getting Started
Sass and Compass - Getting StartedSass and Compass - Getting Started
Sass and Compass - Getting Started
 
Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)
 
Theming and Sass
Theming and SassTheming and Sass
Theming and Sass
 
SASS Lecture
SASS Lecture SASS Lecture
SASS Lecture
 
Less css
Less cssLess css
Less css
 
Simple introduction Sass
Simple introduction SassSimple introduction Sass
Simple introduction Sass
 
AAVN_Presentation_SASS.pptx
AAVN_Presentation_SASS.pptxAAVN_Presentation_SASS.pptx
AAVN_Presentation_SASS.pptx
 
An Introduction to CSS Preprocessors (SASS & LESS)
An Introduction to CSS Preprocessors (SASS & LESS)An Introduction to CSS Preprocessors (SASS & LESS)
An Introduction to CSS Preprocessors (SASS & LESS)
 
Why less?
Why less?Why less?
Why less?
 
Sass
SassSass
Sass
 
Modularization css with sass
Modularization css with sassModularization css with sass
Modularization css with sass
 
Preprocessor presentation
Preprocessor presentationPreprocessor presentation
Preprocessor presentation
 
CSS Extenders
CSS ExtendersCSS Extenders
CSS Extenders
 
Web Typography
Web TypographyWeb Typography
Web Typography
 
CSS Presentation Notes.pptx
CSS Presentation Notes.pptxCSS Presentation Notes.pptx
CSS Presentation Notes.pptx
 
Accelerated Stylesheets
Accelerated StylesheetsAccelerated Stylesheets
Accelerated Stylesheets
 
Compass And Sass(Tim Riley)
Compass And Sass(Tim Riley)Compass And Sass(Tim Riley)
Compass And Sass(Tim Riley)
 

Mehr von Kianosh Pourian

Would you like some Grids with that?
Would you like some Grids with that?Would you like some Grids with that?
Would you like some Grids with that?Kianosh Pourian
 
Introvert & extrovert: The melting pot of development
Introvert & extrovert: The melting pot of developmentIntrovert & extrovert: The melting pot of development
Introvert & extrovert: The melting pot of developmentKianosh Pourian
 
Passport Nodejs Lightening Talk
Passport Nodejs Lightening TalkPassport Nodejs Lightening Talk
Passport Nodejs Lightening TalkKianosh Pourian
 
Why are preprocessors divisive
Why are preprocessors divisiveWhy are preprocessors divisive
Why are preprocessors divisiveKianosh Pourian
 

Mehr von Kianosh Pourian (6)

Unbloat your SDLC
Unbloat your SDLCUnbloat your SDLC
Unbloat your SDLC
 
Would you like some Grids with that?
Would you like some Grids with that?Would you like some Grids with that?
Would you like some Grids with that?
 
Introvert & extrovert: The melting pot of development
Introvert & extrovert: The melting pot of developmentIntrovert & extrovert: The melting pot of development
Introvert & extrovert: The melting pot of development
 
Passport Nodejs Lightening Talk
Passport Nodejs Lightening TalkPassport Nodejs Lightening Talk
Passport Nodejs Lightening Talk
 
Why are preprocessors divisive
Why are preprocessors divisiveWhy are preprocessors divisive
Why are preprocessors divisive
 
Intro to KnockoutJS
Intro to KnockoutJSIntro to KnockoutJS
Intro to KnockoutJS
 

Kürzlich hochgeladen

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
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
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
 
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
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
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
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 

Kürzlich hochgeladen (20)

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...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
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
 
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
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
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
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 

Intro to SASS CSS

  • 1. INTRO TO SASS CSS Kianosh Pourian Wifi username: BCGUEST password: 290Congress
  • 2. About Me Kianosh Pourian Pixel Architect/Independent Contractor Blog on: http://innovatorylife.com Twitter: @kianoshp
  • 3. About Me Kianosh Pourian Pixel Architect/Independent Contractor Blog on: http://innovatorylife.com Twitter: @kianoshp
  • 4. SASS CSS Ruby engine compiler for CSS Extending the benefits of CSS by allowing nested rules, variables, mixins, selector inheritance, and more. http://sass-lang.com/ Other equivalent pre-processors: Javascript: LESS - http://lesscss.org/ Stylus: http://learnboost.github.com/stylus/ Closure Stylesheets
  • 5. Pros & Cons of SASS Pros Cons •Uniform CSS •Reliance of a compiler •Abstraction of commonly used •All or nothing CSS - mixins •Disconnect between CSS and •Ability to create functions SASS CSS in dev consoles •Variables •Nesting •Inheritance •COMPASS!!
  • 6. Variables In CSS we widely use common values for different element styles. For example, we use colors, width, height, etc... throughout our CSS styles. With variables, these common values can be declared once and re-used throughout the stylesheets. Example: $tableColor: #F3F1EB; $tableBorderColor: #EFEFEF; @mixin sortBg { ! background:$tableColor url('../img/bg.gif') no-repeat right center; ! &:hover { ! ! background-color: darken($tableColor, 25%); ! } }
  • 7. Nesting To avoid repetition, nested rules and selectors will help in this effort Examples SCSS file CSS output table.hl { table.hl { margin: 2em 0; margin: 2em 0; td.ln { } text-align: right; table.hl td.ln { } text-align: right; } } li { li { font: { font-family: serif; family: serif; font-weight: bold; weight: bold; font-size: 1.2em; size: 1.2em; } } }
  • 8. Mixins Mixins are a very potent asset of SASS. With mixins, the most commonly used CSS can be abstracted to a mixin and included as needed. Example: @mixin handCursor { ! cursor: hand; ! cursor: pointer; }
  • 9. Mixins - Advanced Mixins can become very advanced and can contain logic . Example - setting Linear Gradients - http://kiano.sh/IjEpZm Example: @mixin add-border($border-position: all, $border-size: 1px, $border- pattern: solid, $border-color: #000) { ! @if $border-position == 'all' { ! ! border: $border-size $border-pattern $border-color; ! } @else { ! ! border-#{$border-position}: $border-size $border-pattern $border-color; ! } }
  • 10. Functions Functions allow for computation logic. Functions return values. Example: @function responsiveFontSize($fontSize: 16, $isIE: false) { ! @if $isIE { ! ! @return (($fontSize/16) - 0.02) + em; ! } @else { ! ! @return ($fontSize/16) + em; ! } } @function rfs($fontSize: 16, $isIE: false) { ! @return responsiveFontSize($fontSize, $isIE); }
  • 11. COMPASS “...open-source CSS authoring framework which uses the Sass stylesheet language to make writing stylesheets powerful and easy.” Provides a number of community-created mixins and modules to help integrate some of the most popular design patterns on the web. X-Browser CSS3 mixins: Rounded Corners, Gradients, Box Shadow, Text Shadow, etc... Common CSS development patterns: reset css, clearfix, sprites, etc...
  • 12. Further reading SASS CSS - www.sass-lang.com COMPASS - http://compass-style.org/ SASS Cocktails - collections of SASS mixins and functions - http://kiano.sh/J89RI9 SASS CSS Boilerplate - http://kiano.sh/IlZt2b Thoughtbot/bourbon - Series of mixins and functions - http://kiano.sh/IQNOZ6 How to write a well structured CSS - Part 1 http://kiano.sh/Inxxym & Part 2 http:// kiano.sh/LaVS65 Feel free to tweet me a questions, twitter: @kianoshp blog: http://innovatorylife.com

Hinweis der Redaktion

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n