Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add woff data uri to generated CSS + template helper #182

Merged
merged 1 commit into from
Oct 12, 2014

Conversation

jvatic
Copy link
Contributor

@jvatic jvatic commented Feb 11, 2014

No description provided.

@endtwist endtwist merged commit c5ffc30 into FontCustom:master Oct 12, 2014
@kuon
Copy link

kuon commented Oct 22, 2014

I have the same problem as @markbrown4 it seems the data URI is not quoted properly, causing SCSS error.

Invalid CSS after "...  font-url(data": expected comma, was ":application/x-..."

@jvatic
Copy link
Contributor Author

jvatic commented Oct 22, 2014

@markbrown4, @kuon what version of sass are you using? This is working fine for me with versions 3.4.5 and 3.4.6.

@markbrown4 The data-uri improves user experience through the icon font loading at the same time as other styles instead of a bit after. The regular url is included for browsers that don't support the data-uri but support woff. If you're worried about the added overhead you could load the font in a separate css file without loosing the benefits of the data-uri. It's possible to remove the data-uri if you don't want it by using a custom template.

@kuon
Copy link

kuon commented Oct 22, 2014

I'm using sass 3.2.19, but I'll see if I can upgrade.

@kuon
Copy link

kuon commented Oct 22, 2014

Actually I can't upgrade, because sass-rails requires sass 3.2.x.

@markbrown4
Copy link

I've tried with 3.4.5 and 3.4.6 and no dice yet, using the latest sass-rails and compass.

@jvatic I believe the font-url helper is the compass method and only accepts a path to a file.
http://compass-style.org/reference/compass/helpers/urls/#font-url

When you compile the css file does it output font-url() or url()?

@jvatic
Copy link
Contributor Author

jvatic commented Oct 23, 2014

@markbrown4 Sorry to hear that. I don't think font-url is isolated to compass, but this should really be configurable in the yaml (OSS FTW 😉).

@ghost
Copy link

ghost commented Nov 10, 2014

The woff data uri breaks functionality in IE8 and is NOT a "bulletproof" solution which is shown in the "FontSpring's Bulletproof @font-face syntax"-link mentioned in the manual.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants