Bootstrap: Make border and shadow utilities use the same pattern

Created on 17 Oct 2020  路  4Comments  路  Source: twbs/bootstrap

Should bith the border and shadow utils be aligned better?

For example:

border-0
shadow-none

It would be easier if they were both "border-none" and "shadow-none" as there is also a "d-none" utility.

You could even short both the border and shadow properties to "b-none" and "s-none" to also match the "d-none" utility.

feature

All 4 comments

I prefer code readability and understandability, so in my personal point of view;

  • border-none is better than border-0
  • border-none, shadow-none is better than border-0, shadow-none
  • display-none is better than d-none

Good thing is that you can easily rename them on your own, but it's better to have the defaults much more beginner friendly. Also most code editors like Sublime Text already have a Bootstrap autocomplete package so you don't have to type it all.

Hmm agree that it鈥檚 be nice to have the same, but border and box-shadow behave differently with support for 0/none. Both support none, but only border supports 0. See https://codepen.io/emdeoh/pen/GRqWZoZ.

I think having it be different is okay, since it allows the border class to remain as short as possible.

Thoughts @twbs/css-review?

I agree, as I'd write border: 0 to drop borders and box-shadow: none to remove shadows, it seems more valuable to keep them as-is IMHO.

Closing for now with that in mind. Thanks!

Was this page helpful?
0 / 5 - 0 ratings