Skip to content

chaunce/font_awesome_tag_helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FontAwesomeTagHelper

tag helper methods for Font Awesome icons

Usage

icon_tag :icon_name, options_hash

Examples

icon_tag :search

produces:

<i class"icon-search"></i>

icon_tag :search, { id: "search", name: "search_icon" }

produces:

<i id="search" name="search_icon" class="icon-search"></i>

icon_tag :search, { id: "search", name: "search_icon", large: true, pull: "right" }

produces:

<i id="search" name="search_icon" class"icon-search icon-large pull-right"></i>

Available Options

  • id the value of the id attribute. Accepts a string.

  • name the value of the name attribute. Accepts a string.

  • size increases the size of the icon. Adds icon-2x, icon-3x or icon-4x to the class when the value is set to a valid multiplayer 2, 3 or 4. Accepts an integer.

  • large increases the size of the icon. Adds icon-large to the class when the value is set to true. Accepts a boolean.

  • border includes a border around the icon. Adds icon-border to the class when the value is set to true. Accepts a boolean.

  • pull orientates the icon to the left or right. Adds pull-left or pull-right to the class when the value is set to left or right. Accepts a string.

  • spin animates the icon. Adds icon-spin to the class when the value is set to true. Accepts a boolean.

  • li or list formats the icon for a list. Adds icon-li to the class when the value is set to true. Accepts a boolean.

  • width increases the width to the width of the parent element. Adds icon-fixed-width to the class when the value is set to fixed. Accepts a string.

  • rotate turns the icon the specified number of degrees. Adds icon-rotate-90, icon-rotate-180 or icon-rotate-270 to the class when the value is set to 90, 180 or 270. Accepts an integer.

  • width flips the icon. Adds icon-flip-horizontal or icon-flip-vertical to the class when the value is set to horizontal or vertical. Accepts a string.

About

tag helper methods for Font Awesome icons

Resources

License

Stars

Watchers

Forks

Packages

No packages published