SlideShare a Scribd company logo
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 workshop
Shaho 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 Processors
Tristan Ashley
 
Css to-scss
Css to-scssCss to-scss
Css to-scss
frontendne
 
Write LESS. DO more.
Write LESS. DO more.Write LESS. DO more.
Write LESS. DO more.
Eugene Nor
 
Sass Essentials
Sass EssentialsSass Essentials
Sass Essentials
romiguelangel
 
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
 
Sass
SassSass
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
Wynn Netherland
 
Intro to css & sass
Intro to css & sassIntro to css & sass
Intro to css & sass
Sean 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 presentation
Mario Noble
 
LESS vs. SASS
LESS vs. SASSLESS vs. SASS
LESS vs. SASS
Austin Pickett
 
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
 
Graph Database Using Neo4J
Graph Database Using Neo4JGraph Database Using Neo4J
Graph Database Using Neo4J
Harmeet Singh(Taara)
 

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
 
Onestatepres
OnestatepresOnestatepres
Onestatepres
guestb2206c4
 
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 Design
drywallbmb
 

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 Finding your way with Sass+Compass

Theming and Sass
Theming and SassTheming and Sass
Theming and Sass
James Pearce
 
CSS 開發加速指南-Sass & Compass
CSS 開發加速指南-Sass & CompassCSS 開發加速指南-Sass & Compass
CSS 開發加速指南-Sass & Compass
Lucien Lee
 
SASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockSASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, Greensock
Marco 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 & Compass
Rob 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 CSS
Sayanee Basu
 
Pacific Northwest Drupal Summit: Basic & SASS
Pacific Northwest Drupal Summit: Basic & SASSPacific Northwest Drupal Summit: Basic & SASS
Pacific Northwest Drupal Summit: Basic & SASS
Steve Krueger
 
Wrangling the CSS Beast with Sass
Wrangling the CSS Beast  with SassWrangling the CSS Beast  with Sass
Wrangling the CSS Beast with Sass
Rob Friesel
 
Modularization css with sass
Modularization css with sassModularization css with sass
Modularization css with sass
Huiyi Yan
 
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
JWORKS powered by Ordina
 
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 & Compass
Andreas Dantz
 
SASS Preprocessor
SASS PreprocessorSASS Preprocessor
SASS Preprocessor
Webkul Software Pvt. Ltd.
 

Similar to Finding 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 Journey
drywallbmb
 
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
drywallbmb
 
Accessibility: Beginning the Journey
Accessibility: Beginning the JourneyAccessibility: Beginning the Journey
Accessibility: Beginning the Journey
drywallbmb
 
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
drywallbmb
 
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
drywallbmb
 
Making Multisite Work for You
Making Multisite Work for YouMaking Multisite Work for You
Making Multisite Work for You
drywallbmb
 
Front-End Performance Optimization in WordPress
Front-End Performance Optimization in WordPressFront-End Performance Optimization in WordPress
Front-End Performance Optimization in WordPress
drywallbmb
 
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
drywallbmb
 

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

Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 

Recently uploaded (20)

Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 

Finding 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