React

[React] Tailwind ํ•œ์ค„, ๋‘์ค„, ์„ธ์ค„ ํšจ๊ณผ className ์ปค์Šคํ…€

martinooo 2024. 6. 3. 18:58

๐Ÿคท‍โ™‚๏ธ Tailwind ํ•œ์ค„, ๋‘์ค„, ์„ธ์ค„ ํšจ๊ณผ


ํ”„๋กœ์ ํŠธ ์ง„ํ–‰์ค‘ ๋ฐฐ๋„ˆ ๋งํฌ์— URL ๊ธธ์ด๊ฐ€ ๋„ˆ๋ฌด ๊ธธ์–ด์„œ 3์ค„ ํšจ๊ณผ ์ฒ˜๋ฆฌ๋ฅผ ํ•ด์•ผ ํ–ˆ์Šต๋‹ˆ๋‹ค.

React + Tailwind CSS ์…‹ํŒ…๋œ ํ”„๋กœ์ ํŠธ ์—ฌ์„œ CSS ํŒŒ์ผ & style ํƒœ๊ทธ๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š๊ณ  className ์†์„ฑ์„ ํ™œ์šฉํ•ด์„œ CSS ์Šคํƒ€์ผ๋ง ํ•ด์•ผ ํ–ˆ์Šต๋‹ˆ๋‹ค. 

 

๊ธฐ์กด์— ๋ฐฉ์‹์œผ๋กœ ํ•œ์ค„ ํšจ๊ณผ ์Šคํƒ€์ผ๋ง์„ ํ•˜๋ ค๊ณ  ํ–ˆ์œผ๋‚˜ tailwind CSS ๋ฐฉ์‹์ด ๋‹ฌ๋ผ์„œ ๋‹ค๋ฅธ ์ข‹์€ ๋ฐฉ๋ฒ•์„ ์ฐพ์•˜์Šต๋‹ˆ๋‹ค.

 

ํ•œ์ค„ ํšจ๊ณผ ๊ธฐ์กด CSS ๋ฐฉ์‹

p {
   width: 6rem;
   text-overflow: ellipsis;
   overflow: hidden;
   word-break: break-word;
    
   display: -webkit-box;
   -webkit-line-clamp: 3; // ์›ํ•˜๋Š” ๋ผ์ธ ์ˆ˜ 1์ค„, 2์ค„, 3์ค„
   -webkit-box-orient: vertical
}

 

๊ธฐ์กด ๋ฐฉ์‹์ธ ์œ„์— CSS ์†์„ฑ์„ ์ ์šฉํ•˜๋ฉด ๋˜์ง€๋งŒ Tailwind CSS์—์„œ๋Š” webkit ์†์„ฑ์„ ์ ์šฉํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.

Tailwind CSS์—์„œ ์ ์šฉ ๋ฐฉ๋ฒ•์€ customizing ์œผ๋กœ ํ•œ์ค„ ํšจ๊ณผ๋ฅผ ์ ์šฉ ์‹œํ‚ฌ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

Next.js์™€ tailwind ์ ์šฉ ๋ฐฉ๋ฒ•

https://cometruedream.tistory.com/245

 

Next JS์—์„œ tailwind ์ ์šฉ ์•ˆ๋ ๋•Œ ํ•ด๊ฒฐ๋ฐฉ๋ฒ•

๐Ÿคท‍โ™‚๏ธ ๋ณธ๋ก ์— ์•ž์„œTailwind๋ž€?Tailwind CSS๋Š” React์™€ Next ํ”„๋ ˆ์ž„์›Œํฌ์—์„œ ๋งŽ์ด ์‚ฌ์šฉ๋˜๋Š” CSS ํ”„๋ ˆ์ž„ ์›Œํฌ์ž…๋‹ˆ๋‹ค. Tailwind CSS๋Š” ‘utility-first’ ๋ชฉ์ ์„ ๊ธฐ๋ฐ˜์œผ๋กœ ๋‹ค๋ฅธ CSS ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์™€ ๋‹ฌ๋ฆฌ CSS ํŒŒ์ผ & st

cometruedream.tistory.com

 

 

 

1. ์ „์—ญ์œผ๋กœ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด์„œ globals.css ํŒŒ์ผ์— ์…‹ํŒ…

 

 

@layer base ์•ˆ์— .text-overflow ํด๋ž˜์Šค๋ฅผ ์ ์šฉํ•ด์ค€๋‹ค.

 

2. globals.css .text-overflow ์ ์šฉ ํ›„ ์‚ฌ์šฉํ•˜๋ ค๋Š” HTML ํƒœ๊ทธ์— className์„ ์ ์šฉ์„ ํ•ด์ค€๋‹ค.

 

 

ํ•œ์ค„ ํšจ๊ณผ ๊ธฐ์กด CSS ๋ฐฉ์‹

 

 

 

 

 

 


 

์žฌ๋ฐŒ๋Š” ์˜ค๋Š˜์˜ ๋ ๋ณ„ ์šด์„ธ ๋ณด๊ณ  ๊ฐ€์„ธ์š”! 

 

 

 

https://cometruedream.tistory.com/243

 

NestJS Lifecycle (์ƒ๋ช…์ฃผ๊ธฐ) ๊ฐœ๋…

๐Ÿคท‍โ™‚๏ธ ๋ณธ๋ก ์— ์•ž์„œ Nest JS ๊ฐœ๋…?Nest JS๋Š” Node JS ๊ธฐ๋ฐ˜์œผ๋กœ ํ•œ ์„œ๋ฒ„ ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜ ํ”„๋ ˆ์ž„์›Œํฌ ์ž…๋‹ˆ๋‹ค. ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋Š” ์ƒ๋‹นํžˆ ์˜ค๋žซ๋™์•ˆ Express ๊ธฐ๋ฐ˜์œผ๋กœ ์„œ๋ฒ„ ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜ ๊ฐœ๋ฐœ์—์„œ ์••๋„์ ์ธ ์ 

cometruedream.tistory.com

 

 

https://cometruedream.tistory.com/242

 

๋ฆฌ์•กํŠธ Vite Proxy ํ™œ์šฉํ•œ CORS ์˜ค๋ฅ˜ ํ•ด๊ฒฐ

๐Ÿคท‍โ™‚๏ธ ๋ณธ๋ก ์— ์•ž์„œํ”„๋ก ํŠธ์—”๋“œ ๋ฒˆ๋“ค๋Ÿฌ ๊ฐœ๋…๊ณผ webpack vs vite ๋น„๊ต์— ๋Œ€ํ•ด์„œ ๊ณต๋ถ€๋ฅผ ํ•˜๊ณ  ๊ธ€์„ ๋ณด์‹œ๋ฉด ๋” ๋งŽ์€ ๋„์›€์ด ๋ฉ๋‹ˆ๋‹ค^^ํ”„๋ก ํŠธ์—”๋“œ ๊ฐœ๋ฐœ์„ ์œ„ํ•œ ๋ฒˆ๋“ค๋Ÿฌ ๊ฐœ๋…๊ณผ webpack vs vite ๋น„๊ตhttps://comet

cometruedream.tistory.com

 

 

https://cometruedream.tistory.com/241

 

React ํด๋”๊ตฌ์กฐ FSD ๊ธฐ๋Šฅ ๋ถ„ํ™œ ์„ค๊ณ„ ์•„ํ‚คํ…์ฒ˜

๐Ÿคท‍โ™‚๏ธ ๋ณธ๋ก ์— ์•ž์„œํ”„๋กœ์ ํŠธ๋ฅผ ์‹œ์ž‘ํ•˜๊ธฐ์— ์•ž์„œ ํด๋” ๊ตฌ์กฐ, ์„ค๊ณ„์— ๋Œ€ํ•œ ์•„ํ‚คํ…์ฒ˜๋ฅผ ๋งŒ๋“œ๋Š” ๊ฒƒ์€ ์ƒ๋‹นํžˆ ์–ด๋ ต๋‹ค. ์ด๋ฒˆ ํ”„๋กœ์ ํŠธ์— React FSD ํด๋”๊ตฌ์กฐ ์•„ํ‚คํ…์ฒ˜๋ฅผ ์„ค๊ณ„ํ•  ์˜ˆ์ •์ด๋ผ์„œ FSD ์•„ํ‚คํ…

cometruedream.tistory.com

 

 

https://cometruedream.tistory.com/244

 

์‰ฝ๊ฒŒ ์ดํ•ดํ•˜๊ณ  ์‚ฌ์šฉํ• ์ˆ˜ ์žˆ๋Š” Prisma ๋ช…๋ น์–ด ์ •๋ฆฌ

๐Ÿคท‍โ™‚๏ธ Prisma ๋ช…๋ น์–ด ๋ณธ๋ก ์— ์•ž์„œ Prisma๋ž€?Nest JS ํ”„๋ ˆ์ž„์›Œํฌ์™€ Prisma ORM์„ ํ™œ์šฉํ•ด์„œ ํ”„๋กœ์ ํŠธ๋ฅผ ์ง„ํ–‰ํ•˜๋ฉด์„œ Prisma๋Š” Node JS ๊ธฐ๋ฐ˜์— ํ”„๋ ˆ์ž„์›Œํฌ/๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์™€ ์ƒํ˜ธ์ž‘์šฉ์ด ์ž˜๋˜๋ฉฐ Prisma + DB ์—ฐ๋™์œผ

cometruedream.tistory.com