5. Thou shalt use variables for sizing, colours and z-index
For any project of size, setting variables for sizing, colours, and z-index is essential.
UIs are typically based upon some form of grid or sizing ratio. Therefore sizing should be based upon set sizes, and sensible delineations of those sizes. For example here is 11px
based sizing and variants as variables:
$size-full: 11px; $size-half: 5.5px; $size-quarter: 2.75px; $size-double: 22px; $size-treble: 33px; $size-quadruple: 44px;
For a developer, the use of variables offers additional economies. For example, it saves colour picking values from composites. It also helps to normalise designs.
For example, if a project uses only 13px, 15px and 22px font sizes and a change comes through requesting 14px font-sizing, the variables provide some normalisation reference. In this case, should the fonts be 13px or 15px as 14px is not used anywhere else? This allows developers to feedback possible design inconsistencies to the designers.
The same...