CSS in JS
키워드
CSS in JS
CSS
참고 레퍼런스:
flexbox
Grid
CSS in JS
컴포넌트 중심으로 사고할 수 있다.
Global Namespace
Dependencies
Dead Code Elimination
Minification
Sharing Constants
Non-deterministic Resolution
Isolation
Scoped styles
Critical CSS
Smarter optimisations
Package management
Non-browser styling
Thinking in components
CSS-in-JS leverages the full power of the JavaScript ecosystem to enhance CSS.
True rules isolation
Scoped selectors
Vendor Prefixing
Code sharing
Only the styles which are currently in use on your screen are also in the DOM (react-jss).
Dead code elimination
Unit tests for CSS
→ 2023년 1월 기준으로 styled-components, JSS, Emotion 순서.
성능 이슈
→ CSS 파일과 JS 파일 로딩의 차이.
대안:
CSS를 평범한 텍스트로 작성.
React에 종속적이지 않지만, React Styled Component도 지원함.
CSS를 오브젝트 형태로 표현. React의 Inline Style과 유사함.
React와 무관하게 사용 가능.
CSS(Cascading Style Sheets)
CSS (Cascading Style Sheets)는 웹페이지를 꾸미려고 작성하는 코드
Last updated