-
Notifications
You must be signed in to change notification settings - Fork 60
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
Is it possible to use eyeglass with named parts of an SVG? #75
Comments
— and ask if there was a recommended way to do this, or if it’s a good potential area for a pull request |
This is a bug. |
I tried this as a work-around, since it looked like there was an background-image: url("#{asset-path('z-editor/assets.svg')}#link"); Unfortunately this didn’t work, and produced this CSS: .foo {
background-image: url('asset-path("z-editor/assets.svg")#link'); } |
In case anyone else has this bug in the meantime: I was able to work around it like so: // work-around for
// https://github.com/sass-eyeglass/eyeglass/issues/75
// TODO: Remove this when that bug is fixed
@function url-append($url-string, $append-string) {
// note: in Sass, indices start at 1. it's a CSS thing.
@return str-insert($url-string, $append-string, str-length($url-string));
}
// ...
.foo {
background-image: url-append(asset-url('z-editor/assets.svg'), "#link");
} This will compile to: .foo {
background-image: url(/agent/assets/z-editor/assets.svg#link); } |
I have a test case and fix I'll PR once #72 is merged. Thanks for reporting. |
This is fixed now. |
FYI, My above work-around code now seems to be invalid:
Edit, actually, as posted above, my code works just fine. But it doesn’t if you wrap it in a |
@alanhogan this was a change (fix) in libsass. You can't define functions within e.g. That said, you should no longer need a workaround for this as the fix for |
Refactor test suite to use broccoli-test-helpers.
With SVG, you can refer to a specific part of it using an
id
, which ends up looking likeurl(icons.svg#octogon)
.However, this confuses Eyeglass and it says it can't find an asset named
icons.svg#octogon
I will work around this by concat-ing the fragment onto the returned URL from
asset-file()
, but wanted to surface this issue.The text was updated successfully, but these errors were encountered: