[Feedback] new names of utilities classes in bootstrap 5.0 beta-1 look weird. #32402
Replies: 16 comments 26 replies
-
the new shorthands work in combination with the RTL work, which replaces terms such as "left" and "right" with more universally applicable ("start" and "end"). |
Beta Was this translation helpful? Give feedback.
-
there are many more differences between 4.x and 5.x - jumping between major versions always requires fundamental changes |
Beta Was this translation helpful? Give feedback.
-
Well, we —and most of the web— are following semver, meaning that a major release breaks things and is not trivial to upgrade to. However it's possible, and pretty easy when it comes to class names since we maintain a comprehensive migration guide listing every changes that should be known while upgrading from v4 to v5— so in that case upgrading only require to search for old class names and replace them with the new ones. As @patrickhlauke says, those changes are meant to ease RTL support and usage—which is one of the most requested feature ever— and to do so, we chose to use class names inspired from logical properties. So yes, Sorry you dislike this, but that's a move meant to reach an even larger audience for Bootstrap, ease its usage for RTL users, and only a first step since at some point we'll all use logical properties as a basis. Everyone will get used to this and we'll get internationalized layouts for free. 👍 To sum up, we won't roll this back and if you want to upgrade, you'll need to read our migration guide since most of our utilities are renamed in v5. |
Beta Was this translation helpful? Give feedback.
-
I agree with Tanvir Arjel, in css we have margin left, margin right and padding left, padding right, so it doesn't make any sense to use start and end as short name to a css left and right, and RTL has noting to do with margin and padding, the left stay always the left and the right stay always the right whatever you use RTL or not |
Beta Was this translation helpful? Give feedback.
-
Hi, I understant that a big effor has been done for the RTL, that this one is a major version and things are meant to be broken and I understand as well that this will be the future. That said, margin start and end feels so unnatural right now. I understand that there's no turn around on this but wouldn't be possible to be less drastic and mitagate a little bit the transition? Why can't we still have Would that be possible to have them optional? If none of that was possible, could you pls at least put in the documentation how to restore them using the utlity api? Thanks for your understanding and effort. |
Beta Was this translation helpful? Give feedback.
-
I think this change is for the better, after 2 days using ps, pe, ms, me, -start, -end, it is quite easy to migrate to bootstrap 5. it only takes about 1 to 2 days to get used to. |
Beta Was this translation helpful? Give feedback.
-
This is also already the way that Flexbox does things already, so anyone
with anything more than a precursory level of experience should be
familiar and comfortable with this syntax.
…On 12/12/2020 10:19 am, aribudin wrote:
I think this change is for the better, after 2 days using ps, pe, ms,
me, -start, -end, it is quite easy to migrate to bootstrap 5. it only
takes about 1 to 2 days to get used to.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#32402 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAVELW7FBUUYSXADCEA7SETSUKZHRANCNFSM4UTXHD4A>.
|
Beta Was this translation helpful? Give feedback.
-
@aribudin , for sure this change is for the better and I see that I guess my point is, please have mercy of all developer that till yesterday, for 15 years did opened their editor and typed @ffoodd , I may be wrong but I don't think Sorry again to be so pedantic and thanks again for the amazing work and effort done. |
Beta Was this translation helpful? Give feedback.
-
I fully appreciate the resistance — RTL isn't a feature most users need and these changes add complexity for them with no perceived benefit (besides making them aware of the logical properties). I'm not a huge fan of the less natural/semantic property naming in general myself... but this is not a Bootstrap problem.
One thought is that separate packages could be built (RTL-disabled or RTL-enabled) which could allow for a transition in mindset to hopefully occur more naturally over time. However there's a strong argument to be made that v4 began to introduce these concepts to users via Flexbox ahead of the major shift in v5. And this would obviously create a headache regarding documentation as well. Lastly I will play devil's advocate a bit here — since CSS still allows for both |
Beta Was this translation helpful? Give feedback.
-
I think so also. What if I use RTL and need RIGHT margin ? Not START or END ? |
Beta Was this translation helpful? Give feedback.
-
Maybe as a compromise, just depreciate (not remove) right & left in v5 i.e. allow both (e.g.) mr-3 and me-3 this would remove a massive chunk of migration work most people just use bootstrap from the CDN, they dont use scss, please don't underestimate how much work this will cause. |
Beta Was this translation helpful? Give feedback.
-
I understand the intent regarding RTL and it makes sense to introduce two new utilities for the start and the end. My suggestion would be keeping the left and right utilities, and introducing the start and end utilities as they serve a different purpose and can be useful for the reasons you mentioned. |
Beta Was this translation helpful? Give feedback.
-
@mdo @ffoodd So! after a lot of disscussion what is the final decision? Has Thank you. |
Beta Was this translation helpful? Give feedback.
-
Dropping this here for future readers that are new to the utilities, a quick snippet that fixes the margin/padding left & right classes. Drop it between your imports of I find the renaming of these classes to $utilities: map-merge(
$utilities, (
"margin-start": map-merge(
map-get($utilities, "margin-start"),
( class: ml )
),
"margin-end": map-merge(
map-get($utilities, "margin-end"),
( class: mr )
),
"padding-start": map-merge(
map-get($utilities, "padding-start"),
( class: pl )
),
"padding-end": map-merge(
map-get($utilities, "padding-end"),
( class: pr )
),
)
); |
Beta Was this translation helpful? Give feedback.
-
I think there is a misunderstanding in what start/end actually means. With justify-content and align-items, start and end makes sense because both are unidirectional like a line, they naturally have a start and an end. Margin, padding and border in contrast are all multi dimensional, on a flat screen they all have four directions. In a 3D environment we would even have 6 directions, i.e. two additional things like margin-front, margin-back (like a box). In a 3D world it seems more natural to assign "start" to the direction of the viewer, i.e. "front". From that start point you would call the opposite side "back", and the other 4 directions you would call "left", "right", "top" and "bottom" (again, like a box). That is what we are used to, and what makes the most sense. If we make left the new start because of ltr/rtl, then in context of a 2D screen it would mean the old top becomes "left" and the old bottom becomes the new "right". It's like a street that goes from west to east. If the start is in the west then north is left side of the street, south is the right side, and east would be the end. With justify-content and align-items you don't have all this because they each have only two directions, and the start/end of the one is the right/left of the other. With margin-inline-start/end it is similar to justify-content and align-items. It is unidimensional because it is relative to writing direction. margin-inline-start can be used together with margin-left, they have different meaning. For example In simple words: margin-left != margin-inline-start, i.e. left/right != start/end My suggestion: (1) Reintroduce the old classes (.ml .mr .pl .pr .border-left .border-right, .text-left, .text-right and others) (2) Change .ms-, .ps-, .-start, .-end to control the flow relative properties margin-inline-, padding-inline-, border-inline-* and text-align:start/end |
Beta Was this translation helpful? Give feedback.
-
Here is a unique idea to help identifying the v4 v5 upgrade scope and provide visual identification of deprecated class names on the page. It will place a white box with red border and the class name over all deprecated elements. Another variation might be adding a 1px image then watch server logs for pages that request the image to find less commonly used pages popups, server code etc.. that might have been missed. |
Beta Was this translation helpful? Give feedback.
-
.ms-*
formargin-left
does not make sense. There is nothing calledmargin-start
..ml-*
looks more readable and meaningful formargin-left
.Please keep all the utility class names as same as bootstrap 4.x.
Most importantly, changing the utility class names will make v4.x to v5.0 up-gradation impossible.
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions