Tailwind Cheat Sheet



By default, Tailwind's width scale is a combination of the default spacing scale as well as some additional values specific to widths. You can customize the spacing scale for padding, margin, width, and height all at once in the theme.spacing or theme.extend.spacing sections of your tailwind.config.js file. Tailwind Cheat Sheet 🌍 - Tailwind CSS class names cheat sheet. Description Visit Site. Related Projects. Tailwind Cheat Sheet Cheat sheet that provides a quick, interactive reference for all utility classes and CSS properties provided by Tailwind CSS, a utility-first CSS framework.

I recently set out to move my blog CSS to Tailwind.

Tailwind CSS Cheat Sheet. CSS; Quick search through Tailwind classes and styles. Go to Tailwind CSS Cheat Sheet; Tailwind Gradient Designer. Tailwind is unapologetically modern, and takes advantage of all the latest and greatest CSS features to make the developer experience as enjoyable as possible. We've got first-class CSS grid support, composable transforms and gradients powered by CSS variables, support for modern state selectors like:focus-visible, and tons more.

Tailwind is an interesting framework because instead of providing a set of widgets like Bootstrap or others, it provides utilities.

I find it resonates a lot with how I work with HTML.

I introduced how I use Tailwind with Vue in a previous post, but without a build tool in place already, it can be hard to get the correct setup right, and I decided to write this blog post even just for me to remember later on 🙃

In this post I explain how to use Tailwind with any kind of project.

Install Tailwind

First step is to install Tailwind, using npm or yarn:

Create the configuration file

Tailwind cheat sheet

Ad100 pro channel (com3) driver. Next, use this command to create a configuration file:

This will create a tailwind.config.js file in the root of your project, adding the basic Tailwind configuration.

Configure PostCSS

Now you need to tweak the PostCSS configuration to make sure Tailwind runs. Add:

to your postcss.config.js. Create one if it does not exist.

I also added autoprefixer for convenience, you’ll likely need it. Install it with npm install autoprefixer.

Oh, also make sure you installed PostCSS (npm install -g postcss-cli)

Create the Tailwind CSS file

Now create a CSS file where you want, like in tailwind.css and add

Android manages the memory that apps use. You don't usually need to close apps. But if an app isn't responding, try closing the app. Learn how to troubleshoot apps that aren't working. How to clean up my phone memory in android.

Create the build command

Now open your package.json file, and add a scripts section if you don’t have it:

Build Tailwind

Tailwind cheat sheet

Now from the command line run npm run build:css will build the final CSS file.

The resulting file is in static/dist/tailwind.css (you can change the location in the above command).

Tailwind Css Cheat Sheet Pdf

Automatically regenerate the CSS upon file changes

Every time I change something in the theme HTML (stored in the layouts folder in my case), I want to regenerate the CSS, and trigger the purge and minification I set up.

How to do this?

Tailwind css cheat sheetSheet

Install the watch npm package:

and add the watch script to your package.json file. You already had build:css from before, we just add a script that watches the layouts folder and runs build:css upon every change:

Now run npm run watch and you should be good to go!

Trim the file size

If you check, the resulting file is huge. Even if you don’t use any Tailwind class in your HTML, all of the framework is included by default, because that’s the default configuration in the tailwind.js file.

Tailwind 2 Cheat Sheet

They decided to include all, to avoid people missing things. It’s a design choice. We now need to remove stuff, and it turns out we can use purgecss to remove all the unused CSS classes.

Sheet

I also want to remove all comments from the CSS and make it as small as possible. cssnano is what we’re looking for.

We can automate this stuff! First, install those utilities:

Tailwind Css Cheat Sheet

Then we add this to our PostCSS configuration file postcss.config.js:

In development, avoid too much processing

Anydesk linkedin. Why? Every step you add slows down the feedback cycle while developing. I use this config to only add prefixes and removing comments in production:

postcss.config.js

Tailwind Cheat Sheet

Download my free CSS Handbook