--- title: Tailwind Setup --- {% include_relative includes/_header.html %}

Our general Tailwind setup involves a frontend.config.json, tailwind.config.js and an input.css file.

We use values from this JSON file inside the Tailwind config to separate Tailwind config itself from front end site data. This JSON file is often read by a project's Webpack set up, a project's JavaScript and a project's CMS. This set up is, of course, not mandatory to use these plugins, but they may still prove inspiration for your Tailwind set up all the same.

This documentation site is made using Tailwind and AREA 17 tailwind plugins, this page documents the config files used for this site.

With the introduction of Tailwind 4, the setup of your project changes. Both use the same frontend.config.json.

Note: For the smallest possible output and the fastest build times, only include the plugins you are using. Some plugins, especially GridLines, require a lot of purging.

frontend.config.json

frontend.config.json
{% include_relative frontend.config.json %}

Tailwind 4 tailwind.config.js and input.css

tailwind.config.js
{% include_relative tailwind.config.js %}

And then input this tailwind.config.js and configure the Tailwind theme in CSS:

input.css
@config "./tailwind.config.js";
@import "tailwindcss";

@theme {
  --container-*: initial;
  --breakpoint-*: initial;
  --color-*: initial;
  --font-*: initial;
  --text-*: initial;
  --tracking-*: initial;
  --leading-*: initial;
  --spacing: 1px;
}

@utility container {
  max-width: 100%;
}

Tailwind 3 tailwind.config.js

tailwind.config.js
{% include_relative v4/tailwind.config.js %}
input.css
@tailwind base;
@tailwind components;
@tailwind utilities;
{% include_relative includes/_footer.html %}