How to create an RTL CSS file (style-rtl.css) for Drupal modules Say I have a "style.css" file for a module, and that file contains the following syntax:

.myCalss1 {
  right: 10px;
  margin: 0 5px 0 0;
}


I then create an extra file, "style-rtl.css" with the following syntax (flipping of the previous):

.myClass1 {
  right: initial;
  left: 10px;
  margin: 0 0 0 5px;
}


How can I make the system prefer the RTL file?
Solution

Create the flipped rtl css (for example, based on the structure I've described above) and then go to your theme's or module's folder, and there go to the libraries file (like libraries.yml) and create a reference in the end of the library ---> To your new file. Here is an example from the libraries file of one of my modules (admin toolbar):





Note:

The file might not work correctly if you will indent your syntax using the tab key or the space key. If there is a problem try the other of these two indenting options (some files can't work well when you pick a specific method for indenting them - It has to do with the structure of the file types themselves).