๐Ÿ“Œ react์—์„œ ๊ฐ๊ฐ์˜ ์ปดํฌ๋„ŒํŠธ๋“ค ์•ˆ์— className์ด ๋™์ผํ•˜๊ณ , css style ํŒŒ์ผ์ด ์ชผ๊ฐœ์ ธ ์žˆ๋Š” ๊ฒฝ์šฐ,

๋งจ ๋งˆ์ง€๋ง‰์— import ๋œ style๋กœ ๋ฎ์—ฌ์”Œ์›Œ์ง„๋‹ค.

์ด๋•Œ ํ•„์š”ํ•œ ๊ฒƒ์ด Post CSS!!

<aside> ๐Ÿ’ก

  1. css ํŒŒ์ผ์— module ์„ ์ถ”๊ฐ€

    ex) Button.css โ†’ Button.module.css

  2. import ํ•˜๋Š” ํŒŒ์ผ์—์„œ ๊ฐ์ฒด ์ด๋ฆ„ ๋งŒ๋“ค์–ด์„œ ๋ถˆ๋Ÿฌ์˜ค๊ธฐ

ex) import styles from โ€œ./Button.module.cssโ€

  1. className์—์„œ โ€œ โ€์ŠคํŠธ๋ง ๋ฌธ์ž์—ด์ด ์•„๋‹Œ ๊ฐ์ฒด๋กœ ๋ถˆ๋Ÿฌ์˜ค๊ธฐ

    ex) className=โ€buttonโ€ โ†’ className={styles.button}

</aside>

๐Ÿ“Œ className ์—ฌ๋Ÿฌ๊ฐœ ์“ฐ๊ณ  ์‹ถ์„ ๋•Œ,

<div className={styles.title} />
.
.
.

<div **className={`${styles.title} ${styles.main_title}`}** />