I have to do internationalization in my app with some right to left (arabic/hebrew) languages. So i'd like to be able to override some bootstrap classes (like col) to be float right instead of left.
I use create-react-app (babel/webpack) , react-bootstrap.
You can't import conditionally so I did a conditional require
if (language.isLanguageLTR()) {
console.log("REQUIRE RTL CSS");
require("./rtl.css");
}
It works well when I'm in development mode, but when I build my application using create-react-app, the css file is imported even if the condition is set to false.
Is there a way (sure there is !) to override some css classes without inline css/specific classes everywhere I use bootstrap column ?
I think webpack loads it on deployment mode but I don't get why, and maybe there is a more proper way to conditionally override css.
My css just in case you'd like to understand better
.App {
direction: rtl;
}
.col-sm-1 {
float: right;
}
.col-sm-2 {
float: right;
}
...