Upgrade to Pro — share decks privately, control downloads, hide ads and more …

#WCGR - Getting SASSy

Brad Parbs
August 24, 2013

#WCGR - Getting SASSy

Brad Parbs

August 24, 2013
Tweet

More Decks by Brad Parbs

Other Decks in Technology

Transcript

  1. #wcgr
    Let’s get SASSy

    View full-size slide

  2. #wcgr
    #wcpvd
    I’m Brad Parbs.
    Created Wolf, hook_s & wpWizard
    Core Contributor in 3.5 & 3.6
    Run Snow Day Group, (snowday.io)
    ♥ WordPress, Startups, and Code
    Plugin and Theme author/developer
    @BradParbs
    brad.parbs.me

    View full-size slide

  3. #wcgr
    What is SASS?
    “Sass is a meta-language on top of CSS ... with
    more power than flat CSS allows. Sass both
    provides a simpler, more elegant syntax for CSS
    and implements various features that are useful for
    creating manageable stylesheets.”
    sass-lang.org

    View full-size slide

  4. #wcgr
    What is SASS?
    Write less, do more.

    View full-size slide

  5. #wcgr
    What is SASS?
    SASS is awesome.

    View full-size slide

  6. #wcgr
    Why SASS over LESS?
    Compass - “drop-in” bits of SASS
    @extend() - allows for cleaner HTML
    Easily Embedding Media Queries
    #wcmke

    View full-size slide

  7. #wcgr
    Installation
    Prepros
    #wcmke

    View full-size slide

  8. #wcgr
    Installation
    Prepros
    #wcmke

    View full-size slide

  9. #wcgr
    Now we write some SASS...
    #wcmke

    View full-size slide

  10. #wcgr
    And it becomes CSS!
    #wcmke

    View full-size slide

  11. #wcgr
    Any Questions?

    View full-size slide

  12. #wcgr
    Let’s get SASSy

    View full-size slide

  13. #wcgr
    Two Flavors
    .scss .sass
    #wcgr

    View full-size slide

  14. #wcgr
    Two Flavors
    .scss .sass
    More similar to CSS
    Easier to jump into from CSS
    Probably where you want to start
    Less keystrokes
    Cleaner files
    #wcgr

    View full-size slide

  15. #wcgr
    Nesting
    #wcgr

    View full-size slide

  16. #wcgr
    Nesting
    Nesting
    #wcgr

    View full-size slide

  17. #wcgr
    Parent Selector Reference
    #wcgr

    View full-size slide

  18. #wcgr
    Parent Selector Reference
    #wcgr

    View full-size slide

  19. #wcgr
    Selector Bubble Up
    Perfect for using Media Queries to build responsively.
    #wcgr

    View full-size slide

  20. #wcgr
    Partials / File Structure
    http://b.parbs.me/PP2n
    http://b.parbs.me/POcZ
    #wcgr

    View full-size slide

  21. #wcgr
    Variables
    #wcgr

    View full-size slide

  22. #wcgr
    @extend()
    #wcmke
    #wcgr

    View full-size slide

  23. #wcgr
    @extend()
    #wcgr

    View full-size slide

  24. #wcgr
    Silent @extend
    #wcgr

    View full-size slide

  25. #wcgr
    Mixins with Arguments
    w/

    View full-size slide

  26. #wcgr
    Mixins with Arguments
    w/

    View full-size slide

  27. #wcgr
    Mixins with Default Arguments

    View full-size slide

  28. #wcgr
    http://bourbon.io/

    View full-size slide

  29. #wcgr
    Mixins
    Appearance
    Background Clip
    Background Origin
    Background Size
    Border Radius
    Box
    Box Shadow
    Box Sizing
    CSS Regions
    CSS3 Pie
    Columns
    Filter
    Font Face

    View full-size slide

  30. #wcgr
    Mixins Reset Utilities
    Links
    Lists
    Text
    Vertical Rhythm
    Color
    General
    Print
    Sprites
    Tables
    http://compass-style.org

    View full-size slide

  31. #wcgr
    gif break!

    View full-size slide

  32. #wcgr
    Operations

    View full-size slide

  33. #wcgr
    Operations within functions

    View full-size slide

  34. #wcgr
    Color Functions

    View full-size slide

  35. #wcgr
    Color Functions
    examples from: http://b.parbs.me/PSRH

    View full-size slide

  36. #wcgr
    Color Functions
    examples from: http://b.parbs.me/PSRH
    $base-color: #AD141E;

    View full-size slide

  37. #wcgr
    Color Functions
    examples from: http://b.parbs.me/PSRH
    $base-color: #AD141E;
    darken( $base-color, 10% );
    lighten( $base-color, 10% );

    View full-size slide

  38. #wcgr
    Color Functions
    examples from: http://b.parbs.me/PSRH
    $base-color: #AD141E;
    darken( $base-color, 10% );
    lighten( $base-color, 10% );

    View full-size slide

  39. #wcgr
    Color Functions
    examples from: http://b.parbs.me/PSRH
    $base-color: #AD141E;
    darken( $base-color, 10% );
    lighten( $base-color, 10% );
    saturate( $base-color, 20% );
    desaturate( $base-color, 20% );

    View full-size slide

  40. #wcgr
    Color Functions
    examples from: http://b.parbs.me/PSRH
    $base-color: #AD141E;
    darken( $base-color, 10% );
    lighten( $base-color, 10% );
    saturate( $base-color, 20% );
    desaturate( $base-color, 20% );

    View full-size slide

  41. #wcgr
    Color Functions
    examples from: http://b.parbs.me/PSRH
    $base-color: #AD141E;
    darken( $base-color, 10% );
    lighten( $base-color, 10% );
    saturate( $base-color, 20% );
    desaturate( $base-color, 20% );
    adjust-hue( $base-color, 20% );

    View full-size slide

  42. #wcgr
    Color Functions
    examples from: http://b.parbs.me/PSRH
    $base-color: #AD141E;
    darken( $base-color, 10% );
    lighten( $base-color, 10% );
    saturate( $base-color, 20% );
    desaturate( $base-color, 20% );
    adjust-hue( $base-color, 20% );

    View full-size slide

  43. #wcgr
    Color Functions

    View full-size slide

  44. #wcgr
    Color Functions

    View full-size slide

  45. #wcgr
    Color Functions

    View full-size slide

  46. #wcgr
    Color Operations
    http://sassme.arc90.com/

    View full-size slide

  47. #wcgr
    Operations with Directive

    View full-size slide

  48. #wcgr
    Operations - Range of Numbers
    #wcgr

    View full-size slide

  49. #wcgr
    Operations - Range of Numbers with Silent placeholders
    #wcgr

    View full-size slide

  50. #wcgr
    Operations - List of Values
    #wcgr

    View full-size slide

  51. #wcgr
    config.rb
    #wcgr

    View full-size slide

  52. #wcgr
    config.rb
    #wcgr

    View full-size slide

  53. #wcgr
    Let’s install Twitter Bootstrap
    Without SASS:
    1.Download zip file.
    2. Copy+Paste into stylesheet
    or: @import another CSS file
    or: another CSS file
    3.Redo all of this when there’s an
    update.
    4.Ugh this sucks, I’ll just use
    BootstrapWP.
    #wcgr

    View full-size slide

  54. #wcgr
    Let’s install Twitter Bootstrap
    With SASS:
    1.$ gem install compass-bootstrap
    (only have to ever do this once)
    2. Add require “compass-
    bootstrap” to config.rb.
    #wcgr

    View full-size slide

  55. #wcgr
    Let’s install Twitter Bootstrap
    https://github.com/hecbuma/compass-bootstrap
    #wcgr

    View full-size slide

  56. #wcgr
    config.rb
    #wcgr

    View full-size slide

  57. #wcgr
    config.rb
    #wcgr

    View full-size slide

  58. #wcgr
    Processing Modes
    #wcgr

    View full-size slide

  59. #wcgr
    Processing Modes
    :expanded
    #wcgr

    View full-size slide

  60. #wcgr
    Processing Modes
    :nested
    :expanded
    #wcgr

    View full-size slide

  61. #wcgr
    Processing Modes
    :nested
    :expanded
    :compact
    #wcgr

    View full-size slide

  62. #wcgr
    Processing Modes
    :nested
    :expanded
    :compact
    :compressed
    #wcgr

    View full-size slide

  63. #wcgr
    config.rb
    #wcgr

    View full-size slide

  64. #wcgr
    Building a WP Theme
    • We want only one stylesheet
    • Our SASS folder should live
    independently
    • config.rb in the root, so we can use
    Codekit to optimize images & JS
    https://github.com/bradp/Wolf
    #wcgr

    View full-size slide

  65. #wcgr
    Building a WP Theme
    #wcgr

    View full-size slide

  66. #wcgr
    Tools
    http://sassmeister.com/ http://codepen.io/
    http://thesassway.com/
    #wcgr

    View full-size slide

  67. #wcgr
    Resources
    http://alistapart.com/article/getting-started-with-sass
    http://css-tricks.com/redesigning-with-sass/
    https://speakerdeck.com/anotheruiguy/clean-out-your-sass-junk-drawer
    https://speakerdeck.com/irishstu/an-introduction-to-sassy-css
    http://sass-lang.com/
    #wcgr

    View full-size slide

  68. #wcgr
    I’m Brad Parbs.
    @BradParbs
    brad.parbs.me
    http://b.parbs.me/
    Slides:
    #wcgr

    View full-size slide

  69. #wcgr
    Questions?

    View full-size slide