SlideShare uma empresa Scribd logo
1 de 116
Baixar para ler offline
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

Mais conteúdo relacionado

Mais procurados

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.
 

Mais procurados (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
 

Semelhante a 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
 

Semelhante a 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
 

Mais 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
 

Mais 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
 

Último

Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025Rndexperts
 
PORTAFOLIO 2024_ ANASTASIYA KUDINOVA
PORTAFOLIO   2024_  ANASTASIYA  KUDINOVAPORTAFOLIO   2024_  ANASTASIYA  KUDINOVA
PORTAFOLIO 2024_ ANASTASIYA KUDINOVAAnastasiya Kudinova
 
办理学位证(NTU证书)新加坡南洋理工大学毕业证成绩单原版一比一
办理学位证(NTU证书)新加坡南洋理工大学毕业证成绩单原版一比一办理学位证(NTU证书)新加坡南洋理工大学毕业证成绩单原版一比一
办理学位证(NTU证书)新加坡南洋理工大学毕业证成绩单原版一比一A SSS
 
Dubai Calls Girl Tapes O525547819 Real Tapes Escort Services Dubai
Dubai Calls Girl Tapes O525547819 Real Tapes Escort Services DubaiDubai Calls Girl Tapes O525547819 Real Tapes Escort Services Dubai
Dubai Calls Girl Tapes O525547819 Real Tapes Escort Services Dubaikojalkojal131
 
专业一比一美国亚利桑那大学毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国亚利桑那大学毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree专业一比一美国亚利桑那大学毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国亚利桑那大学毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degreeyuu sss
 
ARt app | UX Case Study
ARt app | UX Case StudyARt app | UX Case Study
ARt app | UX Case StudySophia Viganò
 
Call Us ✡️97111⇛47426⇛Call In girls Vasant Vihar༒(Delhi)
Call Us ✡️97111⇛47426⇛Call In girls Vasant Vihar༒(Delhi)Call Us ✡️97111⇛47426⇛Call In girls Vasant Vihar༒(Delhi)
Call Us ✡️97111⇛47426⇛Call In girls Vasant Vihar༒(Delhi)jennyeacort
 
group_15_empirya_p1projectIndustrial.pdf
group_15_empirya_p1projectIndustrial.pdfgroup_15_empirya_p1projectIndustrial.pdf
group_15_empirya_p1projectIndustrial.pdfneelspinoy
 
Call Girls in Ashok Nagar Delhi ✡️9711147426✡️ Escorts Service
Call Girls in Ashok Nagar Delhi ✡️9711147426✡️ Escorts ServiceCall Girls in Ashok Nagar Delhi ✡️9711147426✡️ Escorts Service
Call Girls in Ashok Nagar Delhi ✡️9711147426✡️ Escorts Servicejennyeacort
 
韩国SKKU学位证,成均馆大学毕业证书1:1制作
韩国SKKU学位证,成均馆大学毕业证书1:1制作韩国SKKU学位证,成均馆大学毕业证书1:1制作
韩国SKKU学位证,成均馆大学毕业证书1:1制作7tz4rjpd
 
在线办理ohio毕业证俄亥俄大学毕业证成绩单留信学历认证
在线办理ohio毕业证俄亥俄大学毕业证成绩单留信学历认证在线办理ohio毕业证俄亥俄大学毕业证成绩单留信学历认证
在线办理ohio毕业证俄亥俄大学毕业证成绩单留信学历认证nhjeo1gg
 
PORTFOLIO DE ARQUITECTURA CRISTOBAL HERAUD 2024
PORTFOLIO DE ARQUITECTURA CRISTOBAL HERAUD 2024PORTFOLIO DE ARQUITECTURA CRISTOBAL HERAUD 2024
PORTFOLIO DE ARQUITECTURA CRISTOBAL HERAUD 2024CristobalHeraud
 
办理(宾州州立毕业证书)美国宾夕法尼亚州立大学毕业证成绩单原版一比一
办理(宾州州立毕业证书)美国宾夕法尼亚州立大学毕业证成绩单原版一比一办理(宾州州立毕业证书)美国宾夕法尼亚州立大学毕业证成绩单原版一比一
办理(宾州州立毕业证书)美国宾夕法尼亚州立大学毕业证成绩单原版一比一F La
 
cda.pptx critical discourse analysis ppt
cda.pptx critical discourse analysis pptcda.pptx critical discourse analysis ppt
cda.pptx critical discourse analysis pptMaryamAfzal41
 
西北大学毕业证学位证成绩单-怎么样办伪造
西北大学毕业证学位证成绩单-怎么样办伪造西北大学毕业证学位证成绩单-怎么样办伪造
西北大学毕业证学位证成绩单-怎么样办伪造kbdhl05e
 
办理(UC毕业证书)查尔斯顿大学毕业证成绩单原版一比一
办理(UC毕业证书)查尔斯顿大学毕业证成绩单原版一比一办理(UC毕业证书)查尔斯顿大学毕业证成绩单原版一比一
办理(UC毕业证书)查尔斯顿大学毕业证成绩单原版一比一z xss
 
1比1办理美国北卡罗莱纳州立大学毕业证成绩单pdf电子版制作修改
1比1办理美国北卡罗莱纳州立大学毕业证成绩单pdf电子版制作修改1比1办理美国北卡罗莱纳州立大学毕业证成绩单pdf电子版制作修改
1比1办理美国北卡罗莱纳州立大学毕业证成绩单pdf电子版制作修改yuu sss
 
Design principles on typography in design
Design principles on typography in designDesign principles on typography in design
Design principles on typography in designnooreen17
 
Call Girls Aslali 7397865700 Ridhima Hire Me Full Night
Call Girls Aslali 7397865700 Ridhima Hire Me Full NightCall Girls Aslali 7397865700 Ridhima Hire Me Full Night
Call Girls Aslali 7397865700 Ridhima Hire Me Full Nightssuser7cb4ff
 

Último (20)

Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025
 
PORTAFOLIO 2024_ ANASTASIYA KUDINOVA
PORTAFOLIO   2024_  ANASTASIYA  KUDINOVAPORTAFOLIO   2024_  ANASTASIYA  KUDINOVA
PORTAFOLIO 2024_ ANASTASIYA KUDINOVA
 
办理学位证(NTU证书)新加坡南洋理工大学毕业证成绩单原版一比一
办理学位证(NTU证书)新加坡南洋理工大学毕业证成绩单原版一比一办理学位证(NTU证书)新加坡南洋理工大学毕业证成绩单原版一比一
办理学位证(NTU证书)新加坡南洋理工大学毕业证成绩单原版一比一
 
Dubai Calls Girl Tapes O525547819 Real Tapes Escort Services Dubai
Dubai Calls Girl Tapes O525547819 Real Tapes Escort Services DubaiDubai Calls Girl Tapes O525547819 Real Tapes Escort Services Dubai
Dubai Calls Girl Tapes O525547819 Real Tapes Escort Services Dubai
 
专业一比一美国亚利桑那大学毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国亚利桑那大学毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree专业一比一美国亚利桑那大学毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国亚利桑那大学毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
 
ARt app | UX Case Study
ARt app | UX Case StudyARt app | UX Case Study
ARt app | UX Case Study
 
Call Us ✡️97111⇛47426⇛Call In girls Vasant Vihar༒(Delhi)
Call Us ✡️97111⇛47426⇛Call In girls Vasant Vihar༒(Delhi)Call Us ✡️97111⇛47426⇛Call In girls Vasant Vihar༒(Delhi)
Call Us ✡️97111⇛47426⇛Call In girls Vasant Vihar༒(Delhi)
 
group_15_empirya_p1projectIndustrial.pdf
group_15_empirya_p1projectIndustrial.pdfgroup_15_empirya_p1projectIndustrial.pdf
group_15_empirya_p1projectIndustrial.pdf
 
Call Girls in Ashok Nagar Delhi ✡️9711147426✡️ Escorts Service
Call Girls in Ashok Nagar Delhi ✡️9711147426✡️ Escorts ServiceCall Girls in Ashok Nagar Delhi ✡️9711147426✡️ Escorts Service
Call Girls in Ashok Nagar Delhi ✡️9711147426✡️ Escorts Service
 
韩国SKKU学位证,成均馆大学毕业证书1:1制作
韩国SKKU学位证,成均馆大学毕业证书1:1制作韩国SKKU学位证,成均馆大学毕业证书1:1制作
韩国SKKU学位证,成均馆大学毕业证书1:1制作
 
在线办理ohio毕业证俄亥俄大学毕业证成绩单留信学历认证
在线办理ohio毕业证俄亥俄大学毕业证成绩单留信学历认证在线办理ohio毕业证俄亥俄大学毕业证成绩单留信学历认证
在线办理ohio毕业证俄亥俄大学毕业证成绩单留信学历认证
 
PORTFOLIO DE ARQUITECTURA CRISTOBAL HERAUD 2024
PORTFOLIO DE ARQUITECTURA CRISTOBAL HERAUD 2024PORTFOLIO DE ARQUITECTURA CRISTOBAL HERAUD 2024
PORTFOLIO DE ARQUITECTURA CRISTOBAL HERAUD 2024
 
办理(宾州州立毕业证书)美国宾夕法尼亚州立大学毕业证成绩单原版一比一
办理(宾州州立毕业证书)美国宾夕法尼亚州立大学毕业证成绩单原版一比一办理(宾州州立毕业证书)美国宾夕法尼亚州立大学毕业证成绩单原版一比一
办理(宾州州立毕业证书)美国宾夕法尼亚州立大学毕业证成绩单原版一比一
 
cda.pptx critical discourse analysis ppt
cda.pptx critical discourse analysis pptcda.pptx critical discourse analysis ppt
cda.pptx critical discourse analysis ppt
 
西北大学毕业证学位证成绩单-怎么样办伪造
西北大学毕业证学位证成绩单-怎么样办伪造西北大学毕业证学位证成绩单-怎么样办伪造
西北大学毕业证学位证成绩单-怎么样办伪造
 
办理(UC毕业证书)查尔斯顿大学毕业证成绩单原版一比一
办理(UC毕业证书)查尔斯顿大学毕业证成绩单原版一比一办理(UC毕业证书)查尔斯顿大学毕业证成绩单原版一比一
办理(UC毕业证书)查尔斯顿大学毕业证成绩单原版一比一
 
1比1办理美国北卡罗莱纳州立大学毕业证成绩单pdf电子版制作修改
1比1办理美国北卡罗莱纳州立大学毕业证成绩单pdf电子版制作修改1比1办理美国北卡罗莱纳州立大学毕业证成绩单pdf电子版制作修改
1比1办理美国北卡罗莱纳州立大学毕业证成绩单pdf电子版制作修改
 
Design principles on typography in design
Design principles on typography in designDesign principles on typography in design
Design principles on typography in design
 
Call Girls in Pratap Nagar, 9953056974 Escort Service
Call Girls in Pratap Nagar,  9953056974 Escort ServiceCall Girls in Pratap Nagar,  9953056974 Escort Service
Call Girls in Pratap Nagar, 9953056974 Escort Service
 
Call Girls Aslali 7397865700 Ridhima Hire Me Full Night
Call Girls Aslali 7397865700 Ridhima Hire Me Full NightCall Girls Aslali 7397865700 Ridhima Hire Me Full Night
Call Girls Aslali 7397865700 Ridhima Hire Me Full Night
 

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