javascript - Icons in HTML and CSS as a code (eg: ) -
i participate on project displayed icons this:
<span class="streamline" aria-hidden="true" data-icon="">some label</span>
the project in ruby on rails, thought icons saved in /assets
folder, they're not there.
in css files, see this:
.streamline[data-icon]:after, .filtericons[data-icon]:before, .slicons { font-family: 'streamline'; content: attr(data-icon); speak: none; font-weight: normal; font-variant: normal; text-transform: none; line-height: 1; margin: 0 5% 0 0; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
how icons works? need add new icon, not sure @ how system of displaying icons working - it's thing of css?
thank you
the data-icon
referencing character within icon font streamline
. @ top of stylesheet:
@font-face { font-family: streamline; src: url( /* url .eot file */ ) format("embedded-opentype"), url( /* url .woff file */ ) format("woff"), url( /* url .tff file */ ) format("truetype"), url( /* url .svg file */ ) format("svg"); font-style: normal; font-weight:normal; }
that css defines font-family
streamline
. url's font files show they're located.
if want see icons available in font, can download .tff file , try this:
myfonts - how see characters in font?
to use different icon exists in font you're using, need change data-icon
attribute corresponding html entity (&#*****;
). code, copy character font want use, , paste 'decoded' box on page:
to use icons don't exist in streamline
need replace font files new ones include characters want.
Comments
Post a Comment