๐ŸŸฉ Frontend-HTML & CSS & +JS/๐Ÿ”ฐ React

๋ฆฌ์•กํŠธ์— ์Šคํƒ€์ผ ์—ฌ๋Ÿฌ๊ฐœ ์ฃผ๊ธฐ (classNames ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ)

ramen2 2024. 12. 29. 00:15
๋ฐ˜์‘ํ˜•

1. ์•„๋ž˜์™€ ๊ฐ™์ด classNames๋ฅผ ์„ค์น˜ํ•จ

npm install classnames ํ˜น์€ yarn add classnames

 

 

 

2. ์ƒ๋‹จ์— import , ์„ค์น˜ํ›„์—๋Š” ์•„๋ž˜์™€ ๊ฐ™์ด ๋‘๊ฐ€์ง€๋ฅผ ๋™์‹œ์— ๋„ฃ์„ ์ˆ˜ ์žˆ์Œ 

import classNames from 'classnames';

 

<div className={classNames(styles.slide_text_wrap, styles.margin_lr)}>

 

 

 

 

 

--- ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š”, ๋‹ค๋ฅธ ๋ฐฉ๋ฒ• : ํ…œํ”Œ๋ฆฟ ๋ฌธ์ž์—ด ์‚ฌ์šฉ ---

<div className={`${styles.slide_text_wrap} ${styles.margin_lr}`}>

 

 

 

๋ฐ˜์‘ํ˜•