- Install
styled-components
npm install --save styled-components
- Require in your namespace
["styled-components" :default styled]
- Create a styled component
(def h1-template (styled "h1"))
(def red-h1 (h1-template [] "color: red"))
- Use as a hx component
(hx/f [red-h1 "cool"])
- Possible improvements
- macro the template fn in step 3
- accept clojure maps instead of string styles