Skip to content

Instantly share code, notes, and snippets.

@Deraen
Last active June 26, 2016 08:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Deraen/8b631c587335a71f9862b744c65ac37b to your computer and use it in GitHub Desktop.
Save Deraen/8b631c587335a71f9862b744c65ac37b to your computer and use it in GitHub Desktop.
(ns foobar.font-awesome
(:require [cljsjs.react]))
(defn icon [{:keys [name class size rotate flip fixed-width spin pulse stack inverse component]
:or {component :span}
:as props}]
[component
(assoc props
:class (str "fa fa-" class " "
(if size (str "fa-" size)) " "
(if rotate (str "fa-rotate-" rotate)) " "
(if flip (str "fa-flip-" flip)) " "
(if fixed-width "fa-fw") " "
(if spin "fa-spin") " "
(if pulse "fa-pulse") " "
(if stack (str "fa-stack-" stack)) " "
(if inverse "fa-inverse")))])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment