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
38Doing Math with Eyeglass

Creating shapes, perfecting animations, or making canvases can all require some complex mathematical functions. Sass includes some basic operators, but for more in-depth functionality, you should turn to the eyeglass-math module.

Once you’ve installed the module using the command in the example, you need to use @import "math"; in your style sheet to include all the math functions.

In the first example, the $PI variable and the sqrt() function are used to calculate the diameter of a circle. This could be useful for generating CSS circles with areas that are tied to specific values.

You can calculate heights and widths of triangles using trigonometric functions. eyeglass-math comes with all the major trigonometry ...

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