Skip to content

Instantly share code, notes, and snippets.

@guilherme-teodoro
Created November 25, 2016 20:14
Show Gist options
  • Save guilherme-teodoro/4f8329430067d91dcd25e542ab580fdc to your computer and use it in GitHub Desktop.
Save guilherme-teodoro/4f8329430067d91dcd25e542ab580fdc to your computer and use it in GitHub Desktop.
(def sizes {:small (px 8)
:base (px 16)
:big (px 24)
:huge (px 32)})
(def colors {:primary "#1A8EFF"
:dangerous "red"})
(defn style [{:keys [type size]}]
[{:background (stylish/palette colors type :primary)
:color :white
:padding (stylish/palette sizes size :base)
:border :none
:margin (:small sizes)}
[:&:hover {:background "red"}]])
(defn button []
(let [this (r/current-component)
props (r/props this)]
[:button {:class (stylish/style (style props))} "Botão"]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment