Home > Web Front-end > CSS Tutorial > Tailwind Commands Cheat Sheet

Tailwind Commands Cheat Sheet

王林
Release: 2024-07-17 01:23:10
Original
1184 people have browsed it

Tailwind Commands Cheat Sheet

Tailwind CSS is a utility-first CSS framework packed with classes that can be composed to build any design, directly in your markup.

Features:

Utility-first:

Tailwind css is a utility-first css framework that provides low-level utility classes to build custom designs without writing css.This approach allows us to implement a completely custom component design without writing a single line of custom CSS."You aren’t wasting energy inventing class names".

Content purging:

It is the process of removing unused CSS classes from the final CSS file that will be used in production environment.It is an optimization process in which the final CSS size is smaller, easier to maintain and shows improved performance.

Commands:

Underline:

underline 
underline-offset-<size>
decoration-<color>-<shade> //color for underline
decoration-<thickness> // size of underline
decoration-<style> // wavy, double
Copy after login

Text Styling

text-<color>-<shade> //color of text
text-opacity-<shade> //opacity of text
text-<size> //size of text
text-<alignment> //alignment of text
Copy after login

Background Color

bg-<color>-<shade>
Copy after login

Border Radius

rounded-<size> 
Copy after login

Font Styling

font-<style> //mono, serif, sans
font-bold
font-thin
Copy after login

Italic:

italic
Copy after login

Visibility

Hide elements:

hidden
Copy after login

Display (Opposite to hide):

block
Copy after login

Padding

p-<size>   /* All sides */
px-<size>  /* Horizontal (left and right) */
py-<size>  /* Vertical (top and bottom) */
pl-<size>  /* Left */
pr-<size>  /* Right */
pt-<size>  /* Top */
pb-<size>  /* Bottom */
Copy after login

Margin

m-<size>   /* All sides */
mx-<size>  /* Horizontal (left and right) */
my-<size>  /* Vertical (top and bottom) */
ml-<size>  /* Left */
mr-<size>  /* Right */
mt-<size>  /* Top */
mb-<size>  /* Bottom */
Copy after login

Flexbox

flex
flex-<direction> // row or column
Copy after login

Justify Content

justify-<option>
Copy after login

Align Items

items-<option> //start,end,center
Copy after login

Responsive Design

sm  /* Small devices */
md  /* Medium devices */
lg  /* Large devices */
xl  /* Extra large devices */
Copy after login

Sizing

h-<size>
w-<size>
Copy after login

Borders

border
border-<size>
border-<color>
Copy after login

Hover States

hover:<utility>
Copy after login

The above is the detailed content of Tailwind Commands Cheat Sheet. For more information, please follow other related articles on the PHP Chinese website!

source:dev.to
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template