Bootstrap v5 将 class 名称从 .ml .mr 更改为 .ms .me,为什么?
Bootstrap v5 Changed class names from .ml .mr to .ms .me, why?
有人可以为我解释一下是否有任何正当理由,为什么 Bootstrap v5 为如此常用的 类 更改名称?
他们这样做是因为 RTL feature:
Part of our approach to adding RTL to Bootstrap was to add it in a way
that felt future-friendly to ourselves and the web at large. As such,
we’ve embraced the spirit of CSS logical properties and have renamed
several classes and variables. It’s a risky change because of the size
and impact of the change, but we hope you’ll appreciate it overall!
Most of you have already interacted with logical properties thanks to
our flex utilities—they replace direction properties like left and
right in favor start and end. Things like align-items-end have been
welcomed additions. This makes horizontal directional class names
appropriate for LTR and RTL without any additional overhead moving
forward.
For example, in a LTR context, instead of .ml-3 for margin-left, use
.ms-3.
有人可以为我解释一下是否有任何正当理由,为什么 Bootstrap v5 为如此常用的 类 更改名称?
他们这样做是因为 RTL feature:
Part of our approach to adding RTL to Bootstrap was to add it in a way that felt future-friendly to ourselves and the web at large. As such, we’ve embraced the spirit of CSS logical properties and have renamed several classes and variables. It’s a risky change because of the size and impact of the change, but we hope you’ll appreciate it overall!
Most of you have already interacted with logical properties thanks to our flex utilities—they replace direction properties like left and right in favor start and end. Things like align-items-end have been welcomed additions. This makes horizontal directional class names appropriate for LTR and RTL without any additional overhead moving forward.
For example, in a LTR context, instead of .ml-3 for margin-left, use .ms-3.