Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Detect @font-face urls() #2

Closed
jhnns opened this issue Jun 10, 2013 · 4 comments
Closed

Detect @font-face urls() #2

jhnns opened this issue Jun 10, 2013 · 4 comments

Comments

@jhnns
Copy link
Member

jhnns commented Jun 10, 2013

It seems like the css-loader doesn't detect url()s in @font-face declarations

@font-face {
    font-family: 'Museo300';
    src: url(../assets/fonts/Museo/museo300-regular.woff) format('woff'),
         url(../assets/fonts/Museo/museo300-regular.ttf) format('truetype'),
         url(../assets/fonts/Museo/museo300-regular.svg) format('svg');
    font-weight: normal;
    font-style: normal;
}

This declaration is pretty standard (actually generated by fontsquirrel) to support different font formats.

@jhnns
Copy link
Member Author

jhnns commented Jun 10, 2013

I've also changed it to this

@font-face {
    font-family: 'Museo300';
    src: url(../assets/fonts/Museo/museo300-regular.woff) format('woff');
    src: url(../assets/fonts/Museo/museo300-regular.ttf) format('truetype');
    src: url(../assets/fonts/Museo/museo300-regular.svg) format('svg');
    font-weight: normal;
    font-style: normal;
}

@sokra sokra closed this as completed in 688fe54 Jun 10, 2013
@jhnns
Copy link
Member Author

jhnns commented Jun 10, 2013

Works like a charm! Awesome! 👍

@peryamobee
Copy link

and if I don't want webpack detect @font-face url as a required ??

@jhnns
Copy link
Member Author

jhnns commented Mar 10, 2016

You could use root-relative urls which tells the css-loader to ignore these urls (unless you do specify a root url in your options).

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

No branches or pull requests

2 participants