|
|
|
|
|
by joshuafcole
5028 days ago
|
|
I use them pretty frequently. In combination with variables for colors, they can be pretty useful, since you can make sweeping changes to the appearance of a site by changing a single line of code. I usually use three color variables ($background, $foreground, $highlight) every time I start a website and expand sparingly from there. If I wanted my headers to have an indented appearance, I can use a text shadow 1px above the text with `darken($background, 10%)` to choose an appropriate color for the imprint without having to manually keep them in sync. Similarly, if I'm ever working with gradients, say on an alert bar that spans the top of the screen, I can simply use `linear-gradient(top, lighten($highlight, 5%), darken($highlight, 5%))`. If you'd like an example of a website built this way, we completed enyojs.com in about two weeks thanks entirely to SASS and in part to color variables and functions. As ever, your mileage may vary and what works wonders for me may not fit your style of design. |
|