Before start shooting me, I have to say that I am totally new on less
, so please don't shoot !! :)
What I'd like to do is to write some classes for aligning my text based on my screen size, and instead of writing my code by hand I'd like to use a loop of less
(if it is possible of course) to generate my classes.
So what I'd like to do is something like this:
.text-sm-left {
text-align : left;
}
.text-sm-right {
text-align : right;
}
.text-sm-center {
text-align : center;
}
.text-sm-justify {
text-align : justify;
}
But as I already have said, I don't like to do it by using hand written code.
So is there a way in less
to use a kind of array or hash and loop over it in order to produce the required code?
The array or the hash should contain only the stings left
, right
, center
, justify
Another option, if that's possible is to loop over my screen sizes as well, like sm
, md
, lg
.
Thanks a lot.