I'm building the front-end of a project with Bootstrap and I'm looking to use the Glyphicons found in 3.0.0 instead of usual text. How would I do this?
Those of you familiar with Holder.js will know that the JS basically creates place-holder images on the client side. This has useful bandwidth saving applications, as you only need to download the weight of the script (about 4Kb) and let the client's machine generate the images.
I want to combine the Glyphicons with holder.js, to produce large high-quality icons on the fly.
Calling a Glyphicon with Bootstrap is straight forward as follows:
<span class="glyphicon glyphicon-user"></span>
Calling a dynamic image with the text of "Hello World" with holder.js is done as follows:
<img data-src="holder.js/200x200/text:Hello World">
I understand that the Bootstrap CSS defines the Glyphicon class as a font, and then uses a pseudo before element to call the specific character defined by a secondary class. See below:
.glyphicon {
position: relative;
top: 1px;
display: inline-block;
font-family: 'Glyphicons Halflings';
-webkit-font-smoothing: antialiased;
font-style: normal;
font-weight: normal;
line-height: 1;
}
.glyphicon-user:before {
content: "\e008";
}
How do I go about easily passing a specific glyphicon character in the correct font to holder.js, to output an image icon?