Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

customizing rtl bootstrap5

customizing bootstrap

image that is contain css foldred that is CSS compiled from scss but in ltr dir

I wanna customize sass file of bootstrap such as padding but in RTL direction but bootstrap doesn't have rtl sass file to change padding and compile it to RTL CSS file anyone can help me how can do that I don't know how to use rtlcss plugin,image that is contain CSS folder that is CSS compiled from scss but in ltr dir

like image 863
Adib Sadeghi Avatar asked Jun 25 '26 15:06

Adib Sadeghi


1 Answers

The Bootstrap 5 docs explain how to support RTL.

Basically you need to:

  1. Set dir="rtl" on the <html> element.

  2. Add an appropriate lang attribute, like lang="ar", on the <html> element.

  3. You should also use RTLCSS. Install it like this:

    npm install -g rtlcss
    

    And after you have compiled the file:

    $ rtlcss [option option=parameter ...] [source] [destination]
    

    Convert for example input.css to output.rtl.css:

    > rtlcss input.css output.rtl.css
    

    And after compiling, you have an RTL file.

like image 125
Hamed Latifi Avatar answered Jun 28 '26 18:06

Hamed Latifi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!