Tailwind CSS & Typescript 사용
Width
// w-{size}
<div className="w-20">Width</div>
| Class | Properties |
|---|---|
w-0 | width: 0px; |
w-px | width: 1px; |
w-0.5 | width: 0.125rem; / 2px / |
w-1 | width: 0.25rem; / 4px / |
w-min | width: min-content; |
w-max | width: max-content; |
Height
// h-{size}
<div className="h-20">Height</div>
| Class | Properties |
|---|---|
h-0 | height: 0px; |
h-px | height: 1px; |
h-0.5 | height: 0.125rem; / 2px / |
h-1 | height: 0.25rem; / 4px / |
h-min | height: min-content; |
h-max | height: max-content; |
Padding
// p-{size}
<div className="p-2">Padding</div>
// pt-{size}, pr-{size}, pb-{size}, pl-{size}
| Class | Properties |
|---|---|
p-0 | padding: 0px; |
px-1 | padding-left: 0.25rem; / 4px / |
| padding-right: 0.25rem; / 4px / | |
py-3 | padding-top: 0.75rem; / 12px / |
| padding-bottom: 0.75rem; / 12px / |
Margin
// m-{size}
<div className="m-4">Margin</div>
// mt-{size}, mr-{size}, mb-{size}, ml-{size}
| Class | Properties |
|---|---|
m-0 | margin: 0px; |
mx-0 | margin-left: 0px; |
| margin-right: 0px; | |
mx-1 | margin-left: 0.25rem; / 4px / |
| margin-right: 0.25rem; / 4px / | |
my-2 | margin-top: 0.5rem; / 8px / |
| margin-bottom: 0.5rem; / 8px / |
font family
// font-{family}
<p className="font-serif">font-family</p>
| Class | Properties |
|---|---|
font-sans | font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; |
font-serif | font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif; |
font size
// text-{size}
<p className="text-ts">text-size</p>
| Class | Properties |
|---|---|
text-xs | font-size: 0.75rem; / 12px / |
| line-height: 1rem; / 16px / | |
text-sm | font-size: 0.875rem; / 14px / |
| line-height: 1.25rem; / 20px / | |
text-base | font-size: 1rem; / 16px / |
| line-height: 1.5rem; / 24px / | |
text-lg | font-size: 1.125rem; / 18px / |
| line-height: 1.75rem; / 28px / |
font weight
// font-{weight}
<p className="font-thin">font-weight</p>
| Class | Properties |
|---|---|
font-thin | font-weight: 100; |
font-light | font-weight: 300; |
font-normal | font-weight: 400; |
font-bold | font-weight: 700; |
letter spacing
// tracking-{}
<p class="tracking-normal">letter spacing</p>
| Class | Properties |
|---|---|
tracking-tighter | letter-spacing: -0.05em; |
tracking-tight | letter-spacing: -0.025em; |
tracking-normal | letter-spacing: 0em; |
tracking-wide | letter-spacing: 0.025em; |
tracking-0 | letter-spacing: 0; |
line height
// leading-{height}
<p class="leading-normal">leading-height</p>
| Class | Properties |
|---|---|
leading-3 | line-height: .75rem; / 12px / |
leading-4 | line-height: 1rem; / 16px / |
leading-5 | line-height: 1.25rem; / 20px / |
leading-none | line-height: 1; |
leading-tight | line-height: 1.25; |
leading-normal | line-height: 1.5; |
leading-loose | line-height: 2; |
text align
// text-{align}
<p className="text-left">text-align</p>
| Class | Properties |
|---|---|
text-left | text-align: left; |
text-center | text-align: center; |
text-right | text-align: right; |
text-justify | text-align: justify; |
text-start | text-align: start; |
text-end | text-align: end; |
text color
// text-{color}-{number}
<p className="text-black-600">text-color</p>
color: black, white, gray, red, orange, yellow, green ...
| Class | Properties |
|---|---|
text-inherit | color: inherit; |
text-current | color: currentColor; |
text-transparent | color: transparent; |
text-black | color: rgb(0 0 0); |
text-white | color: rgb(255 255 255); |
text-gray-950 | color: rgb(3 7 18); |
text decoration
// {text-docoration}
<p className="underline">text-decoration</p>
| Class | Properties |
|---|---|
underline | text-decoration-line: underline; |
overline | text-decoration-line: overline; |
line-through | text-decoration-line: line-through; |
no-underline | text-decoration-line: none; |
text transform
// {text-transform}
<p className="uppercase">text-transform</p>
| Class | Properties |
|---|---|
uppercase | text-transform: uppercase; |
lowercase | text-transform: lowercase; |
capitalize | text-transform: capitalize; |
normal-case | text-transform: none; |
text overflow
// text overflow
<p className="uppercase">text overflow</p>
| Class | Properties |
|---|---|
truncate | overflow: hidden; |
text-overflow: ellipsis;
white-space: nowrap; |
| text-ellipsis | text-overflow: ellipsis; |
| text-clip | text-overflow: clip; |
vertical align
// vertical align
<span className="inline-block align-baseline">vertical align</span>
| Class | Properties |
|---|---|
align-baseline | vertical-align: baseline; |
align-top | vertical-align: top; |
align-middle | vertical-align: middle; |
align-bottom | vertical-align: bottom; |