Chapter 3Variables

Variables are at the core of most—if not all—programming languages that ever existed. A variable, broadly speaking, is a storage location paired with an associated identifier (aka a variable name). So a variable is basically made up of a key and a value, the former being used to retrieve the latter.

When applied to Sass, variables give authors the ability to store bits of content so that they can be reused throughout the stylesheets. This is especially handy for colors: one can avoid having countless hues of the same color after a long time spent working on a project. Variables can also be helpful for storing other types of content such as font lists, maps of breakpoints, and default asset paths—presumably anything that you ...

Get Jump Start 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.