Tailwind CSS is a utility-first CSS framework for rapidly building custom UIs. It offers atomic classes for styling elements without leaving your HTML.
NOTE: Tested using the latest version at time of writing, v4
sm:
, md:
, lg:
, xl:
.mt-[22px]
, bg-[#1a1a1a]
.container
, mx-auto
, max-w-screen-md
box-border
, box-content
block
, inline-block
, flex
, grid
, hidden
static
, relative
, absolute
, fixed
, sticky
z-0
to z-50
, or custom: z-[9999]
flex
, flex-row
, flex-col
, items-center
, justify-between
, flex-wrap
grid
, grid-cols-3
, gap-4
, place-items-center
m-4
, mt-2
, mx-auto
, -ml-1
p-4
, pt-1
, px-6
gap-2
, gap-x-4
, gap-y-1
w-full
, w-screen
, w-[450px]
h-10
, min-h-screen
, h-fit
max-w-md
, min-h-[300px]
text-xs
, text-sm
, text-lg
, text-2xl
font-light
, font-bold
, font-black
text-gray-700
, text-red-500
, text-white
leading-tight
, leading-[1.6]
tracking-wide
, tracking-tight
text-left
, text-center
, text-justify
bg-blue-500
, bg-gray-900
, bg-white/80
bg-[url('/bg.svg')]
, bg-cover
, bg-center
, bg-no-repeat
border
, border-2
, border-gray-300
, border-dashed
rounded
, rounded-lg
, rounded-[12px]
shadow
, shadow-md
, shadow-lg
, shadow-none
opacity-50
, opacity-0
, opacity-100
mix-blend-multiply
, mix-blend-screen
transition
, duration-300
, ease-in-out
, hover:transition-colors
hover:bg-blue-600
, hover:underline
focus:outline-none
, focus:ring-2
, focus:ring-blue-500
active:scale-95
, disabled:opacity-50
list-none
, list-disc
, list-decimal
, list-inside
, list-outside
overflow-hidden
, overflow-auto
, overflow-scroll
snap-x
, snap-start
, snap-mandatory
transform
, scale-105
, rotate-45
, translate-x-2
cursor-pointer
, cursor-not-allowed
select-none
, select-text
pointer-events-none
, pointer-events-auto
dark:
prefix to style in dark mode.dark:bg-gray-800
, dark:text-white
tailwind.config.js
as 'media'
or 'class'
tailwind.config.js
module.exports = {
content: ['./src/**/*.{html,js,ts,jsx,tsx}'],
theme: {
extend: {
colors: {
brand: '#1e40af'
},
},
},
plugins: [],
};
@tailwindcss/forms
, then plugin: [require('@tailwindcss/forms')]
Use Tailwind to build layouts directly in your markup with precision. Remember: no custom class names, just compose.
For full documentation, see https://tailwindcss.com/docs