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

WordCamp Baltimore - Let's Get Sassy!

Brad Parbs
September 21, 2013

WordCamp Baltimore - Let's Get Sassy!

yo #wcbalt it was awesome

Brad Parbs

September 21, 2013
Tweet

More Decks by Brad Parbs

Other Decks in Technology

Transcript

  1. Let’s get SASSy
    #wcbalt

    View Slide

  2. #wcbalt
    BO
    N
    U
    S
    SLID
    E

    View Slide

  3. #wcbalt
    Go to @brennenbyrne’s talk
    and just keep yelling about how
    zoidberg is a good password
    BO
    N
    U
    S
    SLID
    E

    View Slide

  4. #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
    #wcbalt

    View Slide

  5. #wcpvd
    More Fun Facts
    Going to be on a pirate ship later WHAT
    Cats cats cats cats
    No longer have a beard :(
    I love GIFs
    No memes in this talk at all
    @BradParbs
    brad.parbs.me
    #wcbalt

    View Slide

  6. 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
    #wcbalt

    View Slide

  7. What is SASS?
    Write less, do more.
    #wcbalt

    View Slide

  8. What is SASS?
    SASS is awesome.
    #wcbalt

    View Slide

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

    View Slide

  10. Installation
    Prepros
    #wcmke
    #wcbalt

    View Slide

  11. Should I just use a Javascript compiler?
    #wcbalt
    Installation

    View Slide

  12. Now we write some SASS...
    #wcmke
    #wcbalt

    View Slide

  13. And it becomes CSS!
    #wcmke
    #wcbalt

    View Slide

  14. Any Questions?
    #wcbalt

    View Slide

  15. Let’s get SASSy
    #wcbalt

    View Slide

  16. Two Flavors
    .scss .sass
    #wcgr
    #wcbalt

    View Slide

  17. 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
    #wcbalt

    View Slide

  18. Nesting
    #wcgr
    #wcbalt

    View Slide

  19. Nesting
    Nesting
    #wcgr
    #wcbalt

    View Slide

  20. Parent Selector Reference
    #wcgr
    #wcbalt

    View Slide

  21. Parent Selector Reference
    #wcgr
    #wcbalt

    View Slide

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

    View Slide

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

    View Slide

  24. Variables
    #wcgr
    #wcbalt

    View Slide

  25. @extend()
    #wcmke
    #wcgr
    #wcbalt

    View Slide

  26. @extend()
    #wcgr
    #wcbalt

    View Slide

  27. Silent @extend
    #wcgr
    #wcbalt

    View Slide

  28. Mixins
    #wcbalt

    View Slide

  29. Mixins
    #wcbalt

    View Slide

  30. Mixins with Arguments
    w/
    #wcbalt

    View Slide

  31. Mixins with Arguments
    w/
    #wcbalt

    View Slide

  32. Mixins with Default Arguments
    #wcbalt

    View Slide

  33. Mixins
    #wcbalt

    View Slide

  34. http://bourbon.io/
    #wcbalt

    View Slide

  35. Mixins
    Appearance
    Background Clip
    Background Origin
    Background Size
    Border Radius
    Box
    Box Shadow
    Box Sizing
    CSS Regions
    CSS3 Pie
    Columns
    Filter
    Font Face
    http://compass-style.org
    #wcbalt

    View Slide

  36. Mixins
    #wcbalt

    View Slide

  37. gif break!

    View Slide

  38. Operations
    #wcbalt

    View Slide

  39. Operations within functions
    #wcbalt

    View Slide

  40. Color Functions
    #wcbalt

    View Slide

  41. 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% );
    #wcbalt

    View Slide

  42. Color Functions
    #wcbalt

    View Slide

  43. Color Functions
    #wcbalt

    View Slide

  44. Color Functions
    #wcbalt

    View Slide

  45. Color Operations
    http://sassme.arc90.com/
    #wcbalt

    View Slide

  46. Operations with Directive
    #wcbalt

    View Slide

  47. Operations - Range of Numbers
    #wcgr
    #wcbalt

    View Slide

  48. Operations - Range of Numbers with Silent placeholders
    #wcgr
    #wcbalt

    View Slide

  49. Operations - List of Values
    #wcgr
    #wcbalt

    View Slide

  50. View Slide

  51. config.rb
    #wcgr
    #wcbalt

    View Slide

  52. config.rb
    #wcgr
    #wcbalt

    View Slide

  53. 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
    #wcbalt

    View Slide

  54. 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
    #wcbalt

    View Slide

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

    View Slide

  56. config.rb
    #wcgr
    #wcbalt

    View Slide

  57. config.rb
    #wcgr
    #wcbalt

    View Slide

  58. Processing Modes
    :nested
    :expanded
    :compact
    :compressed
    #wcgr
    #wcbalt

    View Slide

  59. config.rb
    #wcgr
    #wcbalt

    View Slide

  60. 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
    #wcbalt

    View Slide

  61. Building a WP Theme
    #wcgr
    #wcbalt

    View Slide

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

    View Slide

  63. 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
    #wcbalt

    View Slide

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

    View Slide

  65. Questions?
    #wcbalt

    View Slide

  66. #wcbalt

    View Slide