stylelint-config-clean-order icon indicating copy to clipboard operation
stylelint-config-clean-order copied to clipboard

Border in box-model

Open zumm opened this issue 2 years ago • 5 comments

Border affects element sizes. Should it be in box-model? At least having option to choice will be nice, like in abandoned rational-order package.

zumm avatar Jan 14 '23 19:01 zumm

I thought about that before but these changes would separate outline which is not included in CSS Box Model. In my opinion, it makes sense to group them together because they're similar. Should we include outline in box-model group as well, what do you think?

Moving border and outline to box-model group also makes it their current appearance group really small. Most of the time they would consist only opacity and background properties.

Although it's named as box-model, I'm actually thinking them as general sizing properties. Border also effects the element size like you mentioned but most of the time we do not use it that way. So, maybe naming is at fault? We can simply rename "box-model" group to "sizing"?

It would really appreciated if you have any thoughts about this @wimhendrikx.

kutsan avatar Jan 14 '23 20:01 kutsan

I don't think outline should be moved too since it doesn't affect element sizes. So border and outline aren't so similar from this point of view.

zumm avatar Jan 14 '23 20:01 zumm

All else seems to make sense to me, just border stood out as in the wrong place, so I'd vote for this one too.

chriswilty avatar Jan 08 '24 08:01 chriswilty

Do you guys think border should be between margin and padding or after or before margin/padding pair?

Between margin and padding:

.box {
  isolation: isolate;

  width: 200px;
  height: 100px;
  margin: 20px;
  border: 2px solid #3498db;
  padding: 15px;

  border-radius: 10px;
  box-shadow: 3px 3px 5px rgb(0 0 0 / 10%);
}

After margin and padding:

.box {
  isolation: isolate;

  width: 200px;
  height: 100px;
  margin: 20px;
  padding: 15px;
  border: 2px solid #3498db;

  border-radius: 10px;
  box-shadow: 3px 3px 5px rgb(0 0 0 / 10%);
}

kutsan avatar Jan 28 '24 12:01 kutsan

I would vote for "after margin"

axten avatar Apr 02 '24 19:04 axten