-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Asset-url #1361
Comments
the url function in CSS has special parsing rules to allow it to treat the argument as a string. Sass has special handling for this, but when it's triggered it's a special string instead of a function call. @nex3 perhaps we should parse the url as a function call with an unquoted string as the argument instead of as a special string? |
I don't like the idea of overriding the functionality of |
Yeah, hidden variable is a bad solution. If Sass had some kind of native background-image: url(asset-path('logo.png'));
|
Sass very explicitly avoids having any knowledge of project structure, including asset paths. This is the job of layers on top of it like Compass. |
I would like to do something about asset-url helpers in Compass and Sprockets. They make writing and using universally compatible libraries very difficult. Example at hand is bootstrap-sass (1, 2, 3, 4, 5).
Perhaps we can use
url()
and delegate it to the helper automatically, instead of calling the helpers directly. For example,url("logo.png")
would be the same asurl(asset-path("logo.png"))
in Sprockets. I've started on a pure Sass library that does this via overriding@function url($path)
here: https://github.com/glebm/sass-rewrite-url.It almost works, but can unquoted strings be processed this way?
The text was updated successfully, but these errors were encountered: