tylertate / semantic.gs

The Semantic CSS Grid
tylertate.github.io/semantic.gs/
Apache License 2.0
1.59k stars 245 forks source link

fixes #90: right-to-left language support (LESS only) #107

Closed dlockhart closed 7 years ago

dlockhart commented 9 years ago

These changes add support for right-to-left languages. Just for the LESS pre-processor for now, but porting to the others should be trivial.

Unlike some grid systems that support RTL using a compile-time flag (requiring two separate compiled CSS files), this approach leverages an attribute selector that targets a parent element with the "dir" attribute set to rtl. When that attribute/value combination is present, we flip any direction-specific CSS rules (e.g. float, margin-left) to their inverse.

To use the grid system in right-to-left mode, simply add dir="rtl" to any parent element in your document:

<html dir="rtl">
</html>
dlockhart commented 7 years ago

Closing due to age.