Layouts preset

The layouts preset extends Tailwind default configurations to help you out with layouts. It also contains plugins that work together with Splendid Layouts.


Extended Spacing values for Tailwind

Tailwind is kinda irritating because it has a weird spacing scale. We fixed that by introducing a consistent spacing scale for most of the units you’ll ever need.

  • inherit
  • 1px to 8px
  • 0ch to 100ch in steps of 0.25ch
  • 0em to 100em in steps of 0.25em
  • 0rem to 100rem in steps of 0.25rem
  • 0 to 100 in steps of 0.25. (Each integer is 1rem according to tailwind’s convention).

No more [] for ch em, and rem values from 0 to 100!

<div class="w-inherit">...</div> <!-- inherit -->
<div class="w-1px">...</div> <!-- 1px -->
<div class="w-1ch">...</div> <!-- 1ch -->
<div class="w-1em">...</div> <!-- 1em -->
<div class="w-1rem">...</div> <!-- 1rem -->
<div class="w-4">...</div> <!-- 1rem -->

More breakpoints for you to use as well

It’s a best practice to change your breakpoints according to your design. Unfortunately, Tailwind only provides device-breakpoints like 768px.

We fixed this by giving you a whole slew of breakpoints (from 50px to 2000px) so you can design to your hearts’ content ❤️!

Breakpoints

<div class="bp2:class">...</div> <!-- 200px -->
<div class="bp3:class">...</div> <!-- 300px -->
<div class="bp4:class">...</div> <!-- 400px -->
<div class="bp5:class">...</div> <!-- 500px -->

Container Breakpoints

<div class="@bp2:class">...</div> <!-- 200px -->
<div class="@bp3:class">...</div> <!-- 300px -->
<div class="@bp4:class">...</div> <!-- 400px -->
<div class="@bp5:class">...</div> <!-- 500px -->

Sensible Border Width values

Why does Tailwind only give us 0, 1px, 2px, 4px, and 8px values for border widths? We don’t understand and we find that to be a problem.

We fixed this by making all spacing values available for border-width.

index.html
<div class="border-3px">...</div> <!-- 3px -->
<div class="border-1em">...</div> <!-- 1em -->
<div class="border-1rem">...</div> <!-- 1rem -->
<div class="border-4">...</div> <!-- 1rem -->

Now you can use any unit you like. Without [] too!