Ligature Icon

Using the data attribute data-icon we can set our pseudo elements to use the ligature typeface and rules.

The benefits are its extremely clear what icon your using thanks to ligatures, but you are also keeping the code super DRY. ALso by inspecting the markup you make very clear assumptions of where the element is being added and what icon it is.

I am a span

A paragraph that I can place an icon at the front. Added a class to give it that styling we wanted.

This idea also works on any element that can use the pseudo elements. The attribute sets the most basic of styling to the before pseudo element. Style away!!!