High Folks,
Hope everyone had a great Christmas!
Does anyone know why Unicode PUA characters (the "" below) do
not work in something like this:
%nav{:role => "navigation"}
%ul#nav
%li
%a{:href => "/", :title => 'Home'}
%span{"aria-hidden" => "true", "data-icon" => ""}
%
span.ir Home
I haven't been able to figure out why, or find similar issues
encountered by others when using them with HAML. It's not a
dealbreaker, this works in ERB:
<nav role="navigation">
<ul id="nav">
<li>
<a title="Home" href="/">
<span data-icon="" aria-hidden="true"></span>
<span class="ir">Home</span>
</a>
</li>
</ul>
</nav>
The reason why I am mapping icons to Unicode PUA characters rather than
regular letters is that screen readers will read the letter and not a
PUA character. In case you're interested, the corresponding CSS looks
like this:
@font-face
font-family: 'icon-fonts'
font-weight: normal
font-style: normal
src: font-url('icon-fonts.eot')
src: font-url('icon-fonts.eot?#iefix') format("embedded-opentype"),
font-url('icon-fonts.svg#icon-fonts') format("svg"),
font-url('icon-fonts.woff') format("woff"), font-url('icon-fonts.ttf')
format("truetype")
[data-icon]:before
font-family: 'icon-fonts'
content: attr(data-icon)
speak: none
font-weight: normal
line-height: 1
-webkit-font-smoothing: antialiased
The fonts were grabbed from here:
http://icomoon.io
Thanks!
Chris