30
Total Commands
100%
Free Access
⚡
Lightning Fast
Available Commands
Click on any command to copy it instantly
30 commands available
30 of 30
npx tailwindcss init
setup
config
npm install -D tailwindcss
setup
installation
npx tailwindcss -i input.css -o output.css
build
production
npx tailwindcss -i input.css -o output.css --watch
development
watch
// tailwind.config.js
module.exports = {
theme: {
extend: {
colors: {
'brand-blue': '#1992d4'
}
}
}
}
config
customization
// tailwind.config.js
module.exports = {
content: [
'./src/**/*.{html,js,jsx,ts,tsx}'
]
}
config
optimization
<div class="flex justify-center items-center h-screen">
<div>Centered Content</div>
</div>
layout
center
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
<!-- Grid items -->
</div>
layout
grid
responsive
npm install @tailwindcss/typography
typography
plugin
<article class="prose">
<!-- Markdown content -->
</article>
typography
content
// tailwind.config.js
module.exports = {
theme: {
extend: {
colors: {
primary: {
100: '#ebf8ff',
500: '#1992d4',
900: '#1e3a8a'
}
}
}
}
}
customization
colors
// tailwind.config.js
module.exports = {
theme: {
extend: {
spacing: {
'128': '32rem',
'144': '36rem'
}
}
}
}
customization
spacing
// tailwind.config.js
module.exports = {
theme: {
screens: {
'tablet': '640px',
'laptop': '1024px',
'desktop': '1280px',
}
}
}
responsive
breakpoints
<!-- Base style (mobile), overridden at larger screens -->
<div class="text-sm md:text-base lg:text-lg">
Responsive text
</div>
responsive
mobile
<button class="bg-blue-500 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-300">
Click me
</button>
interactive
states
// tailwind.config.js
module.exports = {
darkMode: 'class', // or 'media'
// ...
}
theme
dark-mode
<button class="btn-primary">Click</button>
<style>
.btn-primary {
@apply px-4 py-2 rounded bg-blue-600 text-white font-medium hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-300;
}
</style>
component
button
<div class="max-w-sm rounded overflow-hidden shadow-lg">
<div class="px-6 py-4">
<div class="font-bold text-xl mb-2">Card Title</div>
<p class="text-gray-700 text-base">
Card content
</p>
</div>
</div>
component
card
<div class="animate-bounce">Bouncing</div>
<div class="animate-pulse">Pulsing</div>
animation
effects
// tailwind.config.js
module.exports = {
theme: {
extend: {
animation: {
'spin-slow': 'spin 3s linear infinite',
}
}
}
}
animation
custom
// tailwind.config.js
module.exports = {
mode: 'jit',
purge: [
'./src/**/*.{html,js,jsx,ts,tsx}'
],
// ...
}
optimization
build
// tailwind.config.js
module.exports = {
purge: {
content: [
'./src/**/*.html',
'./src/**/*.jsx',
],
options: {
safelist: ['bg-red-500', 'text-center']
}
}
}
optimization
production
<div class="top-[117px]">
<div class="bg-[#1da1f2]">
<div class="grid-cols-[1fr,700px,2fr]">
advanced
custom
<div class="!text-red-500">
<div class="sm:!hidden">
advanced
specificity
// tailwind.config.js
const plugin = require('tailwindcss/plugin')
module.exports = {
plugins: [
plugin(function({ addUtilities }) {
addUtilities({
'.rotate-y-180': {
transform: 'rotateY(180deg)',
},
})
})
]
}
plugin
advanced
npm install @tailwindcss/forms
plugin
forms
// postcss.config.js
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
}
}
integration
react
// vue.config.js
module.exports = {
css: {
loaderOptions: {
postcss: {
postcssOptions: {
plugins: [
require('tailwindcss'),
require('autoprefixer'),
],
},
},
},
},
}
integration
vue
// tailwind.config.js
module.exports = {
plugins: [
require('tailwindcss-debug-screens'),
]
}
debugging
responsive
/* Chrome DevTools */
/* In Styles panel, click on the class to see source */
/* Or use Computed tab to see cascade */
debugging
development
Missing a command?
Help us improve this collection by suggesting commands that should be added. Your contributions help the entire developer community!