From the course: SharePoint Framework for Developers: 1 Understanding the Toolchain

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Sass functions

Sass functions

- [Narrator] Sass also supports the concept of functions. There are a lot of built-in functions that you can use in Sass, and they help you do a number of things, basic color operations, mathematical operations, etc. So, let's say that I have this small blue square and a big red square. But what I'd really like is that I'd like to have a big, dark blue square. And I'd like, as you can imagine, the dark blue square, and blue square, both to be shades of blue, but, I would like them to be, let's say the dark blue square is 20% darker. So how do we do that? Well, they're both coming off of the same base color, so let me define that color at the top. I can reference that color here very easily, so the blue square is simply going to be $ blue. That was easy. The question is what do I do here? I would like this color to be 20% darker than whatever this blue color is. Well, that's actually quite easy. You use the concept of functions, the built-in functions inside of Sass. So I simply say…

Contents