Tailwind CSS
Tailwind CSS is a CSS framework that allows you to rapidly build modern websites without ever leaving your HTML.
Quickstart
If you'd rather use a template, this guide is walking throw how to build this Tailwind CSS + Turborepo template.
Guide
Create a monorepo
If you don't have an existing project, use create-turbo to create a new monorepo:
Add Tailwind CSS to your application
Follow Tailwind CSS's guides to set up Tailwind CSS for your frontend framework.
Once completed, you can start working on bringing your UI package into the applications.
Create a shared Tailwind CSS configuration package
First, build an Internal Package with four files:
This package.json
installs Tailwind CSS so we can create the file shared styles and export for the rest of the repository.
Create the UI package
You can now build the components to share to your applications.
For a full example, visit the source code for @repo/ui
package in the Tailwind CSS example. The files required for your Tailwind CSS setup are below.
The package.json
installs the dependencies for the package, sets up scripts for development and build environments, and marks the exports for the package.
Good to know:
Above, we've only included the code related to setting up Tailwind. The full package.json is here.
Use the UI package in an application
Install the packages you've created into your application.
Then, configure the files in your application so the styles from the UI package are reflected in the application.