Open shazdeh opened 13 years ago
Couldn't you just pass variable from PHP during compilation as described in documentation http://leafo.net/lessphp/docs/#setting_variables_from_php?
Works only for values, and not directives. So this works: 'float: @x' and 'margin-@x: 10px' fails.
The way I handled RTL styles for my web projects was that I used PHP to do something like this:
$x = ( is_rtl() ) ? 'right' : 'left'; $nx = ( is_rtl() ) ? 'left' : 'right';
So now I could do something like this: .column { float: <?php echo $x; ?>; margin-<?php echo $nx ?>: 10px; }
This is way better than declaring LTR styles and then reset them for the RTL. I was wondering if the same technique could be implemented with LESSPHP.