SlideShare a Scribd company logo
1 of 27
Download to read offline
finding your way
with sass+compass



       ben@cornershopcreative.com
WHAT IS SASS?

Sass is a CSS Pre-processor
or meta-language
Sass is a “competitor” to LESS
and Stylus
Sass is written in Ruby
Sass is pretty cool
WHAT IS COMPASS?

Compass is an open-source
library of Sass mixins.
Compass is a CSS authoring
framework.
Compass is what makes Sass
really, really useful.
WHAT SASS DOES

Introduces new things to CSS:
  • nested rules
  • variables
  • mixins
  • inheritance
  • and much more!
GETTING GOING
in your development environment*




                * you don’t need sass on prod!
STEP BY STEP
1.Install ruby (I use rvm)
 $ curl -L https://get.rvm.io | bash -s stable --ruby


2.Install the compass “gem”
 $ gem update --system
 $ gem install compass


3.Install compass-normalize (optional)
 $ gem install compass-normalize


4.Confirm installation
 $ compass version
STEP BY STEP

5. Set up a project!
 $ compass create <foldername> ...or...
 $ compass install compass --syntax sass




                                           live demo time!
PROBLEMS?
http://compass-style.org/install/ is your friend
TWO SYNTAXES
SCSS                         SASS
.selector {                  .selector
  color: green;                color: green
  border:1px solid $black;     border:1px solid $black
  @include inline-block;       +inline-block
  li {                         li
       display: block;            display: block
    font:                         font:
       family: $sans;               family: $sans
       size: 122%;                  size: 122%
  }                               @extend .navitem
}
                             .other-selector
  .other-selector {}
THE PROCESS

1.Write your Sass
2.Compile your Sass into CSS
3.Include your CSS on prod
4.Bask in glory
LET’S TRY IT
showing is better than telling, right?
WE JUST COVERED

   Compiling Sass files with
    compass watch and
     compass compile
Using @imports and underscores
     to control our content
    Mucking with config.rb
VARIABLES & MIXINS
  and some math, just for fun!
VARIABLES
   $sans:   “Helvetica Neue”, Helvetica, Arial, sans-serif
$display:   “Lobster”, Impact, serif
   $tiny:   Verdana, sans-serif
   $evil:   Comic Sans, sans-serif

  $where: left
 $radius: 5px
   $base: 14px

   $dark:   #222
  $light:   #fff
$seethru:   rgba($light, 0.2)
   $grey:   $dark + #444    //or lighten($dark, 40%)
    $red:   #971219



                    doing this in _variables.sass is a good idea
VARIABLES IN ACTION!
 .redtext
   color: $red

 article
   font:
      family: $sans
      size: $base
   color: $dark
   background-color: $seethru
   h1
      font: #{$base * 2}/#{$base * 2.2} $display
      @extend .redtext
      &.title
        text-transform: uppercase

  .#{$where}-rail
    width: 200px
MIXINS
=notext
  overflow: hidden
  white-space: nowrap
  text-indent: 105%
  text-align: left

=float( $dir:   left )
  float: $dir
  @if $dir ==   left
    margin: 0   10px 5px 0
  @else
    margin: 0   0 5px 10px

.alignleft
  +float(right)
ENTER COMPASS
 mixin magic and more
CROSS-BROWSER STUFF
+opacity(0.6)


filter:
progid:DXImageTransform.Microsoft.Alpha(Opacity=60);
opacity: 0.6;


+inline-block        display: -moz-inline-stack;
                     display: inline-block;
                     vertical-align: middle;
                     *vertical-align: auto;
                     zoom: 1;
                     *display: inline;
MOAR CROSS-BROWSER

+opacity(0.6)
+clearfix
+legacy-pie-clearfix
+text-shadow(1px 2px 8px rgba(black, 0.3))
+box-shadow(inset 2px 4px 10px $red)
+border-radius(8px)
+box-sizing(border-box)
FANCY CSS3 = EASY!

+single-transition(all, 0.3s, ease)
+rotate(20deg)
+scale(1.2)
+background-image(linear-gradient(top, $red, $red - #222))




    http://compass-style.org/reference
SPRITES FTW
THE PROCESS

1.Create a sub-directory in /images/
2.Save your sprite png’s in there
3.Tell Compass to create classes
4.Celebrate
EXAMPLE
// gives us .mysprites-[filename]
@import "mysprites/*.png"
$mysprites-sprite-dimensions: true //sets dimensions
+all-mysprites-sprites


/* so if images/mysprites/logo.png is 200x100, then...
.mysprites-logo
  width: 200px;
     height: 100px;
     background: url(images/mysprites-3434034734.png) no-repeat;
     background-position: [whatever] [whatever];
*/


h1#logo
  @extend .mysprites-logo
OTHER STUFF
 random other tricks
WELL THAT’S HANDY
h1
  font-size: 40px
  @media screen and (max-width: $break-small)
    font-size: 30px

a.heading
  background-image: image-url(‘filename.jpg’)
  &:hover
    +scale(1.1)
  .no-csstransforms &:hover
    text-decoration: underline


$fullwidth: 960px
.rail
  width: percentage(220px/$fullwidth)
  margin: percentage(10px/$fullwidth)
FOR MORE...

       http://sass-lang.com
     http://compass-style.org
http://www.kaelig.fr/bettersassdocs/
      http://thesassway.com
CONNECT
        Ben Byrne
ben@cornershopcreative.com
   facebook.com/drywall
     Twitter: @drywall

More Related Content

What's hot

Drupal & CSS Preprocessors
Drupal & CSS PreprocessorsDrupal & CSS Preprocessors
Drupal & CSS Preprocessorskdmarks
 
Sass and compass workshop
Sass and compass workshopSass and compass workshop
Sass and compass workshopShaho Toofani
 
SASS is more than LESS
SASS is more than LESSSASS is more than LESS
SASS is more than LESSItai Koren
 
McrFRED 39 | CSS Processors
McrFRED 39 | CSS ProcessorsMcrFRED 39 | CSS Processors
McrFRED 39 | CSS ProcessorsTristan Ashley
 
Write LESS. DO more.
Write LESS. DO more.Write LESS. DO more.
Write LESS. DO more.Eugene Nor
 
Introduction to SASS
Introduction to SASSIntroduction to SASS
Introduction to SASSJon Dean
 
CSS preprocessor: why and how
CSS preprocessor: why and howCSS preprocessor: why and how
CSS preprocessor: why and howmirahman
 
Accelerated Native Mobile Development with the Ti gem
Accelerated Native Mobile Development with the Ti gemAccelerated Native Mobile Development with the Ti gem
Accelerated Native Mobile Development with the Ti gemWynn Netherland
 
Intro to css & sass
Intro to css & sassIntro to css & sass
Intro to css & sassSean Wolfe
 
Sassy CSS (part 2) (Drupal Camp LA 2013)
Sassy CSS (part 2) (Drupal Camp LA 2013)Sassy CSS (part 2) (Drupal Camp LA 2013)
Sassy CSS (part 2) (Drupal Camp LA 2013)Chris Charlton
 
Preprocessor presentation
Preprocessor presentationPreprocessor presentation
Preprocessor presentationMario Noble
 
Big Design Conference: CSS3
Big Design Conference: CSS3 Big Design Conference: CSS3
Big Design Conference: CSS3 Wynn Netherland
 
Haml And Sass In 15 Minutes
Haml And Sass In 15 MinutesHaml And Sass In 15 Minutes
Haml And Sass In 15 MinutesPatrick Crowley
 

What's hot (20)

Accelerated Stylesheets
Accelerated StylesheetsAccelerated Stylesheets
Accelerated Stylesheets
 
Drupal & CSS Preprocessors
Drupal & CSS PreprocessorsDrupal & CSS Preprocessors
Drupal & CSS Preprocessors
 
Sass and compass workshop
Sass and compass workshopSass and compass workshop
Sass and compass workshop
 
SASS is more than LESS
SASS is more than LESSSASS is more than LESS
SASS is more than LESS
 
McrFRED 39 | CSS Processors
McrFRED 39 | CSS ProcessorsMcrFRED 39 | CSS Processors
McrFRED 39 | CSS Processors
 
Css to-scss
Css to-scssCss to-scss
Css to-scss
 
Compass/Sass
Compass/SassCompass/Sass
Compass/Sass
 
Write LESS. DO more.
Write LESS. DO more.Write LESS. DO more.
Write LESS. DO more.
 
Sass Essentials
Sass EssentialsSass Essentials
Sass Essentials
 
Introduction to SASS
Introduction to SASSIntroduction to SASS
Introduction to SASS
 
CSS preprocessor: why and how
CSS preprocessor: why and howCSS preprocessor: why and how
CSS preprocessor: why and how
 
Sass
SassSass
Sass
 
Accelerated Native Mobile Development with the Ti gem
Accelerated Native Mobile Development with the Ti gemAccelerated Native Mobile Development with the Ti gem
Accelerated Native Mobile Development with the Ti gem
 
Intro to css & sass
Intro to css & sassIntro to css & sass
Intro to css & sass
 
Sassy CSS (part 2) (Drupal Camp LA 2013)
Sassy CSS (part 2) (Drupal Camp LA 2013)Sassy CSS (part 2) (Drupal Camp LA 2013)
Sassy CSS (part 2) (Drupal Camp LA 2013)
 
Preprocessor presentation
Preprocessor presentationPreprocessor presentation
Preprocessor presentation
 
LESS vs. SASS
LESS vs. SASSLESS vs. SASS
LESS vs. SASS
 
Big Design Conference: CSS3
Big Design Conference: CSS3 Big Design Conference: CSS3
Big Design Conference: CSS3
 
Haml And Sass In 15 Minutes
Haml And Sass In 15 MinutesHaml And Sass In 15 Minutes
Haml And Sass In 15 Minutes
 
Graph Database Using Neo4J
Graph Database Using Neo4JGraph Database Using Neo4J
Graph Database Using Neo4J
 

Viewers also liked

High Performance Front-End Development
High Performance Front-End DevelopmentHigh Performance Front-End Development
High Performance Front-End Developmentdrywallbmb
 
Center for Technical Education Innovation’s 2013 Spring General Advisory M…
Center for Technical Education Innovation’s 2013 Spring General Advisory M…Center for Technical Education Innovation’s 2013 Spring General Advisory M…
Center for Technical Education Innovation’s 2013 Spring General Advisory M…Rene Lafayette
 
Spotlight on France: Learning About America's Oldest Ally!
Spotlight on France: Learning About America's Oldest Ally!Spotlight on France: Learning About America's Oldest Ally!
Spotlight on France: Learning About America's Oldest Ally!Rene Lafayette
 
Istanbul 1993
Istanbul 1993Istanbul 1993
Istanbul 1993BlogNimph
 
The Difference Between Print and Web Design
The Difference Between Print and Web DesignThe Difference Between Print and Web Design
The Difference Between Print and Web Designdrywallbmb
 

Viewers also liked (7)

High Performance Front-End Development
High Performance Front-End DevelopmentHigh Performance Front-End Development
High Performance Front-End Development
 
Center for Technical Education Innovation’s 2013 Spring General Advisory M…
Center for Technical Education Innovation’s 2013 Spring General Advisory M…Center for Technical Education Innovation’s 2013 Spring General Advisory M…
Center for Technical Education Innovation’s 2013 Spring General Advisory M…
 
Spotlight on France: Learning About America's Oldest Ally!
Spotlight on France: Learning About America's Oldest Ally!Spotlight on France: Learning About America's Oldest Ally!
Spotlight on France: Learning About America's Oldest Ally!
 
Presentation2
Presentation2Presentation2
Presentation2
 
Onestatepres
OnestatepresOnestatepres
Onestatepres
 
Istanbul 1993
Istanbul 1993Istanbul 1993
Istanbul 1993
 
The Difference Between Print and Web Design
The Difference Between Print and Web DesignThe Difference Between Print and Web Design
The Difference Between Print and Web Design
 

Similar to Find Your Way with Sass+Compass

CSS 開發加速指南-Sass & Compass
CSS 開發加速指南-Sass & CompassCSS 開發加速指南-Sass & Compass
CSS 開發加速指南-Sass & CompassLucien Lee
 
SASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockSASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockMarco Pinheiro
 
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
 
Mobile-first OOCSS, Sass & Compass at BBC Responsive News
Mobile-first OOCSS, Sass & Compass at BBC Responsive NewsMobile-first OOCSS, Sass & Compass at BBC Responsive News
Mobile-first OOCSS, Sass & Compass at BBC Responsive NewsKaelig Deloumeau-Prigent
 
Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"
Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"
Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"bentleyhoke
 
Getting Started with Sass & Compass
Getting Started with Sass & CompassGetting Started with Sass & Compass
Getting Started with Sass & CompassRob Davarnia
 
Sassive Aggressive: Using Sass to Make Your Life Easier (Refresh Boston Version)
Sassive Aggressive: Using Sass to Make Your Life Easier (Refresh Boston Version)Sassive Aggressive: Using Sass to Make Your Life Easier (Refresh Boston Version)
Sassive Aggressive: Using Sass to Make Your Life Easier (Refresh Boston Version)Adam Darowski
 
Advanced Technology for Web Application Design
Advanced Technology for Web Application DesignAdvanced Technology for Web Application Design
Advanced Technology for Web Application DesignBryce Kerley
 
Using Sass - Building on CSS
Using Sass - Building on CSSUsing Sass - Building on CSS
Using Sass - Building on CSSSayanee Basu
 
Pacific Northwest Drupal Summit: Basic & SASS
Pacific Northwest Drupal Summit: Basic & SASSPacific Northwest Drupal Summit: Basic & SASS
Pacific Northwest Drupal Summit: Basic & SASSSteve Krueger
 
Wrangling the CSS Beast with Sass
Wrangling the CSS Beast  with SassWrangling the CSS Beast  with Sass
Wrangling the CSS Beast with SassRob Friesel
 
Modularization css with sass
Modularization css with sassModularization css with sass
Modularization css with sassHuiyi Yan
 
Compass And Sass(Tim Riley)
Compass And Sass(Tim Riley)Compass And Sass(Tim Riley)
Compass And Sass(Tim Riley)elliando dias
 
Work and play with SASS & Compass
Work and play with SASS & CompassWork and play with SASS & Compass
Work and play with SASS & CompassAndreas Dantz
 

Similar to Find Your Way with Sass+Compass (20)

Theming and Sass
Theming and SassTheming and Sass
Theming and Sass
 
CSS 開發加速指南-Sass & Compass
CSS 開發加速指南-Sass & CompassCSS 開發加速指南-Sass & Compass
CSS 開發加速指南-Sass & Compass
 
SASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockSASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, Greensock
 
Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)
 
Simple introduction Sass
Simple introduction SassSimple introduction Sass
Simple introduction Sass
 
Mobile-first OOCSS, Sass & Compass at BBC Responsive News
Mobile-first OOCSS, Sass & Compass at BBC Responsive NewsMobile-first OOCSS, Sass & Compass at BBC Responsive News
Mobile-first OOCSS, Sass & Compass at BBC Responsive News
 
Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"
Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"
Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"
 
Getting Started with Sass & Compass
Getting Started with Sass & CompassGetting Started with Sass & Compass
Getting Started with Sass & Compass
 
Sassive Aggressive: Using Sass to Make Your Life Easier (Refresh Boston Version)
Sassive Aggressive: Using Sass to Make Your Life Easier (Refresh Boston Version)Sassive Aggressive: Using Sass to Make Your Life Easier (Refresh Boston Version)
Sassive Aggressive: Using Sass to Make Your Life Easier (Refresh Boston Version)
 
Advanced Technology for Web Application Design
Advanced Technology for Web Application DesignAdvanced Technology for Web Application Design
Advanced Technology for Web Application Design
 
Using Sass - Building on CSS
Using Sass - Building on CSSUsing Sass - Building on CSS
Using Sass - Building on CSS
 
Pacific Northwest Drupal Summit: Basic & SASS
Pacific Northwest Drupal Summit: Basic & SASSPacific Northwest Drupal Summit: Basic & SASS
Pacific Northwest Drupal Summit: Basic & SASS
 
Wrangling the CSS Beast with Sass
Wrangling the CSS Beast  with SassWrangling the CSS Beast  with Sass
Wrangling the CSS Beast with Sass
 
Modularization css with sass
Modularization css with sassModularization css with sass
Modularization css with sass
 
A better CSS: Sass and Less - CC FE & UX
A better CSS: Sass and Less - CC FE & UXA better CSS: Sass and Less - CC FE & UX
A better CSS: Sass and Less - CC FE & UX
 
FCIP SASS Talk
FCIP SASS TalkFCIP SASS Talk
FCIP SASS Talk
 
Compass And Sass(Tim Riley)
Compass And Sass(Tim Riley)Compass And Sass(Tim Riley)
Compass And Sass(Tim Riley)
 
Sass compass
Sass compassSass compass
Sass compass
 
Work and play with SASS & Compass
Work and play with SASS & CompassWork and play with SASS & Compass
Work and play with SASS & Compass
 
SASS Preprocessor
SASS PreprocessorSASS Preprocessor
SASS Preprocessor
 

More from drywallbmb

Accessibility: Beginning the Journey
Accessibility: Beginning the JourneyAccessibility: Beginning the Journey
Accessibility: Beginning the Journeydrywallbmb
 
Do more, faster, by extending WP-CLI
Do more, faster, by extending WP-CLIDo more, faster, by extending WP-CLI
Do more, faster, by extending WP-CLIdrywallbmb
 
Accessibility: Beginning the Journey
Accessibility: Beginning the JourneyAccessibility: Beginning the Journey
Accessibility: Beginning the Journeydrywallbmb
 
Accelerating Custom Development with Dynamic Scaffolding and WP-CLI
Accelerating Custom Development with Dynamic Scaffolding and WP-CLIAccelerating Custom Development with Dynamic Scaffolding and WP-CLI
Accelerating Custom Development with Dynamic Scaffolding and WP-CLIdrywallbmb
 
Accelerating Custom Development with Dynamic Scaffolding and WP-CLI
Accelerating Custom Development with Dynamic Scaffolding and WP-CLIAccelerating Custom Development with Dynamic Scaffolding and WP-CLI
Accelerating Custom Development with Dynamic Scaffolding and WP-CLIdrywallbmb
 
Making Multisite Work for You
Making Multisite Work for YouMaking Multisite Work for You
Making Multisite Work for Youdrywallbmb
 
Front-End Performance Optimization in WordPress
Front-End Performance Optimization in WordPressFront-End Performance Optimization in WordPress
Front-End Performance Optimization in WordPressdrywallbmb
 
10 Cool Things You Can Do with Widgets
10 Cool Things You Can Do with Widgets10 Cool Things You Can Do with Widgets
10 Cool Things You Can Do with Widgetsdrywallbmb
 

More from drywallbmb (8)

Accessibility: Beginning the Journey
Accessibility: Beginning the JourneyAccessibility: Beginning the Journey
Accessibility: Beginning the Journey
 
Do more, faster, by extending WP-CLI
Do more, faster, by extending WP-CLIDo more, faster, by extending WP-CLI
Do more, faster, by extending WP-CLI
 
Accessibility: Beginning the Journey
Accessibility: Beginning the JourneyAccessibility: Beginning the Journey
Accessibility: Beginning the Journey
 
Accelerating Custom Development with Dynamic Scaffolding and WP-CLI
Accelerating Custom Development with Dynamic Scaffolding and WP-CLIAccelerating Custom Development with Dynamic Scaffolding and WP-CLI
Accelerating Custom Development with Dynamic Scaffolding and WP-CLI
 
Accelerating Custom Development with Dynamic Scaffolding and WP-CLI
Accelerating Custom Development with Dynamic Scaffolding and WP-CLIAccelerating Custom Development with Dynamic Scaffolding and WP-CLI
Accelerating Custom Development with Dynamic Scaffolding and WP-CLI
 
Making Multisite Work for You
Making Multisite Work for YouMaking Multisite Work for You
Making Multisite Work for You
 
Front-End Performance Optimization in WordPress
Front-End Performance Optimization in WordPressFront-End Performance Optimization in WordPress
Front-End Performance Optimization in WordPress
 
10 Cool Things You Can Do with Widgets
10 Cool Things You Can Do with Widgets10 Cool Things You Can Do with Widgets
10 Cool Things You Can Do with Widgets
 

Recently uploaded

TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 

Recently uploaded (20)

TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 

Find Your Way with Sass+Compass

  • 1. finding your way with sass+compass ben@cornershopcreative.com
  • 2. WHAT IS SASS? Sass is a CSS Pre-processor or meta-language Sass is a “competitor” to LESS and Stylus Sass is written in Ruby Sass is pretty cool
  • 3. WHAT IS COMPASS? Compass is an open-source library of Sass mixins. Compass is a CSS authoring framework. Compass is what makes Sass really, really useful.
  • 4. WHAT SASS DOES Introduces new things to CSS: • nested rules • variables • mixins • inheritance • and much more!
  • 5. GETTING GOING in your development environment* * you don’t need sass on prod!
  • 6. STEP BY STEP 1.Install ruby (I use rvm) $ curl -L https://get.rvm.io | bash -s stable --ruby 2.Install the compass “gem” $ gem update --system $ gem install compass 3.Install compass-normalize (optional) $ gem install compass-normalize 4.Confirm installation $ compass version
  • 7. STEP BY STEP 5. Set up a project! $ compass create <foldername> ...or... $ compass install compass --syntax sass live demo time!
  • 9. TWO SYNTAXES SCSS SASS .selector { .selector color: green; color: green border:1px solid $black; border:1px solid $black @include inline-block; +inline-block li { li display: block; display: block font: font: family: $sans; family: $sans size: 122%; size: 122% } @extend .navitem } .other-selector .other-selector {}
  • 10. THE PROCESS 1.Write your Sass 2.Compile your Sass into CSS 3.Include your CSS on prod 4.Bask in glory
  • 11. LET’S TRY IT showing is better than telling, right?
  • 12. WE JUST COVERED Compiling Sass files with compass watch and compass compile Using @imports and underscores to control our content Mucking with config.rb
  • 13. VARIABLES & MIXINS and some math, just for fun!
  • 14. VARIABLES $sans: “Helvetica Neue”, Helvetica, Arial, sans-serif $display: “Lobster”, Impact, serif $tiny: Verdana, sans-serif $evil: Comic Sans, sans-serif $where: left $radius: 5px $base: 14px $dark: #222 $light: #fff $seethru: rgba($light, 0.2) $grey: $dark + #444 //or lighten($dark, 40%) $red: #971219 doing this in _variables.sass is a good idea
  • 15. VARIABLES IN ACTION! .redtext color: $red article font: family: $sans size: $base color: $dark background-color: $seethru h1 font: #{$base * 2}/#{$base * 2.2} $display @extend .redtext &.title text-transform: uppercase .#{$where}-rail width: 200px
  • 16. MIXINS =notext overflow: hidden white-space: nowrap text-indent: 105% text-align: left =float( $dir: left ) float: $dir @if $dir == left margin: 0 10px 5px 0 @else margin: 0 0 5px 10px .alignleft +float(right)
  • 17. ENTER COMPASS mixin magic and more
  • 18. CROSS-BROWSER STUFF +opacity(0.6) filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=60); opacity: 0.6; +inline-block display: -moz-inline-stack; display: inline-block; vertical-align: middle; *vertical-align: auto; zoom: 1; *display: inline;
  • 19. MOAR CROSS-BROWSER +opacity(0.6) +clearfix +legacy-pie-clearfix +text-shadow(1px 2px 8px rgba(black, 0.3)) +box-shadow(inset 2px 4px 10px $red) +border-radius(8px) +box-sizing(border-box)
  • 20. FANCY CSS3 = EASY! +single-transition(all, 0.3s, ease) +rotate(20deg) +scale(1.2) +background-image(linear-gradient(top, $red, $red - #222)) http://compass-style.org/reference
  • 22. THE PROCESS 1.Create a sub-directory in /images/ 2.Save your sprite png’s in there 3.Tell Compass to create classes 4.Celebrate
  • 23. EXAMPLE // gives us .mysprites-[filename] @import "mysprites/*.png" $mysprites-sprite-dimensions: true //sets dimensions +all-mysprites-sprites /* so if images/mysprites/logo.png is 200x100, then... .mysprites-logo width: 200px; height: 100px; background: url(images/mysprites-3434034734.png) no-repeat; background-position: [whatever] [whatever]; */ h1#logo @extend .mysprites-logo
  • 24. OTHER STUFF random other tricks
  • 25. WELL THAT’S HANDY h1 font-size: 40px @media screen and (max-width: $break-small) font-size: 30px a.heading background-image: image-url(‘filename.jpg’) &:hover +scale(1.1) .no-csstransforms &:hover text-decoration: underline $fullwidth: 960px .rail width: percentage(220px/$fullwidth) margin: percentage(10px/$fullwidth)
  • 26. FOR MORE... http://sass-lang.com http://compass-style.org http://www.kaelig.fr/bettersassdocs/ http://thesassway.com
  • 27. CONNECT Ben Byrne ben@cornershopcreative.com facebook.com/drywall Twitter: @drywall