styled-mixin
Super simple wrapper for creating styled-components mixins. Perhaps more human-readable syntax for overwrite rules
Install
npm i --save styled-mixin
Usage
Basic
;; const tomatoColorMixin = createMixin` color: tomato;`; const Header = styledh1` color: black; font-size: 20px;`; const Button = styledbutton` color: black; border: none;`; const TomatoHeader = ;const TomatoButton = ;
Use
;
if you need react-native mode.
Animations
;; const Header = styledh1` color: black;`; const rotate360Keyframes = keyframes` from { transform: rotate(0deg); } to { transform: rotate(360deg); }`; const rotate = createMixin` animation: 2s linear infinite;`; const Uiiiii = ;
With props
;; const blackOrTomatoMixin = createMixin` color: ;`; const Button = ;
Tomato!!!
It's nestable
;; const Header = styledh1` color: black;`; const tomatoColorMixin = createMixin` color: tomato;`; const fontSizeMixin = createMixin` font-size: 20px;`; const TomatoHeader = ;