After reconsidering the current approach taken in the patch set https://gerrit.wikimedia.org/r/#/c/313940/ on T146962 it seems reasonable to consider applying box-sizing: border-box as general rule for OOUI elements/widgets.
Citing from the patch:
I agree that this should be labelled ”breaking change”, an easily handleable one though.
A question arising is, if we better set box-sizing: border-box as general rule for .oo-ui-widgets? It's the more intuitive (more humanized) way of calculating sizes, we already do it on a bunch of widgets (DropdownHandle, TextInput, Checkbox, Radio, ToggleSwitch, SelectFileWidgetInfo, CapsuleItemWidget). Through inherited classes or mixins you might end up in unwanted inheritance if not relying on it generally. It would be also more reliable from an consistency perspective.
OOUI developers [w]ould be sure, that there's _one_ way of box-sizing.
It's not inherited, so we'll have to think about if a .oo-ui-widget > * selector is feasible.
As of v0.19.0 box-sizing: border-box is applied to following widgets:
Element | ? | notes |
---|---|---|
ButtonElement | In use since v0.19.0 | |
ClippableElement | In use | |
DraggableElement | ||
FlaggedElement | ||
IconElement | Has a patch for review | |
IndicatorElement | Has a patch for review | |
LabelElement | Has a patch for review | |
LookupElement | Covered in TextInputWidget | |
PendingElement | ||
PopupElement | ||
TabIndexedElement | ||
TitledElement | ||
Widget | ? | notes |
ButtonWidget | In use since v0.19.0 through ButtonElement | |
ButtonGroup-/SelectWidget | In use since v0.19.0 through ButtonElement | |
CapsuleMultiselectWidget | Partly. | |
CheckboxWidget | Checkboxes and Radios are the few elements, that are border-box per default in browsers today (except IE < 10). But also or <span> rebuild is using it already | |
ComboBoxInputWidget | In use | |
DropDownWidget | Partly. handle has already border-box enabled, enabling on parent element isn't problematic | |
NumberInputWidget | In use | |
ProgressBarWidget | Since v0.21.2 | |
RadioInputWidget | See Checkbox above | |
SelectFileWidget | Partly. -info has it applied, easily switchable | |
TextInputWidget | In use | |
ToggleSwitchWidget | In use | |
Tools | ? | notes |
Toolbars | ||
ToolGroups | Since v0.23.3 | |
Tools | Since v0.23.3 |