Created
September 16, 2013 11:21
-
-
Save pfig/6579409 to your computer and use it in GitHub Desktop.
SCSS code to support font icons (including standalone ones).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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