Code Monkey home page Code Monkey logo

Comments (4)

TommasoAllegretti avatar TommasoAllegretti commented on September 27, 2024 1

Hi @ibleaman, from my understanding of what is explained in Bootstrap's documentation, if you want to enable RTL in Bootstrap-powered pages you need to include the RTL version of the CSS.

I have tried replacing the stylesheet link in the fiddle you shared with the RTL version and the result seems to be the same as the fixed version of the fiddle.

Here's the link tag:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.rtl.min.css" integrity="sha384-dpuaG1suU0eT09tx5plTaGMLBsfDLzUCCUXOY2j/LSvXYuG6Bqs43ALlhIqAJVRb" crossorigin="anonymous">

Hope I was of any help!

from bootstrap.

ibleaman avatar ibleaman commented on September 27, 2024

@TommasoAllegretti Thank you for your quick response! Yes, I did overlook that step on the RTL documentation page.

Using the RTL version of Bootstrap fixes the problem in my jsfiddle link 2. However, it creates the same alignment problem if you use it in link 1, because .ms-auto is now defined as:

.ms-auto {
  margin-right: auto !important;
}

So: Is there no way to use a single Bootstrap 5 CSS file on a multilingual website, whether the original version or the RTL version, so that it works across all pages regardless of their direction? The documentation on spacing suggests that this is exactly what .ms- is supposed to accomplish:

s - (start) for classes that set margin-left or padding-left in LTR, margin-right or padding-right in RTL

The RTL documentation page also suggests that start/end are what's used in the CSS, not left/right. But both the original and the RTL versions of Bootstrap 5 still use left and right here.

I thought this was supposed to be an improvement over Bootstrap 4, which used ml instead of ms.

from bootstrap.

TommasoAllegretti avatar TommasoAllegretti commented on September 27, 2024

I am not sure what the evolution of Bootstrap regarding this feature is, but according to "LTR and RTL at the same time", the solution to your problem should be RTLCSS String Maps.
I am not aware of your project's details but I hope that can be helpful in solving your issue.

from bootstrap.

ibleaman avatar ibleaman commented on September 27, 2024

I'm closing this issue, as importing the RTL version of Bootstrap 5 is good enough for my use case.

Thanks again @TommasoAllegretti !

from bootstrap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.