Igosuki / compass-mixins

A collection of compass' stylesheet for bower dependencies and libsass
Other
592 stars 197 forks source link

image-width and image-height not calculating #29

Closed dlip closed 9 years ago

dlip commented 9 years ago

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 commented 9 years ago

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. https://github.com/sass/node-sass/issues/332

ayush000 commented 5 years ago

@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 commented 5 years ago

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.