Takes structure information from the config and generates a series of :root variables which are used by other A17 SCSS utilities.
Setup
Required setup for all plugins (except Color). Additional set up maybe required for other utilities.
And, so your application.scss will look like:
Breakdown
A key-value SCSS map of your breakpoints, where the keys are your breakpoint names and the values are the start points of the breakpoints.
For the following SCSS maps, it probably helps to define "design grid". We call the grid that the design system lives within, as opposed to CSS Grid or a grid layout. Of course, you may then make components that use CSS Grid to make a grid layout which lives on the design grid.
And so, referencing the screen shot above:
container is the defined as the area the blue bars cover;
columns are the blue bars
gutters
inner - the gaps between blue bars
outer - the gaps on the outside of the first and last blue bar
A key-value SCSS map describing the width of the main container at each breakpoint. Values can be auto for fluid width or a defined value to lock the column at a certain breakpoint. This allows you to build fluid and adaptive layouts.
A key-value SCSS map describing how many design columns are at each breakpoint.
Two key-value SCSS maps describing the design grid inner and outer gutters, per breakpoint. Can be a auto (when the container has a fixed width at a breakpoint) or a defined value (for other breakpoints).
Output
Based on the reference config mentioned in this guide, we would get the following in our CSS:
Notes
As these variables are on the :root, they are easily read by JavaScript. For example to know which is the currently active CSS breakpoint in JavaScript, you could read the --breakpoint variable: