less.js icon indicating copy to clipboard operation
less.js copied to clipboard

help | how to use(or possibility to) mixin with function?

Open orlowang opened this issue 4 years ago • 1 comments

in my case first I use function to create a .in-10 ...

@selectors: 5, 10, 20;
each(@selectors, {
    .in-@{value}{
        padding: (@value)px;
    }
});

then use .in-10 as a mixin to .button

.button{
    .background-color:  green;
    .in-10();  /* <--  here to use mixin */
    ...some other
}

an error say .in-10 is undefined, may I think they are output same time so that .in-10 is not find, how can I make this work? how to code less in this case?

I can't got any answer in stackoverflow so I try here, pls help!

orlowang avatar Apr 16 '21 12:04 orlowang

emmm, write seprate .in-5 / .in-10 / in-20 mixin.

iChenLei avatar Jun 12 '21 08:06 iChenLei