-
Notifications
You must be signed in to change notification settings - Fork 2
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
Urls for font-face are incorrectly parsed #5
Comments
@daisio did this just happen recently? I merged a PR that changed the AST modification to a RegExp that may be causing the issue. |
Hey Tim, I can't say for sure as I just started using BBB, but when I installed your example app the github-viewer it affects that as well. @font-face {
font-family: 'Glyphicons Halflings';
src: url('/app/img/vendor/bower/bootstrap/dist/fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),
url('../fonts/glyphicons-halflings-regular.woff') format('woff'),
url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'),
url('../fonts/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg');
}
// line breaks added for readability Maybe I'm missing something but it doesn't seem like the logic for this works anyway because if you import from a package, the images of the package will never exist in For instance if I install package foo with a structure of: vendor
---bower
------foo
---------dist
------------css
---------------style.css
------------img
---------------logo.png
------------js
------------font Then in my @import "../../vendor/bower/foo/dist/css/style.css"; And inside my header .logo {
width: 300px;
height: 65px;
background: #fff url('../img/logo.png') no-repeat;
} In the release header .logo {
width: 300px;
height: 65px;
background: #fff url('app/img/vendor/bower/foo/dist/img/logo.png') no-repeat;
} And that file structure and image Or at least this is what I'm seeing so far. I'm having to copy my stylesheets and images from my package and move them to the app folder, then I change the paths in the stylesheet and import the moved stylesheets and it seems to work as expected because the images are then found correctly. If you're not seeing this behavior or I'm doing something incorrectly please advise. |
I'm also seeing this issue with fonts as well as images that are located within the specific plugin folder located in the bower_components folder (using backbone boilerplate). For example, the select2 plugin stores all imgs and css at the same level as the js file. The select2.css contains url(select2.png) and both are located in /bower_components/select2/: /bower_components/select2/select2.js In my app/styles/index.css:
After the styles task has run, styles.css contains:
If I remove the forceRelative option then I end up with:
Both of which are wrong as it should be:
assuming that I have copied the bower_components folders to my dist/ folder (a separate issue as the bbb task (copy.coffee) is still looking for 'vendor/**' folder even though .bowerrc now uses 'bower_components'. At the moment my app runs perfectly in development mode but breaks in release. If I'm doing it wrong and should be including fonts/plugins in a different way then will gladly change. Cheers, Dave |
When importing stylesheets on a grunt build @font-face urls are getting incorrectly prepended with the forceRelative image url, and nested url calls which are required for correct processing aren't getting touched at all.
is getting rewritten to:
As you can see the the first src url is completely removed and only the first nested one is aliased, but incorrectly prepended with the forceRelative url.
The text was updated successfully, but these errors were encountered: