theophilusx.yorick.icon

Provides functions and components useful when adding font awesome icons.

deficon

(deficon name & {:keys [position span-class icon-class size]})

Create an icon data map which defines the data used to generate an icon component. The name argument is the name of a font awesome icon. Supported optional keyword arguments are

Key Description
:position Position of the icon. Can be either :left or :right
:size Size of the icon. Can be one of :small, :medium or
:large
:icon-class Additional CSS classes to add to the <i> element
:span-class Additional CSS classes to add to the enclosing <span>
element

icon-component

(icon-component icon-data)

Generate an icon component from icon-data map. The icon-data map is a map with keys for :name, :position, :size, :icon-class and :span-class. Only :name is required. See the function deficon for a convenience function to generate the map.

icon-control-class

(icon-control-class icon-data)

This function is used to extract the icon position classes from a vector of icon data maps. When adding icons to some elements, it is necessary to add the icon position classes to the parent element that wraps around the icons. This function provides that convenience. The icon-data can be either an icon data map or a vector of icon data maps.

icons

(icons icon-data)

Generates a vector of icon components from icon data. The icon-data can be either a map or a vector of icon data maps