SlideShare une entreprise Scribd logo
1  sur  116
Télécharger pour lire hors ligne
COMPASS, SASS, AND THE ENLIGHTENED WEB


                             WYNNNETHERLAND
whoami
+
or “Okie” in the local
Native Oklahoman        vernacular.




              Naturalized Texan
Like you, I work on the Interwebs.
... but my story begins in
the

DARK AGES
Literally.




   this still works :
brew install lynx
gopher://      anyone?
    look it up, kids.
Flight of the Navigator




 technology from the future!
These were perilous times.
Full of strange magic.
<font>
<center>
<blink>
<table>
  <tr>
    <td valign=top>Remember this?</td>
    <td>
    <table>
         <tr>
           <td>And this?</td>
         </tr>
       </table>
    </td>
  </tr>

                        Nested tables FTW.
  </tr>
</table>
JavaScript vs. JScript
Sometimes we’d hide these and
update the page without a refresh, back
when Ajax was something Momma used to
clean the bathtub.
DOM level 0.
document.formName.inputName
Why am I sharing all this?
Consider it inoculation against
CURMUDGEONRY.
THAT’S THE
WAY IT WAS AND
WE LIKED IT.
“GET OFF
 MY LAWN.”
 Nathan Smith
 Creator, 960.gs
 RefreshOKC headliner
 Reformed Curmudgeon
Back to our story
the

RENAISSANCE
JavaScript Frameworks
CSS Frameworks
HTML5
CSS3
border-radius
border-image
www.zurb.com/playground/awesome-overlays
background-size
gradients
RGBA, HSL, HSLA colors

rgba (0,0,0,1) is the new black!
text-shadow
box-shadow
word
wrap
outline
columns
@font-face
       means

Typographic freedom!
Cool
       New selectors
CSS3 selectors (and some golden oldies)
          *                 ::first-letter                   :enabled
          E                   :first-line                   :disabled
       .class                 ::first-line                   :checked
         #id              E[attribute^=value]                 :header
         E F              E[attribute$=value]
        E > F             E[attribute*=value]
        E + F                     E ~ F
    E[attribute]                  :root       Steal   this from jQuery, please
E[attribute=value]            :last-child
E[attribute~=value]           :only-child
E[attribute|=value]           :nth-child()
    :first-child           :nth-last-child()
        :link               :first-of-type
      :visited               :last-of-type
      :lang()                :only-of-type
      :before               :nth-of-type()
      ::before            :nth-last-of-type()
       :after                    :empty
      ::after                    :not()
   :first-letter                :target
This is not a talk about CSS
Follow @smashingmag for your CSS tips & tricks
I want to talk about

        REAL stylesheet innovation
I want to talk about

        HOW we write stylesheets
I want to talk about

     how we MAINTAIN stylesheets
I want to talk about

      how we SIMPLIFY stylesheets
We're gonna see a brave new
world where they run everybody a
wire and hook us all up to a grid.
Yes, sir, a veritable age of reason.
Like the one they had in France.
Not a moment too soon.

~ Ulysses Everett McGill
the
AGE OF ENLIGHTENMENT
Sass
Syntax options
Syntax options - SCSS   Sassy CSS!


table.users {
  tr {
    td {
       background: #d1d1d;
       a {
         color: #111;
       }
    }
  }
}
Syntax options - Indented   I   whitespace


table.users
  tr
     td
        background: #d1d1d
        a
          color: #111
Nested rules
Nested rules - selectors
table.users tr td a {color: #111}

table.users tr.alt td a {color: #333}
Nested rules - selectors
table.users                Lo  o k , Ma,
  tr                        n o braces
     td
        a
          color: #111                or semicolons
     td.alt
        a
          color: #333
                                  But you can use
                                 both if you wanna
Nested rules - selectors
table.users
  tr
                           C ha nge this
     td
        color: #111
        &.alt                         you chang e these
                           . . . an d
          color: #333
        &:hover
          color: #666
Nested rules - properties
.users
  font:
    size: 1.2em
    style: italics
    weight: bold
Variables
Variables
.user {
  background: #333;
  border-size: 2px;
}

.owner {
  background: #333;
  border-size: 2px;
}

.admin {
  background: #666;
  border-size: 4px;
}
Variables
!gray = #333
!default_border = 2px

.user
  background: = !gray
  border-size: = !default_border

.owner

                                            r mixing!
  background: = !gray
  border-size: = !default_border   and colo
.admin                                Ev  e n ma t h !
  background: = !gray + #333
  border-size: = !default_border + 2px
Variables
 $font-apres:           Apres, Arial, sans-serif
 $dark-gray:            #1e1e1e !default
 $body-text:            #bbb !default
 $strong-text:          lighten($body-text, 40%)
 $muted-text:           darken($body-text, 40%)
 $content-background:   #fff
 $content-text:         #555
 $content-border:       #ccc
 $form-background:      rgba(0, 0, 0, .5)

 $blue-primary:         #6095c2
 $blue-secondary:       #1742db
 $green-primary:        #64b900
 $green-secondary:      #298527
 $pink-primary:         #f44ab7
Mixins
Mixins
.avatar {
  padding: 2px;
  border: solid 1px #ddd;
  position: absolute;
  top: 5px;
  left: 5px;
}

p img {
  padding: 2px;
  border: solid 1px #ddd;
}
Mixins
=frame(!padding_width = 2px, !border_color = #ddd)
  padding = !padding_width
  border:
    width: 1px
                                             defines   t he mixin
    style: solid
    color = !border_color

.avatar
  +frame
  position: absolute
  top: 5px
                       mixes in t h e rule s
  left: 5px

p img
  +frame(1px, #ccc)
Selector inheritance
Selector inheritance
.flash {
  padding: 5px;
  border-width: 1px;
  font-weight: bold;
}
.error {
  color: #8a1f11;
  background: #fbe3e4;
}
.notice {
  color: #514721;
  background: #fff6bf;
}
Selector inheritance
.flash
  padding: 5px
  border-width: 1px
  font-weight: bold

.error.flash
  color: #8a1f11
  background: #fbe3e4

.notice.flash
  color: #514721
  background: #fff6bf
Selector inheritance
.flash,
.error,
.notice { padding: 5px; border-width: 1px; font-weight: bold; }

.error { color: #8a1f11; background: #fbe3e4; }

.notice { color: #514721; background: #fff6bf; }



                   now we can use a single class in our markup
Imports
Imports
@import url(/css/reset.css)
@import url(/css/typography.css)
@import url(/css/layout.css)


    parent + 3 @imports = 4 http requests
Imports
@import reset.sass          #   _reset.sass
@import typography.sass     #   _typography.sass
@import layout.sass         #   _layout.sass


          Included at compile time -
             just one http request
Imports + Mixins

  Now it gets fun!
Compass CSS3 mixins
@import compass/css3.sass

.callout
  +border-radius(5px)
  +linear-gradient("left top", "left bottom", #fff, #ddd)



.callout {                             very different syntax
  -moz-border-radius: 5px;
  -webkit-border-radius: 5px;
  -border-radius: 5px;
  background-image: -moz-linear-gradient(top, bottom, from(#fff), to
(#ddd));
  background-image: -webkit-gradient(linear, left top, left bottom,
color-stop(0.00, #fff), color-stop(1.00, #ddd));
}
Compass CSS3 mixins
css3/border_radius.sass
css3/inline_block.sass
css3/opacity.sass
css3/text_shadow.sass
css3/box_shadow.sass
css3/columns.sass
css3/box_sizing.sass
css3/gradient.sass
css3/background_clip.sass
css3/background_origin.sass
css3/background_size.sass
css3/font_face.sass
css3/transform.sass
css3/transition.sass
Bring your favorite CSS Framework
A Blueprint example
<div id='wrapper' class="container">
    <div id='content' class="span-7 prepend-1">
        <div id='main' class="container">

                                                      boo
            ...
        </div>
        <div id='featured' class="span-5 last">
            ...
        </div>
    </div>
    <div id='sidebar' class="span-3 append-1 last">
        ...
    </div>
</div>
A Blueprint example
@import   blueprint/reset.sass
@import   partials/base.sass
@import   blueprint
@import   blueprint/modules/scaffolding.sass


#wrapper
  +container
  #content
    +column(7)
    +append(1)
    #featured
      +column(5, true)
  #sidebar
    +column(3, true)
    +prepend(1)
Functions
Very. Powerful. Functions.
Sass 2.4 color functions
hue(#cc3) => 60deg
saturation(#cc3) => 60%
lightness(#cc3) => 50%

adjust-hue(#cc3, 20deg) => #9c3
saturate(#cc3, 10%) => #d9d926
desaturate(#cc3, 10%) => #bfbf40
lighten(#cc3, 10%) => #d6d65c
darken(#cc3, 10%) => #a3a329

grayscale(#cc3) => desaturate(#cc3, 100%) = #808080
complement(#cc3) => adjust-hue(#cc3, 180deg) = #33c

mix(#cc3, #00f) => #e56619
mix(#cc3, #00f, 10%) => #f91405
mix(#cc3, #00f, 90%) => #d1b72d




http://nex-3.com/posts/89-powerful-color-manipulation-with-sass
with alpha support!
Sass 2.4 color functions
mix(rgba(51, 255, 51, 0.75), #f00) => rgba(178, 95, 19, 0.875)
mix(rgba(51, 255, 51, 0.90), #f00) => rgba(163, 114, 22, 0.95)

alpha(rgba(51, 255, 51, 0.75)) => 0.75
opacity(rgba(51, 255, 51, 0.75)) => 0.75

opacify(rgba(51, 255, 51, 0.75), 0.1) => rgba(51, 255, 51, 0.85)
fade-in(rgba(51, 255, 51, 0.75), 0.1) => rgba(51, 255, 51, 0.85)

transparentize(rgba(51, 255, 51, 0.75), 0.1) => rgba(51, 255, 51, 0.65)
fade-out(rgba(51, 255, 51, 0.75), 0.1) => rgba(51, 255, 51, 0.65)




http://nex-3.com/posts/89-powerful-color-manipulation-with-sass
Who makes this syntactic sugar?
Patte
       xtens io n s &             rns &
C SS e                       plugins
     co mpiler

             Sass and Compass
...like peas and carrots.
Sass and Compass
$ sudo gem install haml
$ sudo gem install compass --pre




CALL IT FROM THE COMMAND LINE
$ sass screen.sass screen.css


OR COMPASS-IZE YOUR PROJECT
$ compass --rails -f blueprint


OR WATCH A FOLDER
$ compass --watch
A quick survey of Compass
Blueprint
Blueprint
 ★ Buttons             ★ Link Icons
 ★ Colors              ★ Liquid
 ★ Debug               ★ Print
 ★ Fancy Type          ★ Reset
 ★ Form                ★ Rtl
 ★ Grid                ★ Scaffolding
 ★ Interaction         ★ Typography
 ★ Internet Explorer   ★ Utilities
CSS3
CSS3
 ★ Appearance          ★ Gradient
 ★ Background Clip     ★ Images
 ★ Background Origin   ★ Inline Block
 ★ Background Size     ★ Opacity
 ★ Border Radius       ★ Shared Utilities
 ★ Box                 ★ Text Shadow
 ★ Box Shadow          ★ Transform
 ★ Box Sizing          ★ Transform (legacy)
 ★ CSS3 Pie            ★ Transition
 ★ Columns
 ★ Font Face
Image sprites
I like the Sprite in you
   Image sprites                                                                  ®




                                                                                             1.
                                                     @import "icon/*.png"
@import "icon/*.png"

.actions     2.                                      public/images/icon/new.png
                                                     public/images/icon/edit.png
  .new
                                                     public/images/icon/save.png
    +icon-sprite(new)
                                                     public/images/icon/delete.png
  .edit
    +icon-sprite(edit)
  .save                     .icon-sprite,
    +icon-sprite(save)      .actions .new,
  .delete                   .actions .edit,
    +icon-sprite(delete)    .actions .save,
                            .actions .delete
                            { background: url('/images/icon-34fe0604ab.png') no-repeat; }

                            .actions   .new      {   background-position:   0   -64px;   }
                            .actions   .edit     {   background-position:   0   -32px;   }
                            .actions   .save     {   background-position:   0   -96px;   }

                       3.
                            .actions   .delete   {   background-position:   0   0;       }
URL helpers
URL helpers
#nav
  background: image-url("nav_bg.png") repeat-x top center



DEVELOPMENT
#nav {
  background: url("/images/nav_bg.png") repeat-x top center;
}

                                                           elopment,
                                                ths for dev
                                    relative pa
PRODUCTION                                             production
                                         a bsolute for
#nav {
  background: url("http://assets.example.com/images/nav_bg.png")
repeat-x top center;
}
URL helpers
stylesheet-url($path)

font-url($path)

image-url($path)
Share your patterns
http://brandonmathis.com/projects/fancy-buttons/
@import "fancy-buttons"
button,
a.button
  +fancy-button(#2966a8)
compass-960
Compass 960
 $ninesixty-columns: 16


 #wrap
   +grid-container
   #left-nav
     +alpha
     +grid(5)
   #main-content
     +grid-prefix(1)
     +grid(10)
     +omega




https://github.com/chriseppstein/compass-960-plugin
compass-wordpress
shameless plug
Compass and WordPress
$ gem install compass-wordpress


CRANK OUT A NEW SASS-Y WORDPRESS THEME
$ compass -r compass-wordpress 
        -f wordpress  -p thematic 
        --sass-dir=sass --css-dir=css 
        -s compressed my_awesome_theme


AUTOCOMPILE YOUR CHANGES
$ compass --watch
Announcing!
compass-formalize
Compass and Formalize
INSTALL THE GEM
$ gem install compass_formalize


CREATE THE COMPASS PROJECT
$ compass create my-great-app -r compass_formalize

$ cd my-great-app


APPLY THE PATTERN
$ compass install formalize/jquery
Stats
Stats
|   ---------------------------------   |   -----   |   ----------   |   --------------   |   -----------   |   ---------   |   --------------   |
|   Filename                            |   Rules   |   Properties   |      Mixins Defs   |   Mixins Used   |   CSS Rules   |   CSS Properties   |
|   ---------------------------------   |   -----   |   ----------   |   --------------   |   -----------   |   ---------   |   --------------   |
|   app/stylesheets/_960.sass           |     198   |          141   |                0   |             0   |          --   |               --   |
|   app/stylesheets/_animation.sass     |       2   |            2   |                0   |             0   |          --   |               --   |
|   app/stylesheets/application.sass    |     268   |          607   |                0   |            33   |        1131   |             3684   |
|   app/stylesheets/_data_table.sass    |      39   |           66   |                0   |             4   |          --   |               --   |
|   app/stylesheets/_datepicker.sass    |     125   |          242   |                0   |             0   |          --   |               --   |
|   app/stylesheets/_formalize.sass     |      82   |           78   |                0   |             4   |          --   |               --   |
|   app/stylesheets/_forms.sass         |     227   |          242   |                0   |            21   |          --   |               --   |
|   app/stylesheets/ie.sass             |       0   |            0   |                0   |             0   |           0   |                0   |
|   app/stylesheets/_jscrollpane.sass   |      20   |           43   |                0   |             0   |          --   |               --   |
|   app/stylesheets/_prettify.sass      |      16   |           16   |                0   |             0   |          --   |               --   |
|   app/stylesheets/print.sass          |       0   |            0   |                0   |             0   |           0   |                0   |
|   app/stylesheets/_reset.sass         |     111   |           18   |                0   |             0   |          --   |               --   |
|   app/stylesheets/_text.sass          |      27   |           18   |                0   |             0   |          --   |               --   |
|   app/stylesheets/_tiptip.sass        |      19   |           40   |                0   |             0   |          --   |               --   |
|   app/stylesheets/_util.sass          |      56   |           54   |                0   |             0   |          --   |               --   |
|   app/stylesheets/_vars.sass          |       0   |            6   |                2   |             0   |          --   |               --   |
|   ---------------------------------   |   -----   |   ----------   |   --------------   |   -----------   |   ---------   |   --------------   |
|   Total (16 files):                   |    1190   |         1573   |                2   |            62   |        1131   |             3684   |
|   ---------------------------------   |   -----   |   ----------   |   --------------   |   -----------   |   ---------   |   --------------   |
Isn’t she Sassy, folks?




GET
THE
BOOK.
Save 40% and get early access!


           sass40

Sadly, sass100 is not a valid code.
Resources     an d thanks for having me!


sass-lang.com
beta.compass-style.org


                               slides!
wynn.fm/okc
                    gra b t he

     blog:    wynnnetherland.com
     twitter: @pengwynn
     email: wynn@hp.com

     linkedin.com/in/netherland

Contenu connexe

Tendances

Raleigh Web Design Meetup Group - Sass Presentation
Raleigh Web Design Meetup Group - Sass PresentationRaleigh Web Design Meetup Group - Sass Presentation
Raleigh Web Design Meetup Group - Sass PresentationDaniel Yuschick
 
SASS is more than LESS
SASS is more than LESSSASS is more than LESS
SASS is more than LESSItai Koren
 
Bringing sexy back to CSS: SASS/SCSS, LESS and Compass
Bringing sexy back to CSS: SASS/SCSS, LESS and CompassBringing sexy back to CSS: SASS/SCSS, LESS and Compass
Bringing sexy back to CSS: SASS/SCSS, LESS and CompassClaudina Sarahe
 
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programingRuby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programingBozhidar Batsov
 
Finding your way with Sass+Compass
Finding your way with Sass+CompassFinding your way with Sass+Compass
Finding your way with Sass+Compassdrywallbmb
 
LESS CSS Pre-processor
LESS CSS Pre-processorLESS CSS Pre-processor
LESS CSS Pre-processorKannika Kong
 
Xlrays online web tutorials
Xlrays online web tutorialsXlrays online web tutorials
Xlrays online web tutorialsYogesh Gupta
 
Sass and Compass - Getting Started
Sass and Compass - Getting StartedSass and Compass - Getting Started
Sass and Compass - Getting Startededgincvg
 
Simple introduction Sass
Simple introduction SassSimple introduction Sass
Simple introduction SassZeeshan Ahmed
 
CSS Preprocessors: LESS is more or look SASS-y trying
CSS Preprocessors: LESS is more or look SASS-y tryingCSS Preprocessors: LESS is more or look SASS-y trying
CSS Preprocessors: LESS is more or look SASS-y tryingJames Cryer
 
Keep calm and let's play CSS3
Keep calm and let's play CSS3Keep calm and let's play CSS3
Keep calm and let's play CSS3A2 Comunicação
 
Software programming tools for creating/managing CSS files
Software programming tools for creating/managing CSS filesSoftware programming tools for creating/managing CSS files
Software programming tools for creating/managing CSS filesDinu Suman
 
Wrangling the CSS Beast with Sass
Wrangling the CSS Beast  with SassWrangling the CSS Beast  with Sass
Wrangling the CSS Beast with SassRob Friesel
 
The Near Future of CSS
The Near Future of CSSThe Near Future of CSS
The Near Future of CSSRachel Andrew
 
HTML5, CSS, JavaScript Style guide and coding conventions
HTML5, CSS, JavaScript Style guide and coding conventionsHTML5, CSS, JavaScript Style guide and coding conventions
HTML5, CSS, JavaScript Style guide and coding conventionsKnoldus Inc.
 

Tendances (20)

Raleigh Web Design Meetup Group - Sass Presentation
Raleigh Web Design Meetup Group - Sass PresentationRaleigh Web Design Meetup Group - Sass Presentation
Raleigh Web Design Meetup Group - Sass Presentation
 
SASS is more than LESS
SASS is more than LESSSASS is more than LESS
SASS is more than LESS
 
Bringing sexy back to CSS: SASS/SCSS, LESS and Compass
Bringing sexy back to CSS: SASS/SCSS, LESS and CompassBringing sexy back to CSS: SASS/SCSS, LESS and Compass
Bringing sexy back to CSS: SASS/SCSS, LESS and Compass
 
JSON and the APInauts
JSON and the APInautsJSON and the APInauts
JSON and the APInauts
 
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programingRuby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
 
Finding your way with Sass+Compass
Finding your way with Sass+CompassFinding your way with Sass+Compass
Finding your way with Sass+Compass
 
LESS CSS Pre-processor
LESS CSS Pre-processorLESS CSS Pre-processor
LESS CSS Pre-processor
 
Xlrays online web tutorials
Xlrays online web tutorialsXlrays online web tutorials
Xlrays online web tutorials
 
Sass and Compass - Getting Started
Sass and Compass - Getting StartedSass and Compass - Getting Started
Sass and Compass - Getting Started
 
Simple introduction Sass
Simple introduction SassSimple introduction Sass
Simple introduction Sass
 
CSS Preprocessors: LESS is more or look SASS-y trying
CSS Preprocessors: LESS is more or look SASS-y tryingCSS Preprocessors: LESS is more or look SASS-y trying
CSS Preprocessors: LESS is more or look SASS-y trying
 
Keep calm and let's play CSS3
Keep calm and let's play CSS3Keep calm and let's play CSS3
Keep calm and let's play CSS3
 
LESS
LESSLESS
LESS
 
Software programming tools for creating/managing CSS files
Software programming tools for creating/managing CSS filesSoftware programming tools for creating/managing CSS files
Software programming tools for creating/managing CSS files
 
Wrangling the CSS Beast with Sass
Wrangling the CSS Beast  with SassWrangling the CSS Beast  with Sass
Wrangling the CSS Beast with Sass
 
Sass
SassSass
Sass
 
The Near Future of CSS
The Near Future of CSSThe Near Future of CSS
The Near Future of CSS
 
CSS Grid Layout
CSS Grid LayoutCSS Grid Layout
CSS Grid Layout
 
Document
DocumentDocument
Document
 
HTML5, CSS, JavaScript Style guide and coding conventions
HTML5, CSS, JavaScript Style guide and coding conventionsHTML5, CSS, JavaScript Style guide and coding conventions
HTML5, CSS, JavaScript Style guide and coding conventions
 

Similaire à Compass, Sass, and the Enlightened CSS Developer

Preprocessor presentation
Preprocessor presentationPreprocessor presentation
Preprocessor presentationMario Noble
 
Advanced Technology for Web Application Design
Advanced Technology for Web Application DesignAdvanced Technology for Web Application Design
Advanced Technology for Web Application DesignBryce Kerley
 
Getting Started with Sass & Compass
Getting Started with Sass & CompassGetting Started with Sass & Compass
Getting Started with Sass & CompassRob Davarnia
 
LESS(CSS preprocessor)
LESS(CSS preprocessor)LESS(CSS preprocessor)
LESS(CSS preprocessor)VIPIN KUMAR
 
Learn to Love CSS3 [English]
Learn to Love CSS3 [English]Learn to Love CSS3 [English]
Learn to Love CSS3 [English]ThemePartner
 
Learn to love CSS3 | Joomla! Day Deutschland
Learn to love CSS3 | Joomla! Day DeutschlandLearn to love CSS3 | Joomla! Day Deutschland
Learn to love CSS3 | Joomla! Day DeutschlandThemePartner
 
Prototyping w/HTML5 and CSS3
Prototyping w/HTML5 and CSS3Prototyping w/HTML5 and CSS3
Prototyping w/HTML5 and CSS3Todd Zaki Warfel
 
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
 
Compass And Sass(Tim Riley)
Compass And Sass(Tim Riley)Compass And Sass(Tim Riley)
Compass And Sass(Tim Riley)elliando dias
 
Write LESS. DO more.
Write LESS. DO more.Write LESS. DO more.
Write LESS. DO more.Eugene Nor
 
CSS Less framework overview, Pros and Cons
CSS Less framework overview, Pros and ConsCSS Less framework overview, Pros and Cons
CSS Less framework overview, Pros and ConsSanjoy Kr. Paul
 
Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)emrox
 
Rapid Prototyping
Rapid PrototypingRapid Prototyping
Rapid PrototypingEven Wu
 
HTML5, CSS3, and other fancy buzzwords
HTML5, CSS3, and other fancy buzzwordsHTML5, CSS3, and other fancy buzzwords
HTML5, CSS3, and other fancy buzzwordsMo Jangda
 
CSS3 is Not Magic Pixie Dust
CSS3 is Not Magic Pixie DustCSS3 is Not Magic Pixie Dust
CSS3 is Not Magic Pixie DustKyle Adams
 
CSS: A Slippery Slope to the Backend
CSS: A Slippery Slope to the BackendCSS: A Slippery Slope to the Backend
CSS: A Slippery Slope to the BackendFITC
 

Similaire à Compass, Sass, and the Enlightened CSS Developer (20)

Preprocessor presentation
Preprocessor presentationPreprocessor presentation
Preprocessor presentation
 
DotNetNuke World CSS3
DotNetNuke World CSS3DotNetNuke World CSS3
DotNetNuke World CSS3
 
Advanced Technology for Web Application Design
Advanced Technology for Web Application DesignAdvanced Technology for Web Application Design
Advanced Technology for Web Application Design
 
Getting Started with Sass & Compass
Getting Started with Sass & CompassGetting Started with Sass & Compass
Getting Started with Sass & Compass
 
LESS(CSS preprocessor)
LESS(CSS preprocessor)LESS(CSS preprocessor)
LESS(CSS preprocessor)
 
Learn to Love CSS3 [English]
Learn to Love CSS3 [English]Learn to Love CSS3 [English]
Learn to Love CSS3 [English]
 
Learn to love CSS3 | Joomla! Day Deutschland
Learn to love CSS3 | Joomla! Day DeutschlandLearn to love CSS3 | Joomla! Day Deutschland
Learn to love CSS3 | Joomla! Day Deutschland
 
Prototyping w/HTML5 and CSS3
Prototyping w/HTML5 and CSS3Prototyping w/HTML5 and CSS3
Prototyping w/HTML5 and CSS3
 
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)
 
Compass And Sass(Tim Riley)
Compass And Sass(Tim Riley)Compass And Sass(Tim Riley)
Compass And Sass(Tim Riley)
 
Write LESS. DO more.
Write LESS. DO more.Write LESS. DO more.
Write LESS. DO more.
 
Sass Essentials
Sass EssentialsSass Essentials
Sass Essentials
 
CSS Less framework overview, Pros and Cons
CSS Less framework overview, Pros and ConsCSS Less framework overview, Pros and Cons
CSS Less framework overview, Pros and Cons
 
Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)
 
Rapid Prototyping
Rapid PrototypingRapid Prototyping
Rapid Prototyping
 
HTML5, CSS3, and other fancy buzzwords
HTML5, CSS3, and other fancy buzzwordsHTML5, CSS3, and other fancy buzzwords
HTML5, CSS3, and other fancy buzzwords
 
CSS Extenders
CSS ExtendersCSS Extenders
CSS Extenders
 
CSS3 is Not Magic Pixie Dust
CSS3 is Not Magic Pixie DustCSS3 is Not Magic Pixie Dust
CSS3 is Not Magic Pixie Dust
 
Css3 101
Css3 101Css3 101
Css3 101
 
CSS: A Slippery Slope to the Backend
CSS: A Slippery Slope to the BackendCSS: A Slippery Slope to the Backend
CSS: A Slippery Slope to the Backend
 

Plus de Wynn Netherland

Your government is Mashed UP!
Your government is Mashed UP!Your government is Mashed UP!
Your government is Mashed UP!Wynn Netherland
 
America, your congress is Mashed UP!
America, your congress is Mashed UP!America, your congress is Mashed UP!
America, your congress is Mashed UP!Wynn Netherland
 
CSS Metaframeworks: King of all @media
CSS Metaframeworks: King of all @mediaCSS Metaframeworks: King of all @media
CSS Metaframeworks: King of all @mediaWynn Netherland
 
Hands on with Ruby & MongoDB
Hands on with Ruby & MongoDBHands on with Ruby & MongoDB
Hands on with Ruby & MongoDBWynn Netherland
 
MongoDB - Ruby document store that doesn't rhyme with ouch
MongoDB - Ruby document store that doesn't rhyme with ouchMongoDB - Ruby document store that doesn't rhyme with ouch
MongoDB - Ruby document store that doesn't rhyme with ouchWynn Netherland
 
Build An App Start A Movement
Build An App Start A MovementBuild An App Start A Movement
Build An App Start A MovementWynn Netherland
 
Javascript And Ruby Frameworks
Javascript And Ruby FrameworksJavascript And Ruby Frameworks
Javascript And Ruby FrameworksWynn Netherland
 
Free(ish) Tools For Virtual Teams
Free(ish) Tools For Virtual TeamsFree(ish) Tools For Virtual Teams
Free(ish) Tools For Virtual TeamsWynn Netherland
 

Plus de Wynn Netherland (9)

Your government is Mashed UP!
Your government is Mashed UP!Your government is Mashed UP!
Your government is Mashed UP!
 
MongoDB is the MashupDB
MongoDB is the MashupDBMongoDB is the MashupDB
MongoDB is the MashupDB
 
America, your congress is Mashed UP!
America, your congress is Mashed UP!America, your congress is Mashed UP!
America, your congress is Mashed UP!
 
CSS Metaframeworks: King of all @media
CSS Metaframeworks: King of all @mediaCSS Metaframeworks: King of all @media
CSS Metaframeworks: King of all @media
 
Hands on with Ruby & MongoDB
Hands on with Ruby & MongoDBHands on with Ruby & MongoDB
Hands on with Ruby & MongoDB
 
MongoDB - Ruby document store that doesn't rhyme with ouch
MongoDB - Ruby document store that doesn't rhyme with ouchMongoDB - Ruby document store that doesn't rhyme with ouch
MongoDB - Ruby document store that doesn't rhyme with ouch
 
Build An App Start A Movement
Build An App Start A MovementBuild An App Start A Movement
Build An App Start A Movement
 
Javascript And Ruby Frameworks
Javascript And Ruby FrameworksJavascript And Ruby Frameworks
Javascript And Ruby Frameworks
 
Free(ish) Tools For Virtual Teams
Free(ish) Tools For Virtual TeamsFree(ish) Tools For Virtual Teams
Free(ish) Tools For Virtual Teams
 

Dernier

Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)amitlee9823
 
8377087607, Door Step Call Girls In Majnu Ka Tilla (Delhi) 24/7 Available
8377087607, Door Step Call Girls In Majnu Ka Tilla (Delhi) 24/7 Available8377087607, Door Step Call Girls In Majnu Ka Tilla (Delhi) 24/7 Available
8377087607, Door Step Call Girls In Majnu Ka Tilla (Delhi) 24/7 Availabledollysharma2066
 
Q4-W4-SCIENCE-5 power point presentation
Q4-W4-SCIENCE-5 power point presentationQ4-W4-SCIENCE-5 power point presentation
Q4-W4-SCIENCE-5 power point presentationZenSeloveres
 
ab-initio-training basics and architecture
ab-initio-training basics and architectureab-initio-training basics and architecture
ab-initio-training basics and architecturesaipriyacoool
 
Call Girls Jalgaon Just Call 8617370543Top Class Call Girl Service Available
Call Girls Jalgaon Just Call 8617370543Top Class Call Girl Service AvailableCall Girls Jalgaon Just Call 8617370543Top Class Call Girl Service Available
Call Girls Jalgaon Just Call 8617370543Top Class Call Girl Service AvailableNitya salvi
 
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)amitlee9823
 
Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...amitlee9823
 
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...Delhi Call girls
 
The hottest UI and UX Design Trends 2024
The hottest UI and UX Design Trends 2024The hottest UI and UX Design Trends 2024
The hottest UI and UX Design Trends 2024Ilham Brata
 
Sweety Planet Packaging Design Process Book.pptx
Sweety Planet Packaging Design Process Book.pptxSweety Planet Packaging Design Process Book.pptx
Sweety Planet Packaging Design Process Book.pptxbingyichin04
 
Vip Mumbai Call Girls Bandra West Call On 9920725232 With Body to body massag...
Vip Mumbai Call Girls Bandra West Call On 9920725232 With Body to body massag...Vip Mumbai Call Girls Bandra West Call On 9920725232 With Body to body massag...
Vip Mumbai Call Girls Bandra West Call On 9920725232 With Body to body massag...amitlee9823
 
UI:UX Design and Empowerment Strategies for Underprivileged Transgender Indiv...
UI:UX Design and Empowerment Strategies for Underprivileged Transgender Indiv...UI:UX Design and Empowerment Strategies for Underprivileged Transgender Indiv...
UI:UX Design and Empowerment Strategies for Underprivileged Transgender Indiv...RitikaRoy32
 
How to Build a Simple Shopify Website
How to Build a Simple Shopify WebsiteHow to Build a Simple Shopify Website
How to Build a Simple Shopify Websitemark11275
 
High Profile Escorts Nerul WhatsApp +91-9930687706, Best Service
High Profile Escorts Nerul WhatsApp +91-9930687706, Best ServiceHigh Profile Escorts Nerul WhatsApp +91-9930687706, Best Service
High Profile Escorts Nerul WhatsApp +91-9930687706, Best Servicemeghakumariji156
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men 🔝jhansi🔝 Escorts S...
➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men  🔝jhansi🔝   Escorts S...➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men  🔝jhansi🔝   Escorts S...
➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men 🔝jhansi🔝 Escorts S...amitlee9823
 
Vip Mumbai Call Girls Borivali Call On 9920725232 With Body to body massage w...
Vip Mumbai Call Girls Borivali Call On 9920725232 With Body to body massage w...Vip Mumbai Call Girls Borivali Call On 9920725232 With Body to body massage w...
Vip Mumbai Call Girls Borivali Call On 9920725232 With Body to body massage w...amitlee9823
 
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...amitlee9823
 
➥🔝 7737669865 🔝▻ Kolkata Call-girls in Women Seeking Men 🔝Kolkata🔝 Escorts...
➥🔝 7737669865 🔝▻ Kolkata Call-girls in Women Seeking Men  🔝Kolkata🔝   Escorts...➥🔝 7737669865 🔝▻ Kolkata Call-girls in Women Seeking Men  🔝Kolkata🔝   Escorts...
➥🔝 7737669865 🔝▻ Kolkata Call-girls in Women Seeking Men 🔝Kolkata🔝 Escorts...amitlee9823
 

Dernier (20)

Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)
 
8377087607, Door Step Call Girls In Majnu Ka Tilla (Delhi) 24/7 Available
8377087607, Door Step Call Girls In Majnu Ka Tilla (Delhi) 24/7 Available8377087607, Door Step Call Girls In Majnu Ka Tilla (Delhi) 24/7 Available
8377087607, Door Step Call Girls In Majnu Ka Tilla (Delhi) 24/7 Available
 
Q4-W4-SCIENCE-5 power point presentation
Q4-W4-SCIENCE-5 power point presentationQ4-W4-SCIENCE-5 power point presentation
Q4-W4-SCIENCE-5 power point presentation
 
Abortion Pills in Oman (+918133066128) Cytotec clinic buy Oman Muscat
Abortion Pills in Oman (+918133066128) Cytotec clinic buy Oman MuscatAbortion Pills in Oman (+918133066128) Cytotec clinic buy Oman Muscat
Abortion Pills in Oman (+918133066128) Cytotec clinic buy Oman Muscat
 
ab-initio-training basics and architecture
ab-initio-training basics and architectureab-initio-training basics and architecture
ab-initio-training basics and architecture
 
Call Girls Jalgaon Just Call 8617370543Top Class Call Girl Service Available
Call Girls Jalgaon Just Call 8617370543Top Class Call Girl Service AvailableCall Girls Jalgaon Just Call 8617370543Top Class Call Girl Service Available
Call Girls Jalgaon Just Call 8617370543Top Class Call Girl Service Available
 
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
 
Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
 
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
 
The hottest UI and UX Design Trends 2024
The hottest UI and UX Design Trends 2024The hottest UI and UX Design Trends 2024
The hottest UI and UX Design Trends 2024
 
Sweety Planet Packaging Design Process Book.pptx
Sweety Planet Packaging Design Process Book.pptxSweety Planet Packaging Design Process Book.pptx
Sweety Planet Packaging Design Process Book.pptx
 
Vip Mumbai Call Girls Bandra West Call On 9920725232 With Body to body massag...
Vip Mumbai Call Girls Bandra West Call On 9920725232 With Body to body massag...Vip Mumbai Call Girls Bandra West Call On 9920725232 With Body to body massag...
Vip Mumbai Call Girls Bandra West Call On 9920725232 With Body to body massag...
 
UI:UX Design and Empowerment Strategies for Underprivileged Transgender Indiv...
UI:UX Design and Empowerment Strategies for Underprivileged Transgender Indiv...UI:UX Design and Empowerment Strategies for Underprivileged Transgender Indiv...
UI:UX Design and Empowerment Strategies for Underprivileged Transgender Indiv...
 
How to Build a Simple Shopify Website
How to Build a Simple Shopify WebsiteHow to Build a Simple Shopify Website
How to Build a Simple Shopify Website
 
High Profile Escorts Nerul WhatsApp +91-9930687706, Best Service
High Profile Escorts Nerul WhatsApp +91-9930687706, Best ServiceHigh Profile Escorts Nerul WhatsApp +91-9930687706, Best Service
High Profile Escorts Nerul WhatsApp +91-9930687706, Best Service
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men 🔝jhansi🔝 Escorts S...
➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men  🔝jhansi🔝   Escorts S...➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men  🔝jhansi🔝   Escorts S...
➥🔝 7737669865 🔝▻ jhansi Call-girls in Women Seeking Men 🔝jhansi🔝 Escorts S...
 
Vip Mumbai Call Girls Borivali Call On 9920725232 With Body to body massage w...
Vip Mumbai Call Girls Borivali Call On 9920725232 With Body to body massage w...Vip Mumbai Call Girls Borivali Call On 9920725232 With Body to body massage w...
Vip Mumbai Call Girls Borivali Call On 9920725232 With Body to body massage w...
 
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
➥🔝 7737669865 🔝▻ Kolkata Call-girls in Women Seeking Men 🔝Kolkata🔝 Escorts...
➥🔝 7737669865 🔝▻ Kolkata Call-girls in Women Seeking Men  🔝Kolkata🔝   Escorts...➥🔝 7737669865 🔝▻ Kolkata Call-girls in Women Seeking Men  🔝Kolkata🔝   Escorts...
➥🔝 7737669865 🔝▻ Kolkata Call-girls in Women Seeking Men 🔝Kolkata🔝 Escorts...
 

Compass, Sass, and the Enlightened CSS Developer

  • 1. COMPASS, SASS, AND THE ENLIGHTENED WEB WYNNNETHERLAND
  • 3. +
  • 4.
  • 5. or “Okie” in the local Native Oklahoman vernacular. Naturalized Texan
  • 6. Like you, I work on the Interwebs.
  • 7. ... but my story begins in
  • 9. Literally. this still works : brew install lynx
  • 10. gopher:// anyone? look it up, kids.
  • 11. Flight of the Navigator technology from the future!
  • 13. Full of strange magic.
  • 17. <table> <tr> <td valign=top>Remember this?</td> <td> <table> <tr> <td>And this?</td> </tr> </table> </td> </tr> Nested tables FTW. </tr> </table>
  • 19.
  • 20. Sometimes we’d hide these and update the page without a refresh, back when Ajax was something Momma used to clean the bathtub.
  • 23.
  • 24. Why am I sharing all this?
  • 25. Consider it inoculation against CURMUDGEONRY.
  • 26. THAT’S THE WAY IT WAS AND WE LIKED IT.
  • 27. “GET OFF MY LAWN.” Nathan Smith Creator, 960.gs RefreshOKC headliner Reformed Curmudgeon
  • 28. Back to our story
  • 32. HTML5
  • 33. CSS3
  • 39. RGBA, HSL, HSLA colors rgba (0,0,0,1) is the new black!
  • 45. @font-face means Typographic freedom!
  • 46. Cool New selectors
  • 47. CSS3 selectors (and some golden oldies) * ::first-letter :enabled E :first-line :disabled .class ::first-line :checked #id E[attribute^=value] :header E F E[attribute$=value] E > F E[attribute*=value] E + F E ~ F E[attribute] :root Steal this from jQuery, please E[attribute=value] :last-child E[attribute~=value] :only-child E[attribute|=value] :nth-child() :first-child :nth-last-child() :link :first-of-type :visited :last-of-type :lang() :only-of-type :before :nth-of-type() ::before :nth-last-of-type() :after :empty ::after :not() :first-letter :target
  • 48. This is not a talk about CSS Follow @smashingmag for your CSS tips & tricks
  • 49. I want to talk about REAL stylesheet innovation
  • 50. I want to talk about HOW we write stylesheets
  • 51. I want to talk about how we MAINTAIN stylesheets
  • 52. I want to talk about how we SIMPLIFY stylesheets
  • 53. We're gonna see a brave new world where they run everybody a wire and hook us all up to a grid. Yes, sir, a veritable age of reason. Like the one they had in France. Not a moment too soon. ~ Ulysses Everett McGill
  • 55. Sass
  • 57. Syntax options - SCSS Sassy CSS! table.users { tr { td { background: #d1d1d; a { color: #111; } } } }
  • 58. Syntax options - Indented I whitespace table.users tr td background: #d1d1d a color: #111
  • 60. Nested rules - selectors table.users tr td a {color: #111} table.users tr.alt td a {color: #333}
  • 61. Nested rules - selectors table.users Lo o k , Ma, tr n o braces td a color: #111 or semicolons td.alt a color: #333 But you can use both if you wanna
  • 62. Nested rules - selectors table.users tr C ha nge this td color: #111 &.alt you chang e these . . . an d color: #333 &:hover color: #666
  • 63. Nested rules - properties .users font: size: 1.2em style: italics weight: bold
  • 65. Variables .user { background: #333; border-size: 2px; } .owner { background: #333; border-size: 2px; } .admin { background: #666; border-size: 4px; }
  • 66. Variables !gray = #333 !default_border = 2px .user background: = !gray border-size: = !default_border .owner r mixing! background: = !gray border-size: = !default_border and colo .admin Ev e n ma t h ! background: = !gray + #333 border-size: = !default_border + 2px
  • 67. Variables $font-apres: Apres, Arial, sans-serif $dark-gray: #1e1e1e !default $body-text: #bbb !default $strong-text: lighten($body-text, 40%) $muted-text: darken($body-text, 40%) $content-background: #fff $content-text: #555 $content-border: #ccc $form-background: rgba(0, 0, 0, .5) $blue-primary: #6095c2 $blue-secondary: #1742db $green-primary: #64b900 $green-secondary: #298527 $pink-primary: #f44ab7
  • 69. Mixins .avatar { padding: 2px; border: solid 1px #ddd; position: absolute; top: 5px; left: 5px; } p img { padding: 2px; border: solid 1px #ddd; }
  • 70. Mixins =frame(!padding_width = 2px, !border_color = #ddd) padding = !padding_width border: width: 1px defines t he mixin style: solid color = !border_color .avatar +frame position: absolute top: 5px mixes in t h e rule s left: 5px p img +frame(1px, #ccc)
  • 72. Selector inheritance .flash { padding: 5px; border-width: 1px; font-weight: bold; } .error { color: #8a1f11; background: #fbe3e4; } .notice { color: #514721; background: #fff6bf; }
  • 73. Selector inheritance .flash padding: 5px border-width: 1px font-weight: bold .error.flash color: #8a1f11 background: #fbe3e4 .notice.flash color: #514721 background: #fff6bf
  • 74. Selector inheritance .flash, .error, .notice { padding: 5px; border-width: 1px; font-weight: bold; } .error { color: #8a1f11; background: #fbe3e4; } .notice { color: #514721; background: #fff6bf; } now we can use a single class in our markup
  • 76. Imports @import url(/css/reset.css) @import url(/css/typography.css) @import url(/css/layout.css) parent + 3 @imports = 4 http requests
  • 77. Imports @import reset.sass # _reset.sass @import typography.sass # _typography.sass @import layout.sass # _layout.sass Included at compile time - just one http request
  • 78. Imports + Mixins Now it gets fun!
  • 79. Compass CSS3 mixins @import compass/css3.sass .callout +border-radius(5px) +linear-gradient("left top", "left bottom", #fff, #ddd) .callout { very different syntax -moz-border-radius: 5px; -webkit-border-radius: 5px; -border-radius: 5px; background-image: -moz-linear-gradient(top, bottom, from(#fff), to (#ddd)); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0.00, #fff), color-stop(1.00, #ddd)); }
  • 81. Bring your favorite CSS Framework
  • 82. A Blueprint example <div id='wrapper' class="container"> <div id='content' class="span-7 prepend-1"> <div id='main' class="container"> boo ... </div> <div id='featured' class="span-5 last"> ... </div> </div> <div id='sidebar' class="span-3 append-1 last"> ... </div> </div>
  • 83. A Blueprint example @import blueprint/reset.sass @import partials/base.sass @import blueprint @import blueprint/modules/scaffolding.sass #wrapper +container #content +column(7) +append(1) #featured +column(5, true) #sidebar +column(3, true) +prepend(1)
  • 86. Sass 2.4 color functions hue(#cc3) => 60deg saturation(#cc3) => 60% lightness(#cc3) => 50% adjust-hue(#cc3, 20deg) => #9c3 saturate(#cc3, 10%) => #d9d926 desaturate(#cc3, 10%) => #bfbf40 lighten(#cc3, 10%) => #d6d65c darken(#cc3, 10%) => #a3a329 grayscale(#cc3) => desaturate(#cc3, 100%) = #808080 complement(#cc3) => adjust-hue(#cc3, 180deg) = #33c mix(#cc3, #00f) => #e56619 mix(#cc3, #00f, 10%) => #f91405 mix(#cc3, #00f, 90%) => #d1b72d http://nex-3.com/posts/89-powerful-color-manipulation-with-sass
  • 87. with alpha support! Sass 2.4 color functions mix(rgba(51, 255, 51, 0.75), #f00) => rgba(178, 95, 19, 0.875) mix(rgba(51, 255, 51, 0.90), #f00) => rgba(163, 114, 22, 0.95) alpha(rgba(51, 255, 51, 0.75)) => 0.75 opacity(rgba(51, 255, 51, 0.75)) => 0.75 opacify(rgba(51, 255, 51, 0.75), 0.1) => rgba(51, 255, 51, 0.85) fade-in(rgba(51, 255, 51, 0.75), 0.1) => rgba(51, 255, 51, 0.85) transparentize(rgba(51, 255, 51, 0.75), 0.1) => rgba(51, 255, 51, 0.65) fade-out(rgba(51, 255, 51, 0.75), 0.1) => rgba(51, 255, 51, 0.65) http://nex-3.com/posts/89-powerful-color-manipulation-with-sass
  • 88. Who makes this syntactic sugar?
  • 89. Patte xtens io n s & rns & C SS e plugins co mpiler Sass and Compass
  • 90. ...like peas and carrots.
  • 91. Sass and Compass $ sudo gem install haml $ sudo gem install compass --pre CALL IT FROM THE COMMAND LINE $ sass screen.sass screen.css OR COMPASS-IZE YOUR PROJECT $ compass --rails -f blueprint OR WATCH A FOLDER $ compass --watch
  • 92. A quick survey of Compass
  • 94. Blueprint ★ Buttons ★ Link Icons ★ Colors ★ Liquid ★ Debug ★ Print ★ Fancy Type ★ Reset ★ Form ★ Rtl ★ Grid ★ Scaffolding ★ Interaction ★ Typography ★ Internet Explorer ★ Utilities
  • 95. CSS3
  • 96. CSS3 ★ Appearance ★ Gradient ★ Background Clip ★ Images ★ Background Origin ★ Inline Block ★ Background Size ★ Opacity ★ Border Radius ★ Shared Utilities ★ Box ★ Text Shadow ★ Box Shadow ★ Transform ★ Box Sizing ★ Transform (legacy) ★ CSS3 Pie ★ Transition ★ Columns ★ Font Face
  • 98. I like the Sprite in you Image sprites ® 1. @import "icon/*.png" @import "icon/*.png" .actions 2. public/images/icon/new.png public/images/icon/edit.png .new public/images/icon/save.png +icon-sprite(new) public/images/icon/delete.png .edit +icon-sprite(edit) .save .icon-sprite, +icon-sprite(save) .actions .new, .delete .actions .edit, +icon-sprite(delete) .actions .save, .actions .delete { background: url('/images/icon-34fe0604ab.png') no-repeat; } .actions .new { background-position: 0 -64px; } .actions .edit { background-position: 0 -32px; } .actions .save { background-position: 0 -96px; } 3. .actions .delete { background-position: 0 0; }
  • 100. URL helpers #nav background: image-url("nav_bg.png") repeat-x top center DEVELOPMENT #nav { background: url("/images/nav_bg.png") repeat-x top center; } elopment, ths for dev relative pa PRODUCTION production a bsolute for #nav { background: url("http://assets.example.com/images/nav_bg.png") repeat-x top center; }
  • 104. @import "fancy-buttons" button, a.button +fancy-button(#2966a8)
  • 106. Compass 960 $ninesixty-columns: 16 #wrap +grid-container #left-nav +alpha +grid(5) #main-content +grid-prefix(1) +grid(10) +omega https://github.com/chriseppstein/compass-960-plugin
  • 108. shameless plug Compass and WordPress $ gem install compass-wordpress CRANK OUT A NEW SASS-Y WORDPRESS THEME $ compass -r compass-wordpress -f wordpress  -p thematic  --sass-dir=sass --css-dir=css -s compressed my_awesome_theme AUTOCOMPILE YOUR CHANGES $ compass --watch
  • 110.
  • 111. Compass and Formalize INSTALL THE GEM $ gem install compass_formalize CREATE THE COMPASS PROJECT $ compass create my-great-app -r compass_formalize $ cd my-great-app APPLY THE PATTERN $ compass install formalize/jquery
  • 112. Stats
  • 113. Stats | --------------------------------- | ----- | ---------- | -------------- | ----------- | --------- | -------------- | | Filename | Rules | Properties | Mixins Defs | Mixins Used | CSS Rules | CSS Properties | | --------------------------------- | ----- | ---------- | -------------- | ----------- | --------- | -------------- | | app/stylesheets/_960.sass | 198 | 141 | 0 | 0 | -- | -- | | app/stylesheets/_animation.sass | 2 | 2 | 0 | 0 | -- | -- | | app/stylesheets/application.sass | 268 | 607 | 0 | 33 | 1131 | 3684 | | app/stylesheets/_data_table.sass | 39 | 66 | 0 | 4 | -- | -- | | app/stylesheets/_datepicker.sass | 125 | 242 | 0 | 0 | -- | -- | | app/stylesheets/_formalize.sass | 82 | 78 | 0 | 4 | -- | -- | | app/stylesheets/_forms.sass | 227 | 242 | 0 | 21 | -- | -- | | app/stylesheets/ie.sass | 0 | 0 | 0 | 0 | 0 | 0 | | app/stylesheets/_jscrollpane.sass | 20 | 43 | 0 | 0 | -- | -- | | app/stylesheets/_prettify.sass | 16 | 16 | 0 | 0 | -- | -- | | app/stylesheets/print.sass | 0 | 0 | 0 | 0 | 0 | 0 | | app/stylesheets/_reset.sass | 111 | 18 | 0 | 0 | -- | -- | | app/stylesheets/_text.sass | 27 | 18 | 0 | 0 | -- | -- | | app/stylesheets/_tiptip.sass | 19 | 40 | 0 | 0 | -- | -- | | app/stylesheets/_util.sass | 56 | 54 | 0 | 0 | -- | -- | | app/stylesheets/_vars.sass | 0 | 6 | 2 | 0 | -- | -- | | --------------------------------- | ----- | ---------- | -------------- | ----------- | --------- | -------------- | | Total (16 files): | 1190 | 1573 | 2 | 62 | 1131 | 3684 | | --------------------------------- | ----- | ---------- | -------------- | ----------- | --------- | -------------- |
  • 114. Isn’t she Sassy, folks? GET THE BOOK.
  • 115. Save 40% and get early access! sass40 Sadly, sass100 is not a valid code.
  • 116. Resources an d thanks for having me! sass-lang.com beta.compass-style.org slides! wynn.fm/okc gra b t he blog: wynnnetherland.com twitter: @pengwynn email: wynn@hp.com linkedin.com/in/netherland