January 2017
Intermediate to advanced
134 pages
2h 28m
English
Avoid the temptation of abstracting code into mixins. There are a few areas where mixins are perfect. The code for CSS text truncation (e.g. @mixin Truncate) or iOS style inertia scrolling panels, where there are number of pseudo selectors to get right for different browsers. Another good use case can be complex font stacks.
Font stacks are difficult to get right and tedious to author. The sanest way I've found to deal with fonts is to have the body use the most common font stack and then only override this with a different font-stack as and when needed.
For example:
.med-Video { position: relative; background-color: $color-black; font-size: $text13; line-height: $text15; /* At medium sizes we want to ...Read now
Unlock full access