internet explorer - Dynamically generate mixin using LESS -


how change mixin dynamically. i'd call less file this:

.sprite-resize(facebook); 

then i'm trying setup mixing this:

.sprite-resize(@file) {   @ret: '@sprite-retina-@{file}';   @norm: '@sprite-@{file}';   .sprite-ret(@ret);   .sprite-norm(@norm); }  .sprite-ret(@ret) {     @sprite-image: ~`"@{ret}".split(', ')[8].slice(1, -2)`;     background-image: url(@sprite-image); }  .sprite-norm(@norm) {     .lt-ie9 & {       @sprite-image: ~`"@{norm}".split(', ')[8].slice(1, -2)`;       background-image: url(@sprite-image);     } } // @sprite- , @sprite-retina values automatically generated me grunt plugin: "grunt-spritesmith": "~1.23.0" @sprite-facebook: 425px 142px -425px -142px 24px 24px 453px 410px '/@{images-dir}/spritesheet-icons159.png';  @sprite-retina-facebook: 25px 147px -25px -147px 24px 24px 209px 189px '/@{images-dir}/spritesheet-icons-retina159.png'; 

but keep getting errors when build like: "cannot call method 'slice' of undefined."

any idea how can call 1 name "facebook" , run both retina , non-retina versions of mixin?


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -