Font Awesome 5 "Power Transform" like functionality using straight CSS
Font Awesome 5 provides some really neat functionality they call Power Transforms. Power Transforms allow you to shrink icons, rotate icons, and layer icons in endless ways.
The problem is, Power Transforms are only available to users of the SVG + JS version of Font Awesome. At this time, I prefer the web fonts version for performance reasons.
This project attempts to recreate some of the key Power Transform features in straight CSS.
rotate-n
- Rotates the icon by a given number of degrees.
- Supports whole numbers only, multiples of 5, -355 to 355.
flip-h
, flip-h
- Flips an icon horizontally, vertically, or both.
shrink-n
, grow-n
- Reduces the size, or increases the size.
- Supports whole numbers from 1 to 16.
The Web Fonts version does offer stacking using the .fa-stack
class, but the .fa-layers
class is far more powerful.
Unlike the Font Awesome 5 implementation, the following options are only available to icons inside a .fa-layers
container.
up-n
, down-n
, left-n
, right-n
- Supports whole numbers from 1 to 8.
Note that the following attributes may require updated the CSS for your template.
data-fa-mask=""
- Slightly different than the Font Awesome 5 specification.
- The existence of this attribute will attempt to set the icon's color to that of the background.
data-fa-glow=""
- Adds an outline to the icon for some really fancy layering.
- Defaults to white, with some Bootstrap 3 background color options.
- Include a value of
black
,danger
,warning
,info
, orsuccess
to force a specific glow color. - Defaults to an outline width of
4px
.- Include a value of
1px
,2px
, or3px
for a thinner width (or no width in IE). - Include a value from
5px
to9px
for a thicker width. (Not supported by IE.)
- Include a value of