Skip to Content
Pragmatic Guide to Sass 3
book

Pragmatic Guide to Sass 3

by Hampton Lintorn Catlin, Michael Lintorn Catlin
July 2016
Intermediate to advanced
130 pages
2h 11m
English
Pragmatic Bookshelf
Content preview from Pragmatic Guide to Sass 3
19Understanding Value Types in Sass

Everything we write in Sass, from classes to pixel widths, can be considered a value. However, values can be of different types. This makes some aspects of them incompatible, and learning about their differences is essential for writing more complex Sass. In some cases, it’s possible to convert from one value type to another with some special Sass functions. In this task, you’ll learn about the types of values found in Sass, plus some conversion functions.

Numbers are pretty self-explanatory. Any time you write a digit in Sass, that’s of the number type—even if it has a unit associated with it. So 12, 59.7%, and 200px are all numbers.

Colors are also straightforward. They can be hex values (for example, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Jump Start Sass

Jump Start Sass

Hugo Giraudel, Miriam Suzanne
What Employees Want Most in Uncertain Times

What Employees Want Most in Uncertain Times

Kristine W. Powers, Jessica B.B. Diaz
Mastering Sass

Mastering Sass

Luke Watts

Publisher Resources

ISBN: 9781680502060Errata Page