250x250
Recent Posts
Recent Comments
Link
์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- icecandidate
- custom hook
- svgํ์ผ ๋ค๋ฃจ๊ธฐ
- ์๋ฐ์คํฌ๋ฆฝํธ
- ์๋ฐฉํฅ ์ฐ๊ฒฐ ๋ฆฌ์คํธ
- ํ๋ก๊ทธ๋๋จธ์ค
- DP
- router v6
- ๋๋๊ทธ ์ด๋ฒคํธ
- ์ฝ๋ ํฌ๋ฉง
- React
- TypeScript
- ์ด๋ฏธ์ง ์์
- ์นด์นด์ค
- ์ฝํ
- ์ด๋ถํ์
- ๋ธ๋ฃจํธํฌ์ค
- js
- ์นด์นด์ค์ฑ์ฉ
- ์ฝ๋ฉํ ์คํธ
- ๊ณผ์ ํ ์คํธ
- ๋ฆฌ๋์ค ํดํท
- ๋ถ์คํธ์บ ํ์น๋ชจ๋ฐ์ผ
- Node.js
- Redux toolkit
- ๋ถ์คํธ์ปจํผ๋ฐ์ค
- JavaScript
- ์๊ณ ๋ฆฌ์ฆ
- ๋์ ๊ณํ๋ฒ
- ๋ฐฑ์ค
Archives
- Today
- Total
๐ฅ dev-ruby
[๋ฆฌ์กํธ]Material UI ์ปดํฌ๋ํธ์ Css Style ์ ์ฉํ๊ธฐ - ๋๋ง์ ์ปดํฌ๋ํธ ๋ง๋ค๊ธฐ ๋ณธ๋ฌธ
React
[๋ฆฌ์กํธ]Material UI ์ปดํฌ๋ํธ์ Css Style ์ ์ฉํ๊ธฐ - ๋๋ง์ ์ปดํฌ๋ํธ ๋ง๋ค๊ธฐ
ruby_s 2021. 12. 1. 02:24728x90
๋ฐ์ํ
SMALL
https://mui.com/styles/basics/
@mui/styles - MUI
The legacy styling solution of MUI.
mui.com
meterial ui์์ ์ ๊ณตํด์ฃผ๋ styles api๊ฐ ๋ฐ๋ก ์๋ค.
๋จผ์ , ์ค์น๋ฅผ ํด์ค๋ค.
npm install @mui/styles
react hook์์๋ ์๋์ฒ๋ผ ์ฌ์ฉํ๋ค.
import * as React from 'react';
import { makeStyles } from '@mui/styles';
import Button from '@mui/material/Button';
const useStyles = makeStyles({
root: {
background: 'linear-gradient(45deg, #FE6B8B 30%, #FF8E53 90%)',
border: 0,
borderRadius: 3,
boxShadow: '0 3px 5px 2px rgba(255, 105, 135, .3)',
color: 'white',
height: 48,
padding: '0 30px',
},
});
export default function Hook() {
const classes = useStyles();
return <Button className={classes.root}>Hook</Button>;
}
const useStyles์ฒ๋ผ ์คํ์ผ ํจ์๋ฅผ ๋ฐ๋ก ์์ฑํ ์ ์๋ค.
makeStyles์์ root์ฒ๋ผ, container gnb ๋ฑ๋ฑ ํด๋์ค์ ์ด๋ฆ ์์ ๊ฐ์ฒด ํ์์ผ๋ก css๋ฅผ ์์ฑํด์ฃผ๋ฉด ๋๋ค.
์คํ์ผ์ ์์ฑํ์ผ๋ฉด, ํจ์ ์์์ ๋ณ์์ useStylesํจ์๋ฅผ ํธ์ถํ์ฌ ํ๊ทธ์ className์ ์ ์ฉ์์ผ์ฃผ๋ฉด ์ํ๋ ๋์์ธ์ ์ปดํฌ๋ํธ๋ฅผ ์์ฑํ ์ ์๋ค~
728x90
๋ฐ์ํ
LIST