Skip to content

Instantly share code, notes, and snippets.

@pfig
Created September 16, 2013 11:21
Show Gist options
  • Save pfig/6579409 to your computer and use it in GitHub Desktop.
Save pfig/6579409 to your computer and use it in GitHub Desktop.
SCSS code to support font icons (including standalone ones).
$fontName: 'Scribbles';
$fontFileName: '../font/Scribbles';
@font-face {
font: {
family: $fontName;
weight: normal;
style: normal;
}
src:url('#{$fontFileName}.eot');
src:url('#{$fontFileName}.eot?#iefix') format('embedded-opentype'),
url('#{$fontFileName}.woff') format('woff'),
url('#{$fontFileName}.ttf') format('truetype'),
url('#{$fontFileName}.svg##{$fontName}') format('svg');
}
[data-icon]:before {
font: {
family: $fontName;
weight: normal;
variant: normal;
}
content: attr(data-icon);
speak: none;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-alone {
display: inline-block;
}
// From H5BP - http://h5bp.com/
.visuallyhidden {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment