ํ์ฌ ๋ชจ๋ ๊ตฌ์ฑ ์์์ ๋ชจ๋ ํ
์คํธ๋ฅผ ๊ฒ์ ์ ๋ฐฐ๊ฒฝ์ ๊ฒ์ ์์ผ๋ก ๋ ๋๋งํ๋ ์ด๋์ด ํ
๋ง๊ฐ ์์ต๋๋ค. ํฐ์์ ์ค๋ฒ๋ผ์ด๋๋ฅผ ํตํด ์ค์ ๋ ๋ฉ๋ด๋ฟ์
๋๋ค.
์๋์์ ๋ณผ ์ ์๋ฏ์ด ์ฌ๋ฌ ๊ฐ์ง๋ฅผ ์๋ํ์ต๋๋ค. ํ์คํ์ง ์์ง๋ง ๋ฌธ์๋ palette.text๋ฅผ ์ฐธ์กฐํ์ง๋ง ์๋ํ์ง ์๋ ๊ฒ ๊ฐ์ต๋๋ค.
์ ์ญ ๊ธ๊ผด ์์์ ์ค์ ํ๋ ค๋ฉด ์ด๋ป๊ฒํฉ๋๊น
import { createMuiTheme } from "material-ui/styles";
const dark = createMuiTheme({
shadows: ["none"],
type: 'dark',
typography: {
color: 'white',
},
palette: {
background: {
paper: '#000',
default: '#000',
},
text: {
default: '#fff',
},
textColor: '#fff',
primary: {
main: '#ff0000',
},
},
root: {
textDecoration: 'none',
},
overrides: {
MuiPaper: {
root: {
boxShadow: 'none',
},
},
MuiBackdrop: {
root: {
backgroundColor: 'rgba(255, 0, 0, 0.75)',
},
},
MuiAppBar: {
root: {
background: 'white',
boxShadow: 'none',
},
colorPrimary: {
backgroundColor: 'transparent'
}
},
MuiIconButton: {
root: {
marginLeft: -12,
marginRight: 20,
color: 'white',
}
}
}
});
export default dark;
https://codesandbox.io/s/kk6zp8jw07
| ๊ธฐ์ | ๋ฒ์ |
| -------------- | --------- |
| Material-UI | 1.00 ๋ฒ ํ .40 |
| ๋ฐ์ | 16.3.0 |
| ๋ธ๋ผ์ฐ์ | ํฌ๋กฌ |
| ๊ธฐํ | |
์ฌ๊ธฐ์ ๋ชจ๋ ๋ฌธ์ํ๋์ด ์์ต๋๋ค : https://material-ui-next.com/style/color/
์ ์ญ ๊ธ๊ผด ์์์ ์ค์ ํ๋ ค๋ฉด ์ด๋ป๊ฒํฉ๋๊น
@afridley ์ ์ญ ๊ธ๊ผด ์์์ด ์์ต๋๋ค. ์ฐพ๊ณ ์๋ ๋๋ถ๋ถ์ ์์์ ํ์ดํฌ๊ทธ๋ํผ ๋ถ๋ถ์์ ๋์ต๋๋ค. ๋ฌธ์๋ฅผ ๋ ์์ธํ ์ฝ์ด์ผํฉ๋๋ค.
const theme = createMuiTheme({
- type: "dark",
palette: {
+ type: "dark",
},
});
@oliviertassinari Ahh ๋ด๊ฐ ๊ทธ๊ฒ์ ๋์ณค๋ค๋ ๊ฒ์ ๋ฏฟ์ ์์๋ ๋น ๋ฅธ ๋ต์ฅ์ ๊ฐ์ฌ๋๋ฆฝ๋๋ค. ๋๋ ๋ฐฉ๋ฒ์ ๋ํ ๋ฉ๋ชจ๋ฅผ ์๊ฐํ๊ณ ์์๋ค
palette: {
+ type: "dark",
},
ํ๋ ํธ. ํ ์คํธ ๋ณ๊ฒฝ์ ๋ฌด์์ ๋ฃ์์ง ์๋ค๋ฉด ์๋์ผ๋ก ๊ธฐ๋ณธ ๊ธ๊ผด ์์์ ๋ณ๊ฒฝํ ์ ์์์ ์๋ฏธํฉ๋๋ค.
palette.background์ ์ข ์ด์ ๊ธฐ๋ณธ๊ฐ์ด์๋ ๊ฒ๊ณผ ๊ฐ์ต๋๋ค. ๋๋ palette.text๊ฐ ๋น์ทํ ๊ฐ์ ๊ฐ์ง ์ ์๋ค๊ณ ์๊ฐํ์ต๋๋ค. ๊ทธ๋ฌ๋ ์ข ์ด์ ๊ธฐ๋ณธ๊ฐ์ด ์ด๋์์ ์๋์ง์ ๋ํ ๋ฌธ์๋ฅผ ์ฐพ์ ์ ์์์ต๋๋ค.
๊ทธ๋์ ๋๋ ๋ฐํ ํฐ์ผ์์๋ง ์ฐพ์ ์ ์๊ธฐ ๋๋ฌธ์ ์ด๋ฌํ ๊ฐ์ ๋ํ ๋ฌธ์๊ฐ ์๋์ง ๊ถ๊ธํฉ๋๋ค.
palette.text
palette.divider
palette.background
palette.action
ex This works
palette: {
background: {
paper: '#000',
default: '#000',
},
},
But what values can I change in
palette: {
text: {
?: '#000',
?: '#000',
},
},
์ฌ๊ธฐ ๋ฌธ์๋ฅผ ๊ธฐ๋ฐ์ผ๋กํฉ๋๋ค. https://material-ui-next.com/customization/themes/#type -light-dark-theme-
@afridley ๋ณ๊ฒฝํ ์์๋ ๊ฐ์ ๊ธฐ๋ณธ, ๋ณด์กฐ, ๋นํ์ฑํ ๋ฐ ํํธ์ ๋๋ค. ๊ธฐ๋ณธ ํ ๋ง ๊ฐ์ฒด๋ฅผ ์ดํด๋ณด๋ฉด ๋ณ๊ฒฝ ๊ฐ๋ฅํ ํญ๋ชฉ๊ณผ ๋ฐฉ๋ฒ์ ํ์ ํ๋ ๋ฐ ๋์์ด ๋ ์ ์์ต๋๋ค.
๋ค์์ https://material-ui.com/customization/default-theme/ ๋งํฌ์ ๋๋ค.
))) ์์ ๋ด๊ธฐ ์ํด ๋ช ์๊ฐ์ ๋ณด๋ด์ญ์์ค ... ๊ทธ๋์ :
palette: {
text: {
primary: "#ffffff",
secondary: "#00000"
}
}
color = "textPrimary"
color = "textSecondary"
๊ฐ์ฌํฉ๋๋ค, Sleazer!
์ํฉ์ v4์์ ๊ฐ์ ๋์์ ๊ฒ์
๋๋ค. CssBasline ๊ตฌ์ฑ ์์๋ ๋ณธ๋ฌธ ์์์ theme.palette.text.primary
์ ์ ์ฉํฉ๋๋ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
))) ์์ ๋ด๊ธฐ ์ํด ๋ช ์๊ฐ์ ๋ณด๋ด์ญ์์ค ... ๊ทธ๋์ :
color = "textPrimary"
color = "textSecondary"
๊ฐ์ฌํฉ๋๋ค, Sleazer!