일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
Tags
- 간식금지다!
- 언젠간가겠지
- resize
- 클래스 토글
- 포트폴리오
- react-router
- classList toggle
- 퍼블리싱
- 리엑트할수있는퍼블리셔라규
- ROUTER 버전6
- react
- 를
- 방심은금물
- className
- classList add
- 내배위의고양이
- classList remove
- 대표님물리기없기
- 냥빨이다가온다
- 커스텀훅
- 안짤렸다
- chart responsive
- 접근성
- react-router-dom
- classList
- windowwidth
- chart.js
- 2020
Archives
- Today
- Total
틈
[styled component] 기본 내장 함수(?) 본문
/styles/global-styles.ts
:default.css(reset.css) 등을 셋팅할 때 쓴다.
import { createGlobalStyle } from "styled-components";
const GlobalStyle = createGlobalStyle`
article, aside, details, figcaption, figure, footer, header, main, menu, nav, section {
display: block
}
`;
export default GlobalStyle;
/styles/theme.ts
:defaultTheme 셋팅(더 이해해야 할듯..)
import { DefaultTheme } from "styled-components";
const theme: DefaultTheme = {
color: {
laundrygo: "#d0ff00",
laundrygoLine: "#d1fe5c",
white: "#fff",
black: "#000",
},
};
export { theme };
index.tsx에 컴포넌트 추가
import { ThemeProvider } from "styled-components";
import GlobalStyle from "./styles/global-styles";
import { theme } from "./styles/theme";
<ThemeProvider theme={theme}>
<GlobalStyle />
<App />
</ThemeProvider>
'code > React.js' 카테고리의 다른 글
'react-app' 있을 때, eslint 설정 적용하기 (0) | 2022.01.13 |
---|---|
[styled component] 변수 지정하기 (0) | 2022.01.13 |
[REACT] useEffect 사용하기 (0) | 2022.01.10 |
[React] 배열 추가 및 삭제 (0) | 2022.01.09 |
[React] router (0) | 2021.12.31 |
Comments