CSS in JS : styled-components


CSS in JS : styled-components

https://styled-components.com/ styled-components Visual primitives for the component age. Use the best bits of ES6 and CSS to style your apps without stress c styled-components.com 1. styled-components 사용하기전에 Template Literal에 대해 먼저 알아야 한다. const name = 'template literal'; const message = `string text ${name}`; console.log(message); //string text template literal 간단히 말해서 string에 변수를 조합해서 사용하는 방식이다. 이것이 필요한 이유는 CSS를 string 형태로 정의해서 사용하기 때문이다. 이렇게 쓰지 않는다면 엄청나게 길어지는 string + 를 보게 될것이다... 2. Styled-...



원문링크 : CSS in JS : styled-components