Layout

Containers

We use the Tailwind container for a fixed-width container that "snaps" to each breakpoint. This is in contrast to a "fluid" container that stretches to the full width of the outer container. We find in practice developing to specific breakpoints to be far more efficient than ensuring layout looks perfect at every pixel increment 😅.

container: {
    center: true,
    padding: {
        DEFAULT: '1rem',
        md: '2rem',
    },
},

Our default setup is to auto-center the container, providing a 1rem x-padding and a 2rem padding after the md breakpoint. Feel free to tailor this to your needs for each project.

Default container

You can also override the padding or any other classes at the template level.

Custom classes

If you want to use a fluid container, simply omit the .container class and roll your own classes.

Fluid container

CSS Grid

An alternative to using a Flexbox-based grid is to use CSS Grid's, made easier with Tailwind's grid classes.

Grid

The grid utilities make it super-simple to construct gaps between columns and rows, having columns span multiple rows and more.

Grid cols
Grid cols - start/end

You can also add some non-card-like grids, like the layout for an application with a sidebar.

Grid sidebar