Skip to content

Instantly share code, notes, and snippets.

@CodeRecipez
Last active December 15, 2015 12:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CodeRecipez/5264382 to your computer and use it in GitHub Desktop.
Save CodeRecipez/5264382 to your computer and use it in GitHub Desktop.
Sass 101 - A newb's guide: operations

All types support equality operations (== and !=). In addition, each type has its own operations that it has special support for.

SassScript supports the standard arithmetic operations on numbers (+, -, *, /, %), and will automatically convert between units if it can.

Relational operators (<, >, <=, >=) are also supported for numbers, and equality operators (==, !=) are supported for all types.

operations.scss

block {
font-size: 12 / 16 * 1em;
width: 500 / 16 * 1em;
padding: 20 / 16 * 1em;
margin: 25 * 1%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment