styled components
Styled-Component 는 스타일을 가진 컴포넌트를 만들 수 있도록 도와주는 CSS-in-JS 라이브러리 입니다.
Last updated
Styled-Component 는 스타일을 가진 컴포넌트를 만들 수 있도록 도와주는 CSS-in-JS 라이브러리 입니다.
Last updated
import React, { Component, Fragment } from 'react';
import styled from 'styled-components'; //styled-components 불러오
import styled, { createGlobalStyle } from "styled-components"; // reset css 사
const GlobalStyle = createGlobalStyle`
body {
margin: 50px;
padding: 50px;
background-color: black;
}
`;
class App extends Component {
render() {
return (
<Fragment>
<GlobalStyle></GlobalStyle> // reset css 추가
<Button>Hello</Button>
<Button danger>Hello</Button>
</Fragment>
)
}
}
const Button = styled.button`
border-radius: 50px;
padding: 5px;
min-width: 120px;
color: white;
font-weight: 600;
-webkit-appearance: none;
cursor: pointer;
&:active,
&:focus {
outline: none;
}
`;
export default App;