21Interpolating

Included in Sass are some programmer-style functions, which we’ll look over in the next couple of tasks. We generally refer to these as SassScripts.

Let’s start out with a general SassScript that allows you to dynamically generate style sheets. It’s called interpolation. Oh, fancy sounding word—how we love you! It makes us sound smart just by saying it. You try it: interpolation. Feels good, doesn’t it? OK, sorry—we got a bit distracted there.

Interpolation basically means “put this there.” Imagine we want to write a mixin that has a dynamic property or selector. And we don’t mean a dynamic property value—that’s easy stuff that we’ve already done. We mean if the very name of a property or selector could be dynamically generated. ...

Get Pragmatic Guide to Sass now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.