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

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
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
 
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
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
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
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
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
 
🐬 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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
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
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 

Recently uploaded (20)

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 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
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
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...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 

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