Ushahidi's user interface displays LTR (left-to-right) by default, but Ushahidi also supports RTL (right-to-left), so if the user's preferred language is a RTL language, the UI will display accordingly.
When building this feature, it was important to maintain one code base that supported both LTR and RTL read direction. In order to accomplish this we decided to use a library of Sass mixins and functions to automatically flip the CSS styles for RTL (right-to-left) read direction when needed. We decided to go with RTL-Sass open-source library, which supports the following properties:
background
background-position
border
border-radius
clear
cursor
direction
float
left/right
margin
padding
text-align
text-indent
LTR/RTL body class
ltr-namespace is the default body class, but if a user selects an RTL language when creating a deployment, that body class will change to rtl-namespace and display all UI elements as RTL.
Conflicts
The Ushahidi UI uses the lightweight semantic grid Bourbon Neat and this Neat span-columns mixin:
@include span-columns(12);
which compiles to:
float: left;
display: block;
width: 100%;
but in order to correctly display the float in both LTR and RTL, you have to manually override the float: left; like so:
@include span-columns(12);
@include float(left);
which compiles to:
float: left; // would be overridden
display: block;
width: 100%;
float: left; // would be left or right depending on language