image-size.js 738 B

12345678910111213141516171819202122232425262728
  1. import functionRegistry from './../less/functions/function-registry';
  2. export default () => {
  3. function imageSize() {
  4. throw {
  5. type: 'Runtime',
  6. message: 'Image size functions are not supported in browser version of less'
  7. };
  8. }
  9. const imageFunctions = {
  10. 'image-size': function(filePathNode) {
  11. imageSize(this, filePathNode);
  12. return -1;
  13. },
  14. 'image-width': function(filePathNode) {
  15. imageSize(this, filePathNode);
  16. return -1;
  17. },
  18. 'image-height': function(filePathNode) {
  19. imageSize(this, filePathNode);
  20. return -1;
  21. }
  22. };
  23. functionRegistry.addMultiple(imageFunctions);
  24. };