Mathematical operations

Since Sass compiles down to CSS, you can have it do mathematical calculations for you instead of doing them yourself. You can also have the math be run on variables, as opposed to hardcoded numbers as in the following example, which, of course, is super handy to be able to do:

/* Here is Sass that has some math in it */

.main-container { width: 100%; }
article {
float: right;
width: 700px / 960px * 100%;
}

The preceding Sass code will be compiled and the equivalent CSS code will be generated:

/* Here is the CSS that the above Sass is compiled to */

.main-container {
width: 100%;
}
article {
float: right;
width: 72.91667%;
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.18.61