Mastering Sass: Lesson 2
videos

Mastering Sass: Lesson 2

Tutorial Details
  • Topic: Sass
  • Format: 8 Minute Screencast
  • Difficulty: Moderate
This entry is part 2 of 3 in the Mastering Sass Session
« PreviousNext »

In lesson one of our quick tip series, we learned how to install Sass, and how to use variables, nesting, and compression in our stylesheets. Today, we’ll review mixins and selector inheritance, which can provide us with a great deal of convenience and flexibility!

Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
  • http://visudex.net46.net Jeremy Michel

    Great tutorial, very nice intro, I like it a lot, puts much more life into the tutorial.

    • http://www.jeffrey-way.com Jeffrey Way
      Author

      Thanks, Jeremy!

  • http://facester.me Jehnee

    jeff your so cute!

    • http://www.jeffrey-way.com Jeffrey Way
      Author

      Thanks, Jehnee. It’s nice to know my red face doesn’t totally destroy your monitor. :)

  • http://nizzledev.com Ricardo Guillen

    Amazing :) Can’t wait to 3rd Lesson ! ! ! are you going to show how to use this recieving params from a rails app or from a database to generate de scss ? it’ll be awesome.. just perfect for a CMS :) Thanks.

    • http://www.jeffrey-way.com Jeffrey Way
      Author

      We’re not going to get into Rails in this series.

      • http://nizzledev.com Ricardo Guillen

        Too Bad :( may in another series? :)

  • DJ

    Jeff… I’ve been watching your casts now for… well, probably since you started. You’ve always been good but wow, you’re getting quite polished. Intro was just right. Not too long, and way better than an insert which is often too distracting. Clear, concise and to the point. You must at least do one run-through – I wish others did the same.

    • http://www.jeffrey-way.com Jeffrey Way
      Author

      Thanks, DJ! As a non-video trained guy, this stuff is hard for me to pick up…but it’s getting there. :)

  • http://gdmedia.fr Guillaume Denormandie

    Okay this is ridiculously awesome :)

    I started using it today and from a quick overview of the documentation it looks really powerful and gives me another good reason to design in the browser (especially parts you haven’t covered yet).

    Great tut as usual Jeffrey !

  • Brad

    Excellent tut, liked the personal intro

  • Giova

    Props for showing your face before getting into the meat of things. Definitely think you should keep doing that. Thanks for another great tut!

  • Keshav Naidu

    Jeffrey you share a gr8 stuff !
    Thanks a lot.
    Keep it up !

  • David

    hey, was asking if the tutorial is available in typed form.(not in video)

  • http://www.nouveller.com/ Benjamin Reid

    Well that was another five minutes of brilliance, love it. Sass is my new friend.

  • http://www.danharper.me Dan Harper

    It’s odd how much a short, well-done filmed intro can really add polish to a video!

    • http://www.jeffrey-way.com Jeffrey Way
      Author

      Definitely.

  • w1sh

    Good stuff Jeff. Like the intro. Still Camtasia or what?

    Also, SASS + LESS seem to function almost identically. What sets SASS apart other than preference?

    Also also, does Compass add a lot to SASS or is it worth bypassing?

  • http://modxclub.com Zaigham

    So, you can’t @extend the @mixins?

    Thanks for great tut.

  • waste

    Intro rocks, Jeff! Very expressive.

  • http://ramaboo.com David Singer

    Sass is awsome!

  • http://www.jacobbednarz.com Jacob Bednarz

    I have been using SASS for a while now and I absolutely love it. The fact you can have a development SCSS file with commenting and spread out as much as you need and then when it is outputted, it can be compressed to a handy small file.
    Not to mention the awesome syntax – super easy to remember. Hopefully if CSS variables are introduced, they check out SASS and bring some of the fucntionality over.

  • Lobo

    mixin and extend are nice. But there are 2 major concerns for me.

    Losing simplicity over more complex programming structures and that u got 2 different codes that with debugging and constant changes of css don’t save time at all.

  • http://www.github.com/dotink/inkwell Matthew J. Sahagian

    I like the idea of saving time, but I wonder how much of this is a transient issue or a half-solved issue. I also wonder if it’s worth, as Lobo states, the added complexity. Let’s take for example the simple idea of child selectors:

    ul {
    li {

    }
    }

    For starters, is there a way to ensure that perhaps it only applies to direct children? The equivalent of ul and ul > li? Is SASS dumb (smart) enough to not care what the embedded selector is?

    ul {
    > li {
    }
    }

    If this is the case, then other selectors don’t make as much sense with this syntax:

    ul {
    + img {
    }
    }

    A sibling image for example, which you wouldn’t want to be indented, but likely on the same level as the ul, and is syntactically falsely implied to have a child-like relationship.

    Then on top of this we add the fact that presumably if someone edits the actual compiled CSS code, you now have disparate rules which are not re-incorporated back into SASS without manual intervention I presume.

    For things like variables, mix-ins, and minification it would seem to me these are better handled by traditional pre-processing or snippets. For example, Flourish (http://www.flourishlib.com) already handles minification support in it’s templating. I have recently modified the fork used on inKWell (http://www.github.com/dotink/inkwell) to use output buffering and include statements in this process which now makes the inclusion of PHP code viable in both CSS and Javascript.

    Example:

    ul {
    background-color: ;
    ;
    }

    If front-end developers who may not be familiar with more complex programming constructs are taking the time to essentially learn the concepts of variables and functions (not to mention inheritance), the invasion of traditional pre-processing languages is not significantly harder.

    The only benefit achieved with not using such a language is the idea that this is a separate component which would work regardless of your language thus making it more portable. This benefit does not seem that grand, however, in the world of CSS, as it’s not as re-usable as other pieces of code.

    • http://www.github.com/dotink/inkwell Matthew J. Sahagian

      Errr, looks like the comments ate my example PHP. Hopefully this works:

      ul {
      background-color: <?= $site_bg_color ?>
      <?= CSSHelper::box_shadow(’10px’); ?>
      }

    • http://fordinteractive.com Andy Ford

      Why don’t you give Sass/SCSS a try before assuming you don’t like it?

  • http://codendesign.wordpress.com nXqd

    Nice and easy to understand as always.
    Jeremy

  • http://www.vlado1.com vlado varbanov

    Hey this really rocks!!

    The only think that I’ll not put it in production is that the editors like CSSEdit doesn’t work with it. I’m using CSSEdit as this is really cool for styling and most important you can see the changes instantly !!

  • http://carloshermoso.com Carlos Hermoso

    Bookmarked! Thank ya!

  • vvr

    Very nice video. May I ask what plugins you are using in macvim to expand the variables etc?

  • http://thietkenoithat247.com thiet ke noi that

    Thanks for tut

  • Mouloud Allache

    Amazing ! thx Jeff

  • fancystill

    Jeffrey Way is the web game Billy Corgan.