I have some css files that i need to use in RTL direction template. I need to convert all left to right and all right to left in these css files using php and regular expression.
For example: when it says “margin-left”, it should be “margin-right” and vice versa.
The simpler way to do it would be to:
The bigger problem are these kinds of css:
More bigger problem:
You should clarify on what kind of CSS might occur. I don’t think you want to write a full fledged CSS parser
EDIT:
I replaced the
-leftto simplyleftand the same with right to also support theposition: absolutepositioning values.