I love Material-UI components, but I donโt like to write a React useStyles custom hook using Material-UI makeStyles() function everytime I need a little bit of CSS, which basically means in all my components files.
Material-UI ๊ตฌ์ฑ ์์๋ฅผ ์ข์ํ์ง๋ง, ๊ธฐ๋ณธ์ ์ผ๋ก ๋ชจ๋ ์ปดํฌ๋ํธ ํ์ผ์์ CSS๊ฐ ์ฝ๊ฐ ํ์ํ ๋๋ง๋ค Material-UImakeStyles()
function์ ์ฌ์ฉํ์ฌ ReactuseStyles
์ปค์คํ hook๋ฅผ ์์ฑํ๋ ๊ฒ์ ์ข์ํ์ง ์๋๋ค.
On the other hand, I love Tailwind-UI for its CSS-in-HTML solution (I invented that term I think, some people call it a utility-first CSS framework).
๋๋ Tailwind-UI์ CSS-in-HTML ์๋ฃจ์ ์ ์ ํธํ๋ค. (์ด๋ค ์ฌ๋๋ค์ ์ด๊ฒ์ utility-first CSS ํ๋ ์์ํฌ๋ผ๊ณ ๋ถ๋ฅธ๋ค.)
The problem is that syncing both Material-UI theme with Tailwind CSS theme may not seems that easy. After a little bit of time, I managed to do it. If you are interesseting, you can see how in this GitHub repo: https://github.com/damien-monni/material-ui-tailwind
๋ฌธ์ ๋ Material-UI ํ ๋ง๋ฅผ Tailwind CSS ํ ๋ง์ ๋๊ธฐํํ๋ ๊ฒ์ด ์ฝ์ง ์์ ๋ณด์ธ๋ค๋ ๊ฒ์ด๋ค. ์ฝ๊ฐ์ ์๊ฐ์ด ๋ค์ฌ ํด๊ฒฐํ ์ ์์๋ค. ์ด GitHub repo์์ ํ์ธํ ์ ์๋ค.
Vue.js Scoped CSS ์ฒ๋ผ ๊ฐ ์ปดํฌ๋ํธ ๋ด๋ถ์ ์คํ์ผ์ ์ ์ํ ์ ์๋ค.
_app.tsx ์์ global.css ๋ฅผ import ํ ์ ์๋ค.
style ์ปดํฌ๋ํธ๋ฅผ import ํ ์ ์๋ค.
The project uses Next.js, which is a framework for server-rendered React apps.
It includes @mui/material and its peer dependencies, including emotion, the default style engine in MUI v5. If you prefer, you can use styled-components instead.
์ด ํ๋ก์ ํธ๋ ์๋ฒ ๋ ๋๋ง React ์ฑ์ ํ๋ ์์ํฌ์ธ Next.js๋ฅผ ์ฌ์ฉํฉ๋๋ค.
@mui/material๊ณผ MUI v5์ ๊ธฐ๋ณธ ์คํ์ผ ์์ง์ธ ์ด๋ชจ์ ์ ํฌํจํ ํผ์ด ์์กด์ฑ์ ํฌํจํ๋ค.
styled-components๋ฅผ ๋์ ์ฌ์ฉํ ์๋ ์๋ค.