Skip to content

Commit 97b4232

Browse files
committed
[IMP] css: remove global content-box directive
We have a global css directive that sets `box-sizing: content-box` everywhere. This is a bit stupid, as it override bootstrap default `border-box` directive. And it also make using `width/height` directive less intuitive, as the size you set does not includes border/padding. We had 32 occurrences of `box-sizing: border-box` in our codebase, to override the global directive. closes #5641 Task: 4550753 Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
1 parent 246e5f0 commit 97b4232

File tree

35 files changed

+20
-69
lines changed

35 files changed

+20
-69
lines changed

src/components/action_button/action_button.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ css/* scss */ `
1111
margin: 2px 1px;
1212
padding: 0px 1px;
1313
border-radius: 2px;
14-
min-width: 20px;
14+
min-width: 22px;
1515
}
1616
.o-disabled {
1717
opacity: 0.6;

src/components/autofill/autofill.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ css/* scss */ `
1515
height: ${AUTOFILL_EDGE_LENGTH}px;
1616
width: ${AUTOFILL_EDGE_LENGTH}px;
1717
border: 1px solid white;
18-
box-sizing: border-box !important;
1918
background-color: #1a73e8;
2019
}
2120

src/components/border_editor/border_editor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ css/* scss */ `
7272
margin: 1px;
7373
.o-line-item {
7474
padding: 4px;
75-
width: 18px;
76-
height: 18px;
75+
width: 26px;
76+
height: 26px;
7777
&.active {
7878
background-color: ${BUTTON_ACTIVE_BG};
7979
}

src/components/color_picker/color_picker.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ css/* scss */ `
7474
}
7575
}
7676
.o-color-picker-line-item {
77-
width: ${ITEM_EDGE_LENGTH}px;
78-
height: ${ITEM_EDGE_LENGTH}px;
77+
width: ${ITEM_EDGE_LENGTH + 2 * ITEM_BORDER_WIDTH}px;
78+
height: ${ITEM_EDGE_LENGTH + 2 * ITEM_BORDER_WIDTH}px;
7979
margin: 0px;
8080
border-radius: 50px;
8181
border: ${ITEM_BORDER_WIDTH}px solid #666666;
@@ -98,7 +98,6 @@ css/* scss */ `
9898
font-size: 14px;
9999
background: white;
100100
border-radius: 4px;
101-
box-sizing: border-box;
102101
&:hover:enabled {
103102
background-color: rgba(0, 0, 0, 0.08);
104103
}
@@ -125,7 +124,6 @@ css/* scss */ `
125124
.o-gradient {
126125
margin-bottom: ${MAGNIFIER_EDGE / 2}px;
127126
border: ${ITEM_BORDER_WIDTH}px solid #c0c0c0;
128-
box-sizing: border-box;
129127
width: ${INNER_GRADIENT_WIDTH + 2 * ITEM_BORDER_WIDTH}px;
130128
height: ${INNER_GRADIENT_HEIGHT + 2 * ITEM_BORDER_WIDTH}px;
131129
position: relative;
@@ -134,7 +132,6 @@ css/* scss */ `
134132
.magnifier {
135133
height: ${MAGNIFIER_EDGE}px;
136134
width: ${MAGNIFIER_EDGE}px;
137-
box-sizing: border-box;
138135
border-radius: 50%;
139136
border: 2px solid #fff;
140137
box-shadow: 0px 0px 3px #c0c0c0;
@@ -149,7 +146,6 @@ css/* scss */ `
149146
}
150147
.o-hue-picker {
151148
border: ${ITEM_BORDER_WIDTH}px solid #c0c0c0;
152-
box-sizing: border-box;
153149
width: 100%;
154150
height: 12px;
155151
border-radius: 4px;
@@ -176,7 +172,6 @@ css/* scss */ `
176172
padding: 2px 0px;
177173
display: flex;
178174
input {
179-
box-sizing: border-box;
180175
width: 50%;
181176
border-radius: 4px;
182177
padding: 4px 23px 4px 10px;

src/components/color_picker/color_picker_widget.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ css/* scss */ `
3838
.o-color-picker-button {
3939
> span {
4040
border-bottom: 4px solid;
41-
height: 16px;
41+
height: 20px;
4242
margin-top: 2px;
4343
display: block;
4444
}

src/components/composer/composer/composer.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ css/* scss */ `
5151
word-break: break-all;
5252
padding-right: 2px;
5353
54-
box-sizing: border-box;
55-
5654
caret-color: black;
5755
padding-left: 3px;
5856
padding-right: 3px;

src/components/composer/grid_composer/grid_composer.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ const GRID_CELL_REFERENCE_TOP_OFFSET = 28;
2121
css/* scss */ `
2222
div.o-grid-composer {
2323
z-index: ${ComponentsImportance.GridComposer};
24-
box-sizing: border-box;
2524
position: absolute;
2625
border: ${COMPOSER_BORDER_WIDTH}px solid ${SELECTION_BORDER_COLOR};
2726
font-family: ${DEFAULT_FONT};

src/components/composer/standalone_composer/standalone_composer.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ css/* scss */ `
1515
.o-spreadsheet {
1616
.o-standalone-composer {
1717
min-height: 24px;
18-
box-sizing: border-box;
1918
2019
border-bottom: 1px solid;
2120
border-color: ${GRAY_300};

src/components/data_validation_overlay/dv_checkbox/dv_checkbox.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ const MARGIN = (GRID_ICON_EDGE_LENGTH - CHECKBOX_WIDTH) / 2;
88

99
css/* scss */ `
1010
.o-dv-checkbox {
11-
box-sizing: border-box !important;
12-
accent-color: #808080;
1311
margin: ${MARGIN}px;
1412
/* required to prevent the checkbox position to be sensible to the font-size (affects Firefox) */
1513
position: absolute;

src/components/error_tooltip/error_tooltip.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ css/* scss */ `
1414
border-left: 3px solid red;
1515
padding: 10px;
1616
width: ${ERROR_TOOLTIP_WIDTH}px;
17-
box-sizing: border-box !important;
1817
overflow-wrap: break-word;
1918
2019
.o-error-tooltip-message {

0 commit comments

Comments
 (0)