스타일컴포넌트
위 주소로 가면 기본으로 적어줘야할 양식이 있는데, 붙여넣기 후 아래 속성들만 원하는대로 바꾸어준다.
// import original module declarations
import 'styled-components';
// and extend them!
declare module 'styled-components' {
export interface DefaultTheme {
textColor: string;
bgColor: string;
btnColor: string;
}
}
여기에 theme를 정의를 하고, styled.d.ts안의 속성들은 동일해야 한다.
import { DefaultTheme } from "styled-components";
export const lightTheme:DefaultTheme = {
bgColor: "white",
textColor: "black",
btnColor: "tomato"
}
export const darkTheme:DefaultTheme = {
bgColor: "black",
textColor: "white",
btnColor: "teal"
}
기존 스타일컴포넌트로 테마를 적용해주는 것과 동일하다.
import React from 'react';
import ReactDOM from 'react-dom';
import { ThemeProvider } from 'styled-components';
import App from './App';
import { lightTheme, darkTheme } from './theme';
ReactDOM.render(
<React.StrictMode>
<ThemeProvider theme={lightTheme}>
<App />
</ThemeProvider>
</React.StrictMode>,
document.getElementById('root')
);
import styled from "styled-components";
function App() {
const Container = styled.div`
background-color: ${props => props.theme.bgColor};
`;
const H1 = styled.div`
color: ${props => props.theme.textColor}
`;
return (
<Container>
<H1>Hello</H1>
</Container>
);
}
export default App;
In today's world, it's essential to save information directly to your phone's memory. That's where https://savetiktok.org comes in handy. It allows you to quickly download tiktok videos to your phone. The site's creators have ensured fast download speeds, so it won't take much time. And I love it.
I highly recommend it! Because i use it every day by myself!