In brief…
:root { --fontSize: 16px; }
variable sets base measurement unit used in all other measurement calculations. Its applied in html { font-size: var(--font-size); }
rem
units are mainly used define rest of sizes in everything else based from the variable --font-size
, sometimes em
units are sometimes used as well.:root { --fontSize: 16px; --h1-size: 2.8rem; } html { font-size: var(--font-size); } h1 { font-size: var(--h1-size); }
--sp-rim
, base --sp-base
, feat --sp-feat
.rem
in relation to html { font-size: var(--font-size); }
variables
and media queries
are how we control sizing and scaling. It’s all kept in the variables.calc()
css function we modify spacing variables and keep everything relative and easily scalable.element.style { padding-top: var(--sp-base); margin-bottom: calc( var(--sp-base) * 2.5 ); }
gss--
and adds the column fr’sgss--1-2-1
is a three column grid sets up as grid-template-columns: 1fr 2fr 1fr;
gssauto
created an auto column grid that becomes 1fr @ 799pxgrid-gap
can also use the css measurement variables mentioned above: grid-gap: var(--sp-base);