-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.0][RTL] CSS logical properties #28546
Comments
Note: Considering Bootstrap 5 will not support IE11 (twbs/bootstrap#30377), it will most likely use logical properties. |
presumably you have to define the writing mode somewhere? |
Works the same as other RTL supporting properties (eg. flex) where instead of left and right, you have start and end. With |
maybe i read the docs wrongly but it looked to me that you need to have something like English
Arabic
|
In this instance it is not required. |
ok thats great. i just didnt see anything in the docs you linked to about direction. I am definitely in favour of this concept |
Warning though: |
Ideally you should not have to. These recent additions to the CSS spec are to eliminate the need for 'RTL' specific CSS. So for example. You want text alignment to switch from left to right in RTL you would use... .element {
text-align: start;
} You want text alignment to be always on the left regardless of LTR/RTL you would use.. .element {
text-align: left;
} |
Remember that logical margin/padding/text-align are still experimental. The syntax is subject to change, despite many evergreen browsers supporting them. I would personally use it, but just with caution. Also remember how long it took BS to get their first beta release out (about 2 years) |
True. There is a couple of open issues on the spec.. https://www.w3.org/TR/css-logical-1/#issue-3d880eb1 Admittedly nothing currently that warrants a change in the syntax but still something to note. @wilsonge thoughts? |
This seems logical to me (pun intended) - although presumably just like with CSS vars - we're never going to be perfect with this as we aren't going to be able to override all of bootstrap's uses - it's largely going to be for our own markup outside the bootstrap classes. Especially as one of the open issues is about how these logical properties override already set margins (what we'll have with bootstrap) |
@wilsonge you can override their mixins that generate utility classes. It won't solve everything, but it would be a good start. |
I'll put together a baseline PR, ignoring the bootstrap classes. I would guess that BS5 will create new utility classes for these logical properties. For now, we could create our own. |
Sounds good to me |
PR created... #28589 |
The majority of Joomla's RTL CSS is made up of corrections to left and right margins, paddings, borders, and floats.
LTR example...
RTL correction...
As we no longer support IE11, these can all be replaced with logical properties..
LTR example...
RTL correction...
Ref:
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties
https://www.w3.org/TR/css-logical-1/
The text was updated successfully, but these errors were encountered: