Open BSarmady opened 1 year ago
This has been considered 3 years ago while implementing RTL for v5 (see #30918). Support was still short at that time, but switching to logical properties should be one of the main move coming in V6.
I'm tagging this for v6 as I noticed there's currently no dedicated issue!
Or what would have made more sense is keep the selector and change the property, so while in LTR, design for LTR, and it will magically flip on RTL
text-left { text-align: start}
text-right {text-align: end}
I really expected (hoped) for this, don't know why you went for the extreme of renaming selectors, but keeping the properties
text-start {text-align: left}
why?
Prerequisites
Proposal
Referring to this comment and this SO answer, and CanIUse inset-inline-end and others, it seems these following properties are supported in all major browsers (or green?) since mid 2020
inset-inline-start (in place of left property) inset-inline-end (in place of right property) margin-inline-start (in place of margin-left property) margin-inline-end (in place of margin-right property) margin-inline (in place of margin shorthand property) padding-inline-start (in place of padding-left property) padding-inline-end (in place of padding-right property) padding-inline (in place of padding shorthand property) text-align: start; (in place of left value) text-align: end; (in place of right value) float: inline-start; (in place of left value) float: inline-end; (in place of right value)
following styles are still using left and right
me-0
... 'me-auto',ms-0
...ms-auto
,.start
....start-100
.end
...end-100
however using above mentioned attribute and properties will allow easier transition between LTR and RTL
so instead of LTR
.start-0 { left: 0 !important; }
RTL.start-0 { right: 0 !important; }
We can have just
.start-0 { inset-inline-start: 0 !important; }
and so on.
Currently I'm testing these transitions with following html, which allows me immediate transition between RTL and LTR
Content of main.css is something like following (obviously for these to work I need to comment their counter part in bootstrap.css)
Motivation and context
I think it allows transition from having two separate CSS for LTR and RTL to one single file. and in case in future you want to support top to bottom languages ;)