In less.js, I’m able to replace values with variables with no problems.
@gutter: 20px;
margin-left:e(%("-%d"), @gutter);
When trying to replace properties with variables, I get errors. How would I perform the following in Less?
@gutter: 20px;
@direction: left;
e(%("margin-%d"), @direction):e(%("-%d"), @gutter);
Thanks to Alvivi for the solution and research (you get the reward for that). I decided to add the following as the actual answer since this is a real way to set it up instead of looking at .blah() pseudo code..
Here’s a real strategy for setting it up:
then create mixins to enhance margin and padding like so:
.. then you can just
or
all together:
Easy breezy LTR/RTL with LESS! Woot!