SlideShare a Scribd company logo
1 of 80
Download to read offline
Sassive Aggressive
Using Sass to make your life easier
Who?
Joel Oliveira          Adam Darowski
 Developer, The47th     Web Developer, PatientsLikeMe
What is Sass?
What is Sass?




sass-lang.com
What is Sass?
• CSS on steroids
• Adds Variables, Mixins, Nesting,
  Inheritance, and more…

• It’s a meta-language that compiles
  to plain old CSS

• Two “flavors” - Sass & SCSS
<rant>
Sass came first


body
  background-color: #fff
  color: #000
  font: 16px/1.6 Georgia
  margin: 0
SCSS came next


body {
  background-color: #fff;
  color: #000;
  font: 16px/1.6 Georgia;
  margin: 0;
}
body#home.home {
  .content {
    #learn-more {
      #faq {
        margin-top: 20px;
        aside {
          width: 300px;
          padding: 0 40px;
          h4 span {
             @include sans-serif-font(20px);
          }
          ul {
             color: #666;
             font-size: 12px;
             line-height: 1.5;
             list-style: square;
             padding-left: 1.2em;
             li {
               margin-bottom: 8px;
             {
             li:before {
               color: red;
             }
          }
        }
        ol {
          @include sans-serif-font(24px, $heading-color);
          list-style: decimal;
          max-width: 480px;
          p {
             font-size: 16px;
             margin: 1em 0;
          }
        }
      }
    }
  }
}
ol {
                  @include sans-serif-font(24px, $hea
                  list-style: decimal;
                  max-width: 480px;
                  p {
                     font-size: 16px;
                     margin: 1em 0;
                  }
                }
            }
        }
    }
}
body#home.home {
  .content {
    #learn-more {
      #faq {
        margin-top: 20px;
        aside {
          width: 300px;
          padding: 0 40px;
          h4 span {
             @include sans-serif-font(20px);
          }
          ul {
             color: #666;
             font-size: 12px;
             line-height: 1.5;
             list-style: square;
             padding-left: 1.2em;
             li {
               margin-bottom: 8px;
             {
             li:before {
               color: red;
             }
          }
        }
        ol {
          @include sans-serif-font(24px, $heading-color);
          list-style: decimal;
          max-width: 480px;
          p {
             font-size: 16px;
             margin: 1em 0;
          }
        }
      }
    }
  }
}
body#home.home {                                            body#home.home
  .content {                                                  .content
    #learn-more {                                               #learn-more
      #faq {                                                      #faq
        margin-top: 20px;                                           margin-top: 20px
        aside {                                                     aside
          width: 300px;                                                width: 300px
          padding: 0 40px;                                             padding: 0 40px
          h4 span {                                                    h4 span
             @include sans-serif-font(20px);                              @include sans-serif-font(20px)
          }                                                            ul
          ul {                                                            color: #666
             color: #666;                                                 font-size: 12px
             font-size: 12px;                                             line-height: 1.5
             line-height: 1.5;                                            list-style: square
             list-style: square;                                          padding-left: 1.2em
             padding-left: 1.2em;                                         li
             li {                                                            margin-bottom: 8px
               margin-bottom: 8px;                                        li:before
             {                                                               color: red
             li:before {                                            ol
               color: red;                                             @include sans-serif-font(24px, $heading-color)
             }                                                         list-style: decimal
          }                                                            max-width: 480px
        }                                                              p
        ol {                                                              font-size: 16px
          @include sans-serif-font(24px, $heading-color);                 margin: 1em 0
          list-style: decimal;
          max-width: 480px;
          p {
             font-size: 16px;
             margin: 1em 0;
          }
        }

    }
      }
                                          Sass > SCSS
  }
}
</rant>
Let’s talk about:
1. Nesting
2. Mix-ins
3. Organization and Refactoring
4. Math
5. Wrapping Up
Nesting
Mix-ins
.foo {
  -moz-border-radius: 10px;
  -webkit-border-radius: 10px;
  border-radius: 10px;
}
  -moz-border-radius: 10px;
  -webkit-border-radius: 10px;
  border-radius: 10px;
}

.bar {
  property: value;
  -moz-border-radius: 10px;
  -webkit-border-radius: 10px;
  border-radius: 10px;
}

.dude {
  property: value;
  property: value;
  -moz-border-radius: 10px;
  -webkit-border-radius: 10px;
  border-radius: 10px;
}

.guy {
  property: value;
  -moz-border-radius: 10px;
When using Sass…

.foo
  +border_radius(10px)


Will render as:
.foo {
  -moz-border-radius: 10px;
  -webkit-border-radius: 10px;
  border-radius: 10px;
}
The mixin:



@mixin border_radius($radius)
  -moz-border-radius: $radius
  -webkit-border-radius: $radius
  border-radius: $radius
Another example:

.foo
  +box_shadow(0, 0, 5px, #AAA)


Will render as:
.foo {
  -moz-box-shadow: 0 0 5px #AAA;
  -webkit-box-shadow: 0 0 5px #AAA;
  box-shadow: 0 0 5px #AAA;
}
Or, pre-populate the mixin:



  @mixin box_shadow($h_offset: 0, $v_offset: 0,
  -->$blur_radius: 5px, $color: #AAA)
    -moz-box-shadow: $h_offset $v_offset $blur_radius $color
    -webkit-box-shadow: $h_offset $v_offset $blur_radius $color
    box-shadow: $h_offset $v_offset $blur_radius $color




--> Denotes “not a real line break”
Now, no argument is needed:

.foo
  +box_shadow

Will render as:
.foo {
  -moz-box-shadow: 0 0 5px #AAA;
  -webkit-box-shadow: 0 0 5px #AAA;
  box-shadow: 0 0 5px #AAA;
}
Or, you can override:

.foo
  +box_shadow(2, 2, 10, #CCC)

Will render as:
.foo {
  -moz-box-shadow: 2px 2px 10px #CCC;
  -webkit-box-shadow: 2px 2px 10px #CCC;
  box-shadow: 2px 2px 10px #CCC;
}
Gradients!
   .foo
     +box_gradient(#FFFFFF, #000000)

   Will render as:
   .foo {
     background-image: -moz-linear-gradient(top, #FFFFFF,
     -->#000000)
     background-image: -o-linear-gradient(top, #FFFFFF,
     -->#000000);
     background-image: -webkit-gradient(linear,left top,left
     --> bottom,color-stop(0, #FFFFFF),color-stop(1, #000000))
     background-image: -webkit-linear-gradient(#FFFFFF,
     -->#000000)
     background-image: linear-gradient(top, #FFFFFF, #000000)
     filter: progid:DXImageTransform.Microsoft.gradient
     -->(startColorStr='#FFFFFF', EndColorStr='#000000')
   }

--> Denotes “not a real line break”         http://css3please.com/
The mixin:


  @mixin box_gradient($start,$end)
    background-image: -moz-linear-gradient(top, !start, !end)
    background-image: -o-linear-gradient(top, !start, !end);
    background-image: -webkit-gradient(linear,left top,left
    --> bottom,color-stop(0, !start),color-stop(1, !end))
    background-image: -webkit-linear-gradient(!start, !end)
    background-image: linear-gradient(top, !start, !end)
    filter: progid:DXImageTransform.Microsoft.gradient
    -->(startColorStr='!start', EndColorStr='!end')




--> Denotes “not a real line break”
http://tech.patientslikeme.com/2010/09/10/deconstructing-my-favorite-sass-mixin/
.dropdown-inner {
  -moz-border-radius: 0 3px 3px 3px;
  -webkit-border-radius: 0 3px 3px 3px;
  border-radius: 0 3px 3px 3px;
  -moz-box-shadow: 1px 1px 4px #CCC;
  -webkit-box-shadow: 1px 1px 4px #CCC;
  box-shadow: 1px 1px 4px #CCC;
  background-image: -moz-linear-gradient(top, #FFFFFF,
  -->#FCF5DE)
  background-image: -o-linear-gradient(top, #FFFFFF,
  -->#000000);
  background-image: -webkit-gradient(linear,left top,left
  --> bottom,color-stop(0, #FFFFFF),color-stop(1, #FCF5DE))
  background-image: -webkit-linear-gradient(#FFFFFF,
  -->#FCF5DE)
  background-image: linear-gradient(top, #FFFFFF, #FCF5DE)
  filter: progid:DXImageTransform.Microsoft.gradient
  -->(startColorStr='#FFFFFF', EndColorStr='#FCF5DE')
}
.dropdown-inner {
  +border_radius(0 3px 3px 3px
  -moz-border-radius: 03px 3px) 3px;
  +box_shadow(1, 1, 4, #CCC)
  -webkit-border-radius: 0 3px 3px 3px;
  border-radius: 0 3px 3px 3px;
  +box_gradient(#FFFFFF, #FCF5DE)
  -moz-box-shadow: 1px 1px 4px #CCC;
  -webkit-box-shadow: 1px 1px 4px #CCC;
  box-shadow: 1px 1px 4px #CCC;
  background-image: -moz-linear-gradient(top, #FFFFFF,
  -->#FCF5DE)
  background-image: -o-linear-gradient(top, #FFFFFF,
  -->#000000);
  background-image: -webkit-gradient(linear,left top,left
  --> bottom,color-stop(0, #FFFFFF),color-stop(1, #FCF5DE))
  background-image: -webkit-linear-gradient(#FFFFFF,
  -->#FCF5DE)
  background-image: linear-gradient(top, #FFFFFF, #FCF5DE)
  filter: progid:DXImageTransform.Microsoft.gradient
  -->(startColorStr='#FFFFFF', EndColorStr='#FCF5DE')
}
More with mixins:


• Re-usable interface elements (buttons,
  headers—with or without arguments).

• Reset styles (data tables, lists, etc.).
• References to frequently-accessed sprites.
• Frequently used IE hacks.
• Etc.
Organization &
 Refactoring
“.Class Soup”
Math
Color Manipulation:



.faded
  background-color: fade_out(#000, 0.4)


Will render as:
.faded {
  background-color: rgba(0, 0, 0, 0.6);
}
lighten & darken:



.lighter
  background-color: lighten(#000064, 30%)


Will render as:
.lighter {
  background-color: #4B4BFF;
}
complement



.comp
  background-color: complement(#000064)


Will render as:
.comp {
  background-color: #646400;
}
With a variable:


$default_color: #000064
.level1
  background-color: $default_color
.level2
  background-color: lighten($default_color,   15%)
.level3
  background-color: lighten($default_color,   30%)
.level4
  background-color: lighten($default_color,   45%)
.level5
  background-color: lighten($default_color,   60%)
With a variable:


.level1 {
  background-color:   #000064; }
.level2 {
  background-color:   #0000b1; }
.level3 {
  background-color:   #0000fd; }
.level4 {
  background-color:   #4b4bff; }
.level5 {
  background-color:   #9797ff; }
Simple math:

$container_width: 1000px
$photo_width: 480px
.caption
  width: $container_width - $photo_width

Will render as:
.caption {
  width: 520px;
}
https://github.com/adarowski/The-Hall-of-wWAR
<ul id="timeline-in">
  <li id="dwhite" class="3b level5">White</li>
  <li id="canson" class="1b hof level2">Anson</li>
  <li id="jorourke" class="hof lf level4">O'Rourke</li>
  <li id="pgalvin" class="p hof level2">Galvin</li>
  <li id="mward" class="hof ss level5">Ward</li>
  <li id="jmccormick" class="p level3">McCormick</li>
  <li id="kkelly" class="hof rf level5">Kelly</li>
  <li id="ggore" class="cf level5">Gore</li>
  <li id="jglasscock" class="ss level4">Glasscock</li>
  ...
  <li id="jbagwell" class="1b level2"></li>
</ul>
ul
  list-style: none
  padding: 40px 0 0
  margin: 0
li
  cursor: pointer
  margin: 0 0 5px
  padding: 0
  display: block
  padding: 2px
  color: white
  position: relative
We need
margin-left
 and width.
The mixin:



@mixin bar($start,$end)
  $start_value: $start - 1870
  margin-left: ($start_value*8) + px
  $length: $end - $start
  width: ($length*8) - 4px
The mixin:



@mixin bar($start,$end)
  $start_value: $start - 1870             Pass in
  margin-left: ($start_value*8) + px   arguments for
                                       start and end
  $length: $end - $start
                                            year.
  width: ($length*8) - 4px
The mixin:



@mixin bar($start,$end)
                                       $start_value is
  $start_value: $start - 1870
                                       the difference
  margin-left: ($start_value*8) + px    between the
  $length: $end - $start               start year and
  width: ($length*8) - 4px                 1870.
The mixin:



@mixin bar($start,$end)
  $start_value: $start - 1870              Multiply
                                       $start_value by
  margin-left: ($start_value*8) + px
                                       8 to get the left
  $length: $end - $start               margin (8 pixels
  width: ($length*8) - 4px                per year).
The mixin:



@mixin bar($start,$end)
  $start_value: $start - 1870          Career $length
                                       will be used to
  margin-left: ($start_value*8) + px
                                       determine the
  $length: $end - $start                width of the
  width: ($length*8) - 4px                   box.
The mixin:



@mixin bar($start,$end)
  $start_value: $start - 1870           Again, multiply
  margin-left: ($start_value*8) + px    by 8 to get the
                                        width, and also
  $length: $end - $start
                                       subtract 4 pixels
  width: ($length*8) - 4px                (padding).
The magic:

#jbagwell
  +bar(1991, 2005)


@mixin bar(1991,2005)
  $start_value: 1991 -   1870 = 121
  margin-left: (121*8)   + px = 968px
  $length: 2005 - 1991   = 14
  width: (14*8) - 4px)   = 108px
The magic:

#jbagwell
  +bar(1991, 2005)


Will render as:
#jbagwell {
  margin-left: 968px;
  width: 108px;
}
margin-left: 16px;
            width: 164px; }
          #pgalvin {

Repeat:     margin-left: 40px;
            width: 132px; }
          #kkelly {
            margin-left: 64px;
            width: 116px; }
          #mward {
            margin-left: 64px;
            width: 124px; }
          #dbrouthers {
            margin-left: 72px;
            width: 196px; }
          #mwelch {
            margin-left: 80px;
            width: 92px; }
          #tkeefe {
            margin-left: 80px;
            width: 100px; }
          #rconnor {
            margin-left: 80px;
            width: 132px; }
          #bewing {
            margin-left: 80px;
            width: 132px; }
          #cradbourn {
            margin-left: 88px;
            width: 76px; }
          #jclarkson {
            margin-left: 96px;
            width: 92px; }
          #bmcphee {
            margin-left: 96px;
            width: 132px; }
          #tmccarthy {
            margin-left: 112px;
            width: 92px; }
https://github.com/adarowski/The-Hall-of-wWAR
Wrapping Up
Installation
$ sudo gem install haml

c:> ruby gem install haml
Compiling?
$ sass --watch ./sass/:./css/
# all .sass files compiled into ./css

$ sass --update 
sass/style.sass:css/style.css
# ... style.sass => style.css
Compiling?
... on the what?
      blech...
Compiling?
... on the what?
      blech...
Compress / Minify
~/sites/designsponge joel $ ls -hal style.css
-rw-r--r-- 1 joel staff      32K Mar 18 11:26 style.css

~/sites/designsponge joel $ cp style.css style.scss

~/sites/designsponge joel $ sass -t compressed style.scss
style_compressed.css

~/sites/designsponge joel $ ls -hal *.*css
-rw-r--r-- 1 joel staff      32K Mar 18 11:26 style.css
-rw-r--r-- 1 joel staff      32K Mar 18 11:33 style.scss
-rw-r--r-- 1 joel staff      26K Mar 18 11:34 style_compressed.css
Compress / Minify
Resources
• sass-lang.com
• beta.compass-style.org
• @sasswatch
• wynn.fm/okc - @pengwynn
• rubyinstaller.org (windows)
• github.com/adarowski
• github.com/jayroh
Joel @jayroh

Adam @adarowski
Questions?

More Related Content

Viewers also liked

Sassive Aggressive: Level Up Your CSS with Sass
Sassive Aggressive: Level Up Your CSS with Sass Sassive Aggressive: Level Up Your CSS with Sass
Sassive Aggressive: Level Up Your CSS with Sass Adam Darowski
 
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
 
Liiikes: Using statistics to find the best content on Dribbble.
Liiikes: Using statistics to find the best content on Dribbble.Liiikes: Using statistics to find the best content on Dribbble.
Liiikes: Using statistics to find the best content on Dribbble.Adam Darowski
 
Is everything we used to do wrong?
Is everything we used to do wrong?Is everything we used to do wrong?
Is everything we used to do wrong?Russ Weakley
 
Sassive Aggressive: Level Up Your CSS with Sass
Sassive Aggressive: Level Up Your CSS with Sass Sassive Aggressive: Level Up Your CSS with Sass
Sassive Aggressive: Level Up Your CSS with Sass Adam Darowski
 
Accessible modal windows
Accessible modal windowsAccessible modal windows
Accessible modal windowsRuss Weakley
 
Three quick accessibility tips for HTML5
Three quick accessibility tips for HTML5Three quick accessibility tips for HTML5
Three quick accessibility tips for HTML5Russ Weakley
 
CSS: a rapidly changing world
CSS: a rapidly changing worldCSS: a rapidly changing world
CSS: a rapidly changing worldRuss Weakley
 
Specialise or cross-skill
Specialise or cross-skillSpecialise or cross-skill
Specialise or cross-skillRuss Weakley
 
CSS - OOCSS, SMACSS and more
CSS - OOCSS, SMACSS and moreCSS - OOCSS, SMACSS and more
CSS - OOCSS, SMACSS and moreRuss Weakley
 
Responsive Web Design - more than just a buzzword
Responsive Web Design - more than just a buzzwordResponsive Web Design - more than just a buzzword
Responsive Web Design - more than just a buzzwordRuss Weakley
 
Creating a Simple, Accessible On/Off Switch
Creating a Simple, Accessible On/Off SwitchCreating a Simple, Accessible On/Off Switch
Creating a Simple, Accessible On/Off SwitchRuss Weakley
 
CSS3 - is everything we used to do wrong?
CSS3 - is everything we used to do wrong? CSS3 - is everything we used to do wrong?
CSS3 - is everything we used to do wrong? Russ Weakley
 
CSS pattern libraries
CSS pattern librariesCSS pattern libraries
CSS pattern librariesRuss Weakley
 

Viewers also liked (19)

Sassive Aggressive: Level Up Your CSS with Sass
Sassive Aggressive: Level Up Your CSS with Sass Sassive Aggressive: Level Up Your CSS with Sass
Sassive Aggressive: Level Up Your CSS with Sass
 
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)
 
Liiikes: Using statistics to find the best content on Dribbble.
Liiikes: Using statistics to find the best content on Dribbble.Liiikes: Using statistics to find the best content on Dribbble.
Liiikes: Using statistics to find the best content on Dribbble.
 
The Hall of Stats
The Hall of StatsThe Hall of Stats
The Hall of Stats
 
Javascript status 2016
Javascript status 2016Javascript status 2016
Javascript status 2016
 
Is everything we used to do wrong?
Is everything we used to do wrong?Is everything we used to do wrong?
Is everything we used to do wrong?
 
Sassive Aggressive: Level Up Your CSS with Sass
Sassive Aggressive: Level Up Your CSS with Sass Sassive Aggressive: Level Up Your CSS with Sass
Sassive Aggressive: Level Up Your CSS with Sass
 
Accessible modal windows
Accessible modal windowsAccessible modal windows
Accessible modal windows
 
Three quick accessibility tips for HTML5
Three quick accessibility tips for HTML5Three quick accessibility tips for HTML5
Three quick accessibility tips for HTML5
 
CSS: a rapidly changing world
CSS: a rapidly changing worldCSS: a rapidly changing world
CSS: a rapidly changing world
 
Specialise or cross-skill
Specialise or cross-skillSpecialise or cross-skill
Specialise or cross-skill
 
CSS Best practice
CSS Best practiceCSS Best practice
CSS Best practice
 
CSS - OOCSS, SMACSS and more
CSS - OOCSS, SMACSS and moreCSS - OOCSS, SMACSS and more
CSS - OOCSS, SMACSS and more
 
Responsive Web Design - more than just a buzzword
Responsive Web Design - more than just a buzzwordResponsive Web Design - more than just a buzzword
Responsive Web Design - more than just a buzzword
 
Creating a Simple, Accessible On/Off Switch
Creating a Simple, Accessible On/Off SwitchCreating a Simple, Accessible On/Off Switch
Creating a Simple, Accessible On/Off Switch
 
CSS3 - is everything we used to do wrong?
CSS3 - is everything we used to do wrong? CSS3 - is everything we used to do wrong?
CSS3 - is everything we used to do wrong?
 
Snigdha
Snigdha Snigdha
Snigdha
 
CSS pattern libraries
CSS pattern librariesCSS pattern libraries
CSS pattern libraries
 
Build Features, Not Apps
Build Features, Not AppsBuild Features, Not Apps
Build Features, Not Apps
 

Similar to Sassive Aggressive: Using Sass to Make Your Life Easier (NSWG Version)

Stylesheets of the future with Sass and Compass
Stylesheets of the future with Sass and CompassStylesheets of the future with Sass and Compass
Stylesheets of the future with Sass and CompassDave Ross
 
cssstyle.cssbody { font-family Montserrat, Arial, sa
cssstyle.cssbody {    font-family Montserrat, Arial, sacssstyle.cssbody {    font-family Montserrat, Arial, sa
cssstyle.cssbody { font-family Montserrat, Arial, saMargenePurnell14
 
Wrangling the CSS Beast with Sass
Wrangling the CSS Beast  with SassWrangling the CSS Beast  with Sass
Wrangling the CSS Beast with SassRob Friesel
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008tutorialsruby
 
HTML&CSS 5 - Intermediate CSS (2/2)
HTML&CSS 5 - Intermediate CSS (2/2)HTML&CSS 5 - Intermediate CSS (2/2)
HTML&CSS 5 - Intermediate CSS (2/2)Dinis Correia
 
Demystifying CSS & WordPress
Demystifying CSS & WordPressDemystifying CSS & WordPress
Demystifying CSS & WordPressJustin Carmony
 
Save time by using SASS/SCSS
Save time by using SASS/SCSSSave time by using SASS/SCSS
Save time by using SASS/SCSSBerit Hlubek
 
CSS3 is Not Magic Pixie Dust
CSS3 is Not Magic Pixie DustCSS3 is Not Magic Pixie Dust
CSS3 is Not Magic Pixie DustKyle Adams
 
Finding a Better Way to CSS: Navigating Sass with Compass
Finding a Better Way to CSS: Navigating Sass with CompassFinding a Better Way to CSS: Navigating Sass with Compass
Finding a Better Way to CSS: Navigating Sass with CompassClaudina Sarahe
 
Bloggdesign #2 - hawaa.blogg.no
Bloggdesign #2 - hawaa.blogg.noBloggdesign #2 - hawaa.blogg.no
Bloggdesign #2 - hawaa.blogg.noHannee92
 
Week ThreeExpress Holidayscssstyle.csshtml{ height 100.docx
Week ThreeExpress Holidayscssstyle.csshtml{ height 100.docxWeek ThreeExpress Holidayscssstyle.csshtml{ height 100.docx
Week ThreeExpress Holidayscssstyle.csshtml{ height 100.docxphilipnelson29183
 

Similar to Sassive Aggressive: Using Sass to Make Your Life Easier (NSWG Version) (20)

Stylesheets of the future with Sass and Compass
Stylesheets of the future with Sass and CompassStylesheets of the future with Sass and Compass
Stylesheets of the future with Sass and Compass
 
Sass, Compass
Sass, CompassSass, Compass
Sass, Compass
 
cssstyle.cssbody { font-family Montserrat, Arial, sa
cssstyle.cssbody {    font-family Montserrat, Arial, sacssstyle.cssbody {    font-family Montserrat, Arial, sa
cssstyle.cssbody { font-family Montserrat, Arial, sa
 
Wrangling the CSS Beast with Sass
Wrangling the CSS Beast  with SassWrangling the CSS Beast  with Sass
Wrangling the CSS Beast with Sass
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
 
FCIP SASS Talk
FCIP SASS TalkFCIP SASS Talk
FCIP SASS Talk
 
Cloudstack UI Customization
Cloudstack UI CustomizationCloudstack UI Customization
Cloudstack UI Customization
 
HTML&CSS 5 - Intermediate CSS (2/2)
HTML&CSS 5 - Intermediate CSS (2/2)HTML&CSS 5 - Intermediate CSS (2/2)
HTML&CSS 5 - Intermediate CSS (2/2)
 
Demystifying CSS & WordPress
Demystifying CSS & WordPressDemystifying CSS & WordPress
Demystifying CSS & WordPress
 
Save time by using SASS/SCSS
Save time by using SASS/SCSSSave time by using SASS/SCSS
Save time by using SASS/SCSS
 
Theme04
Theme04Theme04
Theme04
 
This is a test
This is a testThis is a test
This is a test
 
Theme02
Theme02Theme02
Theme02
 
CSS3 is Not Magic Pixie Dust
CSS3 is Not Magic Pixie DustCSS3 is Not Magic Pixie Dust
CSS3 is Not Magic Pixie Dust
 
Finding a Better Way to CSS: Navigating Sass with Compass
Finding a Better Way to CSS: Navigating Sass with CompassFinding a Better Way to CSS: Navigating Sass with Compass
Finding a Better Way to CSS: Navigating Sass with Compass
 
Bloggdesign #2 - hawaa.blogg.no
Bloggdesign #2 - hawaa.blogg.noBloggdesign #2 - hawaa.blogg.no
Bloggdesign #2 - hawaa.blogg.no
 
Theme01
Theme01Theme01
Theme01
 
Week ThreeExpress Holidayscssstyle.csshtml{ height 100.docx
Week ThreeExpress Holidayscssstyle.csshtml{ height 100.docxWeek ThreeExpress Holidayscssstyle.csshtml{ height 100.docx
Week ThreeExpress Holidayscssstyle.csshtml{ height 100.docx
 
Css 2
Css 2Css 2
Css 2
 
Css
CssCss
Css
 

Recently uploaded

DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
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
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 

Recently uploaded (20)

DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
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
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 

Sassive Aggressive: Using Sass to Make Your Life Easier (NSWG Version)

  • 1. Sassive Aggressive Using Sass to make your life easier
  • 2. Who? Joel Oliveira Adam Darowski Developer, The47th Web Developer, PatientsLikeMe
  • 5. What is Sass? • CSS on steroids • Adds Variables, Mixins, Nesting, Inheritance, and more… • It’s a meta-language that compiles to plain old CSS • Two “flavors” - Sass & SCSS
  • 7. Sass came first body   background-color: #fff color: #000 font: 16px/1.6 Georgia margin: 0
  • 8. SCSS came next body {   background-color: #fff; color: #000; font: 16px/1.6 Georgia; margin: 0; }
  • 9. body#home.home { .content { #learn-more { #faq { margin-top: 20px; aside { width: 300px; padding: 0 40px; h4 span { @include sans-serif-font(20px); } ul { color: #666; font-size: 12px; line-height: 1.5; list-style: square; padding-left: 1.2em; li { margin-bottom: 8px; { li:before { color: red; } } } ol { @include sans-serif-font(24px, $heading-color); list-style: decimal; max-width: 480px; p { font-size: 16px; margin: 1em 0; } } } } } }
  • 10. ol { @include sans-serif-font(24px, $hea list-style: decimal; max-width: 480px; p { font-size: 16px; margin: 1em 0; } } } } } }
  • 11. body#home.home { .content { #learn-more { #faq { margin-top: 20px; aside { width: 300px; padding: 0 40px; h4 span { @include sans-serif-font(20px); } ul { color: #666; font-size: 12px; line-height: 1.5; list-style: square; padding-left: 1.2em; li { margin-bottom: 8px; { li:before { color: red; } } } ol { @include sans-serif-font(24px, $heading-color); list-style: decimal; max-width: 480px; p { font-size: 16px; margin: 1em 0; } } } } } }
  • 12. body#home.home { body#home.home .content { .content #learn-more { #learn-more #faq { #faq margin-top: 20px; margin-top: 20px aside { aside width: 300px; width: 300px padding: 0 40px; padding: 0 40px h4 span { h4 span @include sans-serif-font(20px); @include sans-serif-font(20px) } ul ul { color: #666 color: #666; font-size: 12px font-size: 12px; line-height: 1.5 line-height: 1.5; list-style: square list-style: square; padding-left: 1.2em padding-left: 1.2em; li li { margin-bottom: 8px margin-bottom: 8px; li:before { color: red li:before { ol color: red; @include sans-serif-font(24px, $heading-color) } list-style: decimal } max-width: 480px } p ol { font-size: 16px @include sans-serif-font(24px, $heading-color); margin: 1em 0 list-style: decimal; max-width: 480px; p { font-size: 16px; margin: 1em 0; } } } } Sass > SCSS } }
  • 14. Let’s talk about: 1. Nesting 2. Mix-ins 3. Organization and Refactoring 4. Math 5. Wrapping Up
  • 16.
  • 17.
  • 18.
  • 19.
  • 22.   -moz-border-radius: 10px;   -webkit-border-radius: 10px;   border-radius: 10px; } .bar {   property: value;   -moz-border-radius: 10px;   -webkit-border-radius: 10px;   border-radius: 10px; } .dude {   property: value;   property: value;   -moz-border-radius: 10px;   -webkit-border-radius: 10px;   border-radius: 10px; } .guy {   property: value;   -moz-border-radius: 10px;
  • 23. When using Sass… .foo   +border_radius(10px) Will render as: .foo {   -moz-border-radius: 10px;   -webkit-border-radius: 10px;   border-radius: 10px; }
  • 24. The mixin: @mixin border_radius($radius)   -moz-border-radius: $radius   -webkit-border-radius: $radius   border-radius: $radius
  • 25. Another example: .foo   +box_shadow(0, 0, 5px, #AAA) Will render as: .foo {   -moz-box-shadow: 0 0 5px #AAA;   -webkit-box-shadow: 0 0 5px #AAA;   box-shadow: 0 0 5px #AAA; }
  • 26. Or, pre-populate the mixin: @mixin box_shadow($h_offset: 0, $v_offset: 0, -->$blur_radius: 5px, $color: #AAA)   -moz-box-shadow: $h_offset $v_offset $blur_radius $color   -webkit-box-shadow: $h_offset $v_offset $blur_radius $color   box-shadow: $h_offset $v_offset $blur_radius $color --> Denotes “not a real line break”
  • 27. Now, no argument is needed: .foo   +box_shadow Will render as: .foo {   -moz-box-shadow: 0 0 5px #AAA;   -webkit-box-shadow: 0 0 5px #AAA;   box-shadow: 0 0 5px #AAA; }
  • 28. Or, you can override: .foo   +box_shadow(2, 2, 10, #CCC) Will render as: .foo {   -moz-box-shadow: 2px 2px 10px #CCC;   -webkit-box-shadow: 2px 2px 10px #CCC;   box-shadow: 2px 2px 10px #CCC; }
  • 29. Gradients! .foo   +box_gradient(#FFFFFF, #000000) Will render as: .foo {   background-image: -moz-linear-gradient(top, #FFFFFF, -->#000000) background-image: -o-linear-gradient(top, #FFFFFF, -->#000000);   background-image: -webkit-gradient(linear,left top,left --> bottom,color-stop(0, #FFFFFF),color-stop(1, #000000))   background-image: -webkit-linear-gradient(#FFFFFF, -->#000000)   background-image: linear-gradient(top, #FFFFFF, #000000)   filter: progid:DXImageTransform.Microsoft.gradient -->(startColorStr='#FFFFFF', EndColorStr='#000000') } --> Denotes “not a real line break” http://css3please.com/
  • 30. The mixin: @mixin box_gradient($start,$end)   background-image: -moz-linear-gradient(top, !start, !end) background-image: -o-linear-gradient(top, !start, !end);   background-image: -webkit-gradient(linear,left top,left --> bottom,color-stop(0, !start),color-stop(1, !end))   background-image: -webkit-linear-gradient(!start, !end)   background-image: linear-gradient(top, !start, !end)   filter: progid:DXImageTransform.Microsoft.gradient -->(startColorStr='!start', EndColorStr='!end') --> Denotes “not a real line break”
  • 32. .dropdown-inner {   -moz-border-radius: 0 3px 3px 3px;   -webkit-border-radius: 0 3px 3px 3px;   border-radius: 0 3px 3px 3px;   -moz-box-shadow: 1px 1px 4px #CCC;   -webkit-box-shadow: 1px 1px 4px #CCC;   box-shadow: 1px 1px 4px #CCC;   background-image: -moz-linear-gradient(top, #FFFFFF, -->#FCF5DE) background-image: -o-linear-gradient(top, #FFFFFF, -->#000000);   background-image: -webkit-gradient(linear,left top,left --> bottom,color-stop(0, #FFFFFF),color-stop(1, #FCF5DE))   background-image: -webkit-linear-gradient(#FFFFFF, -->#FCF5DE)   background-image: linear-gradient(top, #FFFFFF, #FCF5DE)   filter: progid:DXImageTransform.Microsoft.gradient -->(startColorStr='#FFFFFF', EndColorStr='#FCF5DE') }
  • 33. .dropdown-inner {   +border_radius(0 3px 3px 3px   -moz-border-radius: 03px 3px) 3px;   +box_shadow(1, 1, 4, #CCC)   -webkit-border-radius: 0 3px 3px 3px;   border-radius: 0 3px 3px 3px; +box_gradient(#FFFFFF, #FCF5DE)   -moz-box-shadow: 1px 1px 4px #CCC;   -webkit-box-shadow: 1px 1px 4px #CCC;   box-shadow: 1px 1px 4px #CCC;   background-image: -moz-linear-gradient(top, #FFFFFF, -->#FCF5DE) background-image: -o-linear-gradient(top, #FFFFFF, -->#000000);   background-image: -webkit-gradient(linear,left top,left --> bottom,color-stop(0, #FFFFFF),color-stop(1, #FCF5DE))   background-image: -webkit-linear-gradient(#FFFFFF, -->#FCF5DE)   background-image: linear-gradient(top, #FFFFFF, #FCF5DE)   filter: progid:DXImageTransform.Microsoft.gradient -->(startColorStr='#FFFFFF', EndColorStr='#FCF5DE') }
  • 34. More with mixins: • Re-usable interface elements (buttons, headers—with or without arguments). • Reset styles (data tables, lists, etc.). • References to frequently-accessed sprites. • Frequently used IE hacks. • Etc.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 47.
  • 48.
  • 49.
  • 50. Math
  • 51. Color Manipulation: .faded   background-color: fade_out(#000, 0.4) Will render as: .faded {   background-color: rgba(0, 0, 0, 0.6); }
  • 52. lighten & darken: .lighter   background-color: lighten(#000064, 30%) Will render as: .lighter {   background-color: #4B4BFF; }
  • 53. complement .comp   background-color: complement(#000064) Will render as: .comp {   background-color: #646400; }
  • 54. With a variable: $default_color: #000064 .level1 background-color: $default_color .level2 background-color: lighten($default_color, 15%) .level3 background-color: lighten($default_color, 30%) .level4 background-color: lighten($default_color, 45%) .level5 background-color: lighten($default_color, 60%)
  • 55. With a variable: .level1 { background-color: #000064; } .level2 { background-color: #0000b1; } .level3 { background-color: #0000fd; } .level4 { background-color: #4b4bff; } .level5 { background-color: #9797ff; }
  • 56. Simple math: $container_width: 1000px $photo_width: 480px .caption width: $container_width - $photo_width Will render as: .caption { width: 520px; }
  • 58. <ul id="timeline-in"> <li id="dwhite" class="3b level5">White</li> <li id="canson" class="1b hof level2">Anson</li> <li id="jorourke" class="hof lf level4">O'Rourke</li> <li id="pgalvin" class="p hof level2">Galvin</li> <li id="mward" class="hof ss level5">Ward</li> <li id="jmccormick" class="p level3">McCormick</li> <li id="kkelly" class="hof rf level5">Kelly</li> <li id="ggore" class="cf level5">Gore</li> <li id="jglasscock" class="ss level4">Glasscock</li> ... <li id="jbagwell" class="1b level2"></li> </ul>
  • 59. ul list-style: none padding: 40px 0 0 margin: 0 li cursor: pointer margin: 0 0 5px padding: 0 display: block padding: 2px color: white position: relative
  • 61. The mixin: @mixin bar($start,$end) $start_value: $start - 1870 margin-left: ($start_value*8) + px $length: $end - $start width: ($length*8) - 4px
  • 62. The mixin: @mixin bar($start,$end) $start_value: $start - 1870 Pass in margin-left: ($start_value*8) + px arguments for start and end $length: $end - $start year. width: ($length*8) - 4px
  • 63. The mixin: @mixin bar($start,$end) $start_value is $start_value: $start - 1870 the difference margin-left: ($start_value*8) + px between the $length: $end - $start start year and width: ($length*8) - 4px 1870.
  • 64. The mixin: @mixin bar($start,$end) $start_value: $start - 1870 Multiply $start_value by margin-left: ($start_value*8) + px 8 to get the left $length: $end - $start margin (8 pixels width: ($length*8) - 4px per year).
  • 65. The mixin: @mixin bar($start,$end) $start_value: $start - 1870 Career $length will be used to margin-left: ($start_value*8) + px determine the $length: $end - $start width of the width: ($length*8) - 4px box.
  • 66. The mixin: @mixin bar($start,$end) $start_value: $start - 1870 Again, multiply margin-left: ($start_value*8) + px by 8 to get the width, and also $length: $end - $start subtract 4 pixels width: ($length*8) - 4px (padding).
  • 67. The magic: #jbagwell +bar(1991, 2005) @mixin bar(1991,2005) $start_value: 1991 - 1870 = 121 margin-left: (121*8) + px = 968px $length: 2005 - 1991 = 14 width: (14*8) - 4px) = 108px
  • 68. The magic: #jbagwell +bar(1991, 2005) Will render as: #jbagwell { margin-left: 968px; width: 108px; }
  • 69. margin-left: 16px; width: 164px; } #pgalvin { Repeat: margin-left: 40px; width: 132px; } #kkelly { margin-left: 64px; width: 116px; } #mward { margin-left: 64px; width: 124px; } #dbrouthers { margin-left: 72px; width: 196px; } #mwelch { margin-left: 80px; width: 92px; } #tkeefe { margin-left: 80px; width: 100px; } #rconnor { margin-left: 80px; width: 132px; } #bewing { margin-left: 80px; width: 132px; } #cradbourn { margin-left: 88px; width: 76px; } #jclarkson { margin-left: 96px; width: 92px; } #bmcphee { margin-left: 96px; width: 132px; } #tmccarthy { margin-left: 112px; width: 92px; }
  • 72. Installation $ sudo gem install haml c:> ruby gem install haml
  • 73. Compiling? $ sass --watch ./sass/:./css/ # all .sass files compiled into ./css $ sass --update sass/style.sass:css/style.css # ... style.sass => style.css
  • 74. Compiling? ... on the what? blech...
  • 75. Compiling? ... on the what? blech...
  • 76. Compress / Minify ~/sites/designsponge joel $ ls -hal style.css -rw-r--r-- 1 joel staff 32K Mar 18 11:26 style.css ~/sites/designsponge joel $ cp style.css style.scss ~/sites/designsponge joel $ sass -t compressed style.scss style_compressed.css ~/sites/designsponge joel $ ls -hal *.*css -rw-r--r-- 1 joel staff 32K Mar 18 11:26 style.css -rw-r--r-- 1 joel staff 32K Mar 18 11:33 style.scss -rw-r--r-- 1 joel staff 26K Mar 18 11:34 style_compressed.css
  • 78. Resources • sass-lang.com • beta.compass-style.org • @sasswatch • wynn.fm/okc - @pengwynn • rubyinstaller.org (windows) • github.com/adarowski • github.com/jayroh