-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Ryan Domingue edited this page Sep 27, 2019
·
10 revisions
Demo page: https://goodguyry.github.io/postcss-tidy-columns/
npm install postcss-tidy-columnsThere are two ways to define the Tidy grid values:
Option 1. Pass grid settings in JavaScript via the plugin options
/* postcss.config.js */
const tidyColumns = require('postcss-tidy-columns');
plugins: [
tidyColumns({
columns: 8,
gap: '0.625rem',
edge: '1.25rem',
breakpoints: {
'64rem': {
columns: 12,
siteMax: '90rem',
gap: '1.25rem',
edge: '1.5rem',
},
},
}),
];Option 2. Declare @tidy rules in your CSS/Sass file.
/* index.css */
@tidy columns 12;
@tidy siteMax 90rem;
@tidy gap 1.25rem;
@tidy edge 1.5rem;Note: Passing JS values directly to the plugin allows for declaring breakpoint configurations.
- Click outside the design, in the art board area.
- Notice the Grid section in the sidebar.
- The
columnsvalue is the # of Columns. - The
gapvalue is the dark colored portion of the Grid (20pxin the screenshot below). - The
edgevalue is the actual width of the design minus the Total Width value here, divided by two. Or by simply measuring with a tool like PixelSnap or Linear. - The
siteMaxvalue is theedgevalue multiplied by 2 plus the Total Width field (or simply the full-width of the design).

- Click outside the design, in the art board area.
- Notice the Grid section in the sidebar.
- The
columnsvalue is in the Columns field. - The
gapvalue is in the Gutter width field. - The
edgevalue is calculated by subtracting the Offset value from the Total Width value, then subtracting the result from the Width value (at the top of the sidebar). Or by simply measuring with a tool like PixelSnap or Linear. - The
siteMaxvalue is the Width value (at the top of the sidebar).

In the View toolbar drop down, notice the Layout Settings... option.

That option opens the Layout settings.
- The
columnsvalue is the Number of Columns field. - The
gapvalue is the Gutter Width field. - The
edgevalue is theOffsetfield. - The
siteMaxvalue is the Offset field multiplied by 2 plus the Total Width field (or simply the full-width of the design).
