Skip to content

Instantly share code, notes, and snippets.

@cmattoon
Created March 7, 2014 15:13
Show Gist options
  • Save cmattoon/9413244 to your computer and use it in GitHub Desktop.
Save cmattoon/9413244 to your computer and use it in GitHub Desktop.
Script to pull FontAwesome "content" values.
var icons = {};
var ignore = ['fa-lg', 'fa-fw', 'fa'];
$('.container i.fa').each(function() {
var val, icon_name, icon_value, i;
val = window.getComputedStyle($(this).get(0), ':before').getPropertyValue('content');
icon_name = $(this).attr('class').split(' ')[1];
console.log(icon_name);
charcode = val.charCodeAt(0).toString(16);
icons[icon_name] = charcode;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment