There is already an automatic CSS direction flipper based on the direction of the user interface language. For flipping based on the direction of the content language currently a manual flipping based on .mw-content-ltr and .mw-content-rtl is necessary:
.mw-editsection { margin-left: 1em; }
/* @noflip */ .mw-content-ltr .mw-editsection, .mw-content-rtl .mw-content-ltr .mw-editsection { margin-left: 1em; } /* @noflip */ .mw-content-rtl .mw-editsection, .mw-content-ltr .mw-content-rtl .mw-editsection { margin-right: 1em; }
It would be nice to have a preprocessor to generate this expansion.