styled-components

leephoter·2021년 7월 20일
0

React

목록 보기
1/3
import styled from 'styled-components'

const V1Component = styled.h2`
	width: 100px;
	hieght: 50px;
	...
	`
//styled.htmlTagName` style `

const V2Component = styled('h2')`
	width: 100px;
	hieght: 50px;
	...  
	`
//styled('htmlTagName')` style `

const V3Component = styled(Component)`
	width: 100px;
	hieght: 50px;
	...  
	`
//styled(컴포넌트) ` style `

const V4Component = styled.input.attrs(({ 태그속성1, 태그속성2, 태그속성3 }) => ({
    placeholder: 태그속성1,
    fontSize: 태그속성2,
}))`
	font-size: ${(props) => props.fontSize};
`;
profile
🔥 🧑🏾‍💻 🔥

0개의 댓글