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

image-width and image-height not calculating #29

Closed
dlip opened this issue Jan 23, 2015 · 3 comments
Closed

image-width and image-height not calculating #29

dlip opened this issue Jan 23, 2015 · 3 comments

Comments

@dlip
Copy link

dlip commented Jan 23, 2015

When I try to use image-width and image-height in my sass, the result is not calculated, rather the outputted css has the original image-width/height function calls inline.

Does this library handle compass helper functions?

@michaek
Copy link
Collaborator

michaek commented Mar 9, 2015

This library doesn't have access to the filesystem to check image dimensions, because it's trying to get close to compass using only sass script. Those would have to be implemented in C++ in libsass or using libsass's custom functions, when they land. sass/node-sass#332

@michaek michaek closed this as completed Mar 9, 2015
@ayush000
Copy link

ayush000 commented Apr 12, 2019

@michaek I see that node-sass added custom functions, but I'm still not able to use image-width or image-height functions. Any update on this?

@ayush000
Copy link

ayush000 commented Apr 15, 2019

For those who came across this issue, this library called node-sass-asset-functions provides polyfills for all these functions:

image-url($filename: null, $only_path: false)
image-width($filename: null)
image-height($filename: null)
font-url($filename: null, $only-path: false)
font-files($filenames...)

You can integrate it in your node-sass.

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

3 participants