Skip to content

Commit d8db270

Browse files
committed
[IMP] css: clean up UX color palette
We have a lots of colors across all of our css. Some of these colors are duplicated and some are almost the same. We are not consistent at all. With this commit, I try to clean up all of these colors: - we now have less colors than before - all colors now use css variables - some colors used in the JS were moved to the CSS closes #7196 Task: 5107222 Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
1 parent 31cc2cf commit d8db270

File tree

46 files changed

+145
-180
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+145
-180
lines changed

src/components/autofill/autofill.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
.o-autofill {
33
position: absolute;
44
border: 1px solid white;
5-
background-color: #1a73e8;
5+
background-color: var(--os-selection-border-color);
66
height: var(--os-autofill-edge-length);
77
width: var(--os-autofill-edge-length);
88
}

src/components/bottom_bar/bottom_bar.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.o-spreadsheet {
22
.o-spreadsheet-bottom-bar {
33
font-size: 15px;
4-
border-top: 1px solid lightgrey;
4+
border-top: 1px solid var(--os-gray-400);
55
background-color: var(--os-background-gray-color);
66
padding-left: var(--os-header-width);
77

@@ -15,11 +15,11 @@
1515
.o-all-sheets {
1616
max-width: 70%;
1717
.o-bottom-bar-fade-out {
18-
background-image: linear-gradient(-90deg, #cfcfcf, transparent 1%);
18+
background-image: linear-gradient(-90deg, var(--os-gray-400), transparent 1%);
1919
}
2020
.o-bottom-bar-fade-in {
2121
z-index: 1;
22-
background-image: linear-gradient(90deg, #cfcfcf, transparent 1%);
22+
background-image: linear-gradient(90deg, var(--os-gray-400), transparent 1%);
2323
}
2424
.o-sheet-list {
2525
overflow-y: hidden;

src/components/bottom_bar/bottom_bar_sheet/bottom_bar_sheet.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
padding: 0 15px;
44
padding-right: 10px;
55
height: var(--os-desktop-bottombar-height);
6-
border-left: 1px solid #c1c1c1;
7-
border-right: 1px solid #c1c1c1;
6+
border-left: 1px solid var(--os-gray-400);
7+
border-right: 1px solid var(--os-gray-400);
88
margin-left: -1px;
99
cursor: pointer;
1010
&:hover {

src/components/bottom_bar/bottom_bar_statistic/bottom_bar_statistic.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
.o-selection-statistic {
33
margin-right: 20px;
44
padding: 4px 4px 4px 8px;
5-
color: #333;
65
cursor: pointer;
76
&:hover {
87
background-color: rgba(0, 0, 0, 0.08) !important;

src/components/color_picker/color_picker.css

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,21 @@
3737
height: calc(var(--os-item-edge-length) + (2 * var(--os-item-border-width)));
3838
margin: 0px;
3939
border-radius: 50px;
40-
border: var(--os-item-border-width) solid #666666;
40+
border: var(--os-item-border-width) solid var(--os-gray-600);
4141
padding: 0px;
4242
font-size: 16px;
4343
background: white;
4444
&:hover {
4545
background-color: rgba(0, 0, 0, 0.08);
46-
outline: 1px solid gray;
46+
outline: 1px solid var(--os-gray-500);
4747
cursor: pointer;
4848
}
4949
}
5050
.o-buttons {
5151
padding: var(--os-picker-padding);
5252
display: flex;
5353
.o-cancel {
54-
border: var(--os-item-border-width) solid #c0c0c0;
54+
border: var(--os-item-border-width) solid var(--os-gray-300);
5555
width: 100%;
5656
padding: 5px;
5757
font-size: 14px;
@@ -63,7 +63,7 @@
6363
}
6464
}
6565
.o-add-button {
66-
border: var(--os-item-border-width) solid #c0c0c0;
66+
border: var(--os-item-border-width) solid var(--os-gray-300);
6767
padding: 4px;
6868
background: white;
6969
border-radius: 4px;
@@ -82,7 +82,7 @@
8282
position: relative;
8383
.o-gradient {
8484
margin-bottom: calc(var(--os-magnifier-edge) / 2);
85-
border: var(--os-item-border-width) solid #c0c0c0;
85+
border: var(--os-item-border-width) solid var(--os-gray-300);
8686
width: calc(var(--os-inner-gradient-width) + (2 * var(--os-item-border-width)));
8787
height: calc(var(--os-inner-gradient-height) + (2 * var(--os-item-border-width)));
8888
position: relative;
@@ -93,7 +93,7 @@
9393
width: var(--os-magnifier-edge);
9494
border-radius: 50%;
9595
border: 2px solid #fff;
96-
box-shadow: 0px 0px 3px #c0c0c0;
96+
box-shadow: 0px 0px 3px var(--os-gray-300);
9797
position: absolute;
9898
z-index: 2;
9999
}
@@ -104,7 +104,7 @@
104104
background: linear-gradient(to top, #000 0%, transparent 100%);
105105
}
106106
.o-hue-picker {
107-
border: var(--os-item-border-width) solid #c0c0c0;
107+
border: var(--os-item-border-width) solid var(--os-gray-300);
108108
width: 100%;
109109
height: 12px;
110110
border-radius: 4px;
@@ -135,7 +135,7 @@
135135
border-radius: 4px;
136136
padding: 4px 23px 4px 10px;
137137
height: 24px;
138-
border: 1px solid #c0c0c0;
138+
border: 1px solid var(--os-gray-300);
139139
margin-right: 2px;
140140
}
141141
.o-wrong-color {
@@ -154,7 +154,7 @@
154154
justify-content: end;
155155
}
156156
.o-color-preview {
157-
border: 1px solid #c0c0c0;
157+
border: 1px solid var(--os-gray-300);
158158
border-radius: 4px;
159159
width: 50%;
160160
}

src/components/composer/autocomplete_dropdown/autocomplete_dropdown.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
max-width: 400px;
77
z-index: 1;
88
.o-autocomplete-value-focus {
9-
background-color: #f2f2f2;
9+
background-color: var(--os-composer-assistant-background);
1010
}
1111
& > div {
1212
padding: 1px 5px 5px 5px;

src/components/composer/composer/composer.css

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,28 +24,21 @@
2424

2525
&.selector-flag:after {
2626
content: "␣";
27-
color: #a9a9a9;
27+
color: var(--os-composer-selector-flag-color);
2828
}
2929

3030
&.highlight-parenthesis-flag:not(.highlight-flag) {
3131
border-radius: 5px;
32-
background-color: lightgray;
32+
background-color: var(--os-gray-400);
3333
padding: 1.5px 0px 1.5px 0px;
3434
}
3535

3636
&.highlight-flag {
37-
background-color: #e6edf3;
37+
background-color: var(--os-composer-highlight-flag-color);
3838
}
3939
}
4040
}
4141
}
42-
.o-composer[placeholder]:empty:not(:focus):not(.active)::before {
43-
content: attr(placeholder);
44-
color: #bdbdbd;
45-
position: relative;
46-
top: 0%;
47-
pointer-events: none;
48-
}
4942

5043
.fa-stack {
5144
/* reset stack size which is doubled by default */
@@ -59,7 +52,7 @@
5952
top: -1px;
6053

6154
.fa-question-circle {
62-
color: var(--os-button-primary-bg);
55+
color: var(--os-primary-button-bg);
6356
}
6457
}
6558

src/components/composer/formula_assistant/formula_assistant.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.o-spreadsheet .o-formula-assistant {
22
background: #ffffff;
33
.o-formula-assistant-head {
4-
background-color: #f2f2f2;
4+
background-color: var(--os-composer-assistant-background);
55
padding: 10px;
66
}
77
.o-formula-assistant-core {

src/components/composer/speech_bubble/speech_bubble.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
background-color: white;
44
box-sizing: border-box;
55
box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15);
6-
border: 1px solid #ccc;
6+
border: 1px solid var(--os-gray-400);
77
z-index: var(--os-components-importance-popover);
88

99
&::after {
@@ -16,8 +16,8 @@
1616
width: var(--os-bubble-arrow-size);
1717
transform-origin: top left;
1818
transform: translate(0, -67%) rotate(45deg);
19-
border-right: 1px solid #ccc;
20-
border-bottom: 1px solid #ccc;
19+
border-right: 1px solid var(--os-gray-400);
20+
border-bottom: 1px solid var(--os-gray-400);
2121
box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15);
2222
}
2323
}

src/components/figures/figure/figure.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212

1313
div.o-figure-border {
1414
z-index: 1;
15+
border: 0px solid var(--os-figure-border-color);
16+
17+
&.o-selected {
18+
border-color: var(--os-selection-border-color);
19+
}
1520
}
1621

1722
.o-figure-wrapper {
@@ -29,7 +34,7 @@
2934
position: absolute;
3035
width: 8px;
3136
height: 8px;
32-
background-color: #1a73e8;
37+
background-color: var(--os-selection-border-color);
3338
outline: 1px solid white;
3439

3540
&.o-top {

0 commit comments

Comments
 (0)