• Luke Whitehouse, over 8 years ago (edited over 8 years ago )

    Whats the benefit of using the $color-stack to just namespacing your variables? For example:

    $color-orange $color-orange-dark $color-orange-light
    2 points
    • Jono HerringtonJono Herrington, over 8 years ago

      I have to admit ... I did wonder the same thing. That function did throw me for a loop when Sass already has the pre-built rgba function inside. If you just name your variables like Luke suggests and use that rgba function ... you don't have to go to the trouble of writing all the other code.

      Don't fix what ain't broke if you know what I'm saying :).

      2 points
    • Hmphry x, over 8 years ago

      Honestly? Some probably won't find any benefit. I find it beneficial because it fits a system I am accustomed to. Something about writing color(orange) is nicer to me than $color-orange.

      3 points
  • Hawke BassignaniHawke Bassignani, over 8 years ago

    I enjoyed reading this, especially because of your helpful annotations.

    Question on the color function: have you noticed any significant increase in compile time for this snippet? (Or really any of them)?

    It would probably depend on how large your map was (and how many times you were calling the color() function). Just curious. :-)

    1 point
    • Hmphry x, over 8 years ago

      Full disclosure, I use Gulp so everything is fast off the bat. Experiences will probably vary depending on the tool. That said, I had a predecessor to the font's mixin which I feel extended the compile time. I never tested it, though. Instead, I switched from ruby-sass to gulp-sass(which is libsass, if I recall correctly) and never looked back. That all said, I guess it depends on how often you will call it. I'm not sure how sass works, but if it's anything like JS, a variable should be faster inherently faster, but you may not notice the render speed until you called in 5000 times.

      I will look into running some speed tests and get back to you in a few days.

      0 points
  • Jono HerringtonJono Herrington, over 8 years ago (edited over 8 years ago )

    This is superb! Really appreciate the depth you go into explaining your code and the over all presentation. This is a great resource. Well done!

    1 point
  • Matthew BlodeMatthew Blode, over 8 years ago

    This is fantastic. Very clean and easy to maintain code. I'm currently using it for mylatest website.

    0 points