Skip to content

Commit 5e993e7

Browse files
ThemeBuilder: it is not possible to change the background color of buttons with the 'Normal' type in the 'Outlined' and 'Text' styling modes (T1212068) (#28692)
1 parent 07a359f commit 5e993e7

File tree

15 files changed

+274
-161
lines changed

15 files changed

+274
-161
lines changed

packages/devextreme-scss/scss/widgets/fluent/button/_colors.scss

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,23 @@ $button-shadow-color: null !default;
1616
$button-normal-color: $base-text-color !default;
1717

1818
/**
19-
* $name 15. Background color
19+
* $name 15. Background color (contained)
2020
* $type color
2121
*/
2222
$button-normal-bg: $base-element-bg !default;
2323

24+
/**
25+
* $name 16. Background color (outlined)
26+
* $type color
27+
*/
28+
$button-normal-outlined-bg: transparent !default;
29+
30+
/**
31+
* $name 17. Background color (text)
32+
* $type color
33+
*/
34+
$button-normal-text-bg: transparent !default;
35+
2436
/**
2537
* $name 20. Selected state text color
2638
* $type color
@@ -50,7 +62,6 @@ $button-normal-active-bg: $base-active-bg !default;
5062
* $type color
5163
*/
5264
$button-normal-selected-bg: $base-selected-bg !default;
53-
$button-normal-bg-inverted: null !default;
5465

5566
/**
5667
* $name 10. Text color (contained)
@@ -100,6 +111,8 @@ $button-default-selected-bg: null !default;
100111
*/
101112
$button-default-outlined-color: $base-accent !default;
102113
$button-default-outlined-border-color: $base-accent !default;
114+
115+
$button-default-outlined-bg: transparent !default;
103116
$button-default-outlined-hover-bg: null !default;
104117
$button-default-outlined-focused-bg: null !default;
105118
$button-default-outlined-active-bg: null !default;
@@ -158,6 +171,7 @@ $button-danger-outlined-border-color: $base-danger !default;
158171
$button-danger-outlined-color-hover: null !default;
159172
$button-danger-outlined-color-active: null !default;
160173
$button-danger-outlined-selected-color: null !default;
174+
$button-danger-outlined-bg: transparent !default;
161175
$button-danger-outlined-hover-bg: null !default;
162176
$button-danger-outlined-focused-bg: null !default;
163177
$button-danger-outlined-active-bg: null !default;
@@ -210,6 +224,7 @@ $button-success-outlined-border-color: $base-success !default;
210224
$button-success-outlined-color-hover: null !default;
211225
$button-success-outlined-color-active: null !default;
212226
$button-success-outlined-selected-color: null !default;
227+
$button-success-outlined-bg: transparent !default;
213228
$button-success-outlined-hover-bg: null !default;
214229
$button-success-outlined-focused-bg: null !default;
215230
$button-success-outlined-active-bg: null !default;
@@ -268,9 +283,9 @@ $button-accent-foreground-color: null !default;
268283
$button-danger-outlined-color-active: $base-danger-active !default;
269284
$button-danger-outlined-selected-color: $base-danger-selected !default;
270285

271-
$button-success-outlined-color-hover: $button-success-selected-bg !default;
272-
$button-success-outlined-color-active: $button-success-active-bg !default;
273-
$button-success-outlined-selected-color: $button-success-selected-bg !default;
286+
$button-success-outlined-color-hover: darken(desaturate($base-success, 0.22), 12.16) !default;
287+
$button-success-outlined-color-active: darken(desaturate($base-success, 0.95), 19.22) !default;
288+
$button-success-outlined-selected-color: $button-success-outlined-color-hover;
274289

275290
$button-default-color: $base-inverted-text-color !default;
276291
$button-default-selected-color: $base-inverted-text-color !default;
@@ -279,7 +294,6 @@ $button-accent-foreground-color: null !default;
279294
$button-success-color: $base-inverted-text-color !default;
280295
$button-success-selected-color: $base-inverted-text-color !default;
281296
$button-shadow-color: color.change($base-shadow-color, $alpha: 0.24) !default;
282-
$button-normal-bg-inverted: darken($button-normal-bg, 100%) !default;
283297
}
284298

285299
@if $mode == "dark" {
@@ -309,9 +323,9 @@ $button-accent-foreground-color: null !default;
309323
$button-danger-outlined-active-bg: darken(desaturate($base-danger, 4.6), 22.9) !default;
310324
$button-danger-outlined-selected-bg: darken(desaturate($base-danger, 4.3), 40.4) !default;
311325

312-
$button-success-outlined-color-hover: $button-success-active-bg !default;
313-
$button-success-outlined-color-active: $button-success-active-bg !default;
314-
$button-success-outlined-selected-color: $button-success-active-bg !default;
326+
$button-success-outlined-color-hover: lighten(saturate($base-success, 10.6), 45.3) !default;
327+
$button-success-outlined-color-active: $button-success-outlined-color-hover !default;
328+
$button-success-outlined-selected-color: $button-success-outlined-color-hover !default;
315329

316330
$button-success-outlined-hover-bg: darken(saturate($base-success, 39.4), 42.7) !default;
317331
$button-success-outlined-focused-bg: $button-success-outlined-hover-bg !default;
@@ -325,7 +339,6 @@ $button-accent-foreground-color: null !default;
325339
$button-success-color: $base-typography-bg !default;
326340
$button-success-selected-color: $base-typography-bg !default;
327341
$button-shadow-color: color.change($base-shadow-color, $alpha: 0.4) !default;
328-
$button-normal-bg-inverted: lighten($button-normal-bg, 100%) !default;
329342
}
330343

331344
$button-default-icon-color: $button-default-color !default;
@@ -336,12 +349,12 @@ $button-success-icon-color: $button-success-color !default;
336349
$button-disabled-text-color: $base-foreground-disabled !default;
337350

338351
$button-normal-outlined-hover-bg: $button-normal-hover-bg !default;
339-
$button-normal-outlined-focused-bg: $button-normal-hover-bg !default;
352+
$button-normal-outlined-focused-bg: $button-normal-focused-bg !default;
340353
$button-normal-outlined-active-bg: $button-normal-active-bg !default;
341354
$button-normal-outlined-selected-bg: $button-normal-selected-bg !default;
342355

343356
$button-normal-text-hover-bg: $button-normal-hover-bg !default;
344-
$button-normal-text-focused-bg: $button-normal-hover-bg !default;
357+
$button-normal-text-focused-bg: $button-normal-focused-bg !default;
345358
$button-normal-text-active-bg: $button-normal-active-bg !default;
346359
$button-normal-text-selected-bg: $button-normal-selected-bg !default;
347360

@@ -381,6 +394,7 @@ $button-default-text-color-active: $button-default-outlined-color-active !defaul
381394
*/
382395
$button-default-text-selected-color: $button-accent-foreground-color !default;
383396

397+
$button-default-text-bg: transparent !default;
384398
$button-default-text-hover-bg: $button-default-outlined-hover-bg !default;
385399
$button-default-text-focused-bg: $button-default-outlined-focused-bg !default;
386400
$button-default-text-active-bg: $button-default-outlined-active-bg !default;
@@ -391,6 +405,7 @@ $button-danger-text-color-hover: $button-danger-outlined-color-hover !default;
391405
$button-danger-text-color-active: $button-danger-outlined-color-active !default;
392406
$button-danger-text-selected-color: $button-danger-outlined-selected-color !default;
393407

408+
$button-danger-text-bg: transparent !default;
394409
$button-danger-text-hover-bg: $button-danger-outlined-hover-bg !default;
395410
$button-danger-text-focused-bg: $button-danger-outlined-focused-bg !default;
396411
$button-danger-text-active-bg: $button-danger-outlined-active-bg !default;
@@ -401,6 +416,7 @@ $button-success-text-color-hover: $button-success-outlined-color-hover !default;
401416
$button-success-text-color-active: $button-success-outlined-color-active !default;
402417
$button-success-text-selected-color: $button-success-outlined-selected-color !default;
403418

419+
$button-success-text-bg: transparent !default;
404420
$button-success-text-hover-bg: $button-success-outlined-hover-bg !default;
405421
$button-success-text-focused-bg: $button-success-outlined-hover-bg !default;
406422
$button-success-text-active-bg: $button-success-outlined-active-bg !default;

packages/devextreme-scss/scss/widgets/fluent/button/_index.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
$button-normal-color,
108108
$button-normal-color,
109109
$button-normal-color,
110+
$button-normal-text-bg,
110111
$button-normal-text-hover-bg,
111112
$button-normal-text-focused-bg,
112113
$button-normal-text-active-bg,
@@ -119,6 +120,7 @@
119120
$button-default-text-color,
120121
$button-default-text-color-hover,
121122
$button-default-text-color-active,
123+
$button-default-text-bg,
122124
$button-default-text-hover-bg,
123125
$button-default-text-focused-bg,
124126
$button-default-text-active-bg,
@@ -132,6 +134,7 @@
132134
$button-danger-text-color,
133135
$button-danger-text-color-hover,
134136
$button-danger-text-color-active,
137+
$button-danger-text-bg,
135138
$button-danger-text-hover-bg,
136139
$button-danger-text-focused-bg,
137140
$button-danger-text-active-bg,
@@ -145,6 +148,7 @@
145148
$button-success-text-color,
146149
$button-success-text-color-hover,
147150
$button-success-text-color-active,
151+
$button-success-text-bg,
148152
$button-success-text-hover-bg,
149153
$button-success-text-focused-bg,
150154
$button-success-text-active-bg,
@@ -160,6 +164,7 @@
160164
$button-normal-color,
161165
$button-normal-color,
162166
$base-border-color,
167+
$button-normal-outlined-bg,
163168
$button-normal-outlined-hover-bg,
164169
$button-normal-outlined-focused-bg,
165170
$button-normal-outlined-active-bg,
@@ -173,6 +178,7 @@
173178
$button-default-outlined-color-hover,
174179
$button-default-outlined-color-active,
175180
$button-default-outlined-border-color,
181+
$button-default-outlined-bg,
176182
$button-default-outlined-hover-bg,
177183
$button-default-outlined-focused-bg,
178184
$button-default-outlined-active-bg,
@@ -187,6 +193,7 @@
187193
$button-danger-outlined-color-hover,
188194
$button-danger-outlined-color-active,
189195
$button-danger-outlined-border-color,
196+
$button-danger-outlined-bg,
190197
$button-danger-outlined-hover-bg,
191198
$button-danger-outlined-focused-bg,
192199
$button-danger-outlined-active-bg,
@@ -201,6 +208,7 @@
201208
$button-success-outlined-color-hover,
202209
$button-success-outlined-color-active,
203210
$button-success-outlined-border-color,
211+
$button-success-outlined-bg,
204212
$button-success-outlined-hover-bg,
205213
$button-success-outlined-focused-bg,
206214
$button-success-outlined-active-bg,

packages/devextreme-scss/scss/widgets/fluent/button/_mixins.scss

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -149,23 +149,24 @@
149149
$button-color,
150150
$button-color-hover,
151151
$button-color-active,
152-
$hover-bg,
153-
$focused-bg,
154-
$active-bg,
155-
$selected-bg: $active-bg,
156-
$selected-color: $button-color
152+
$button-bg,
153+
$button-hover-bg,
154+
$button-focused-bg,
155+
$button-active-bg,
156+
$button-selected-bg: $button-active-bg,
157+
$button-selected-color: $button-color
157158
) {
158159
@include dx-button-styling-variant(
159-
transparent,
160+
$button-bg,
160161
$button-color,
161162
$button-color-hover,
162163
$button-color-active,
163-
$hover-bg,
164-
$focused-bg,
165-
$active-bg,
164+
$button-hover-bg,
165+
$button-focused-bg,
166+
$button-active-bg,
166167
$button-color,
167-
$selected-bg,
168-
$selected-color,
168+
$button-selected-bg,
169+
$button-selected-color,
169170
);
170171
}
171172

@@ -174,26 +175,27 @@
174175
$button-color-hover,
175176
$button-color-active,
176177
$border-color,
177-
$hover-bg,
178-
$focused-bg,
179-
$active-bg,
180-
$selected-bg,
181-
$selected-color: $button-color-active,
178+
$button-bg,
179+
$button-hover-bg,
180+
$button-focused-bg,
181+
$button-active-bg,
182+
$button-selected-bg,
183+
$button-selected-color: $button-color-active,
182184
) {
183185
border-width: 1px;
184186
border-style: solid;
185187
border-color: $border-color;
186188

187189
@include dx-button-styling-variant(
188-
transparent,
190+
$button-bg,
189191
$button-color,
190192
$button-color-hover,
191193
$button-color-active,
192-
$hover-bg,
193-
$focused-bg,
194-
$active-bg,
194+
$button-hover-bg,
195+
$button-focused-bg,
196+
$button-active-bg,
195197
$button-color,
196-
$selected-bg,
197-
$selected-color,
198+
$button-selected-bg,
199+
$button-selected-color,
198200
);
199201
}

packages/devextreme-scss/scss/widgets/fluent/scheduler/_index.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,7 @@ $fluent-scheduler-agenda-time-panel-cell-padding: 8px;
777777
$button-default-text-color,
778778
$button-default-text-color-hover,
779779
$button-default-text-color-active,
780+
$button-default-text-bg,
780781
$button-default-text-hover-bg,
781782
$button-default-text-focused-bg,
782783
$button-default-text-active-bg

packages/devextreme-scss/scss/widgets/fluent/toolbar/_index.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
$button-normal-color,
101101
$button-normal-color,
102102
$button-normal-color,
103+
$button-normal-text-bg,
103104
$button-normal-text-hover-bg,
104105
$button-normal-text-focused-bg,
105106
$button-normal-text-active-bg
@@ -111,6 +112,7 @@
111112
$button-default-text-color,
112113
$button-default-text-color-hover,
113114
$button-default-text-color-active,
115+
$button-default-text-bg,
114116
$button-default-text-hover-bg,
115117
$button-default-text-focused-bg,
116118
$button-default-text-active-bg
@@ -122,6 +124,7 @@
122124
$button-danger-bg,
123125
$button-danger-bg,
124126
$button-danger-bg,
127+
$button-danger-text-bg,
125128
$button-danger-text-hover-bg,
126129
$button-danger-text-focused-bg,
127130
$button-danger-text-active-bg
@@ -133,6 +136,7 @@
133136
$button-success-bg,
134137
$button-success-bg,
135138
$button-success-bg,
139+
$button-success-text-bg,
136140
$button-success-text-hover-bg,
137141
$button-success-text-focused-bg,
138142
$button-success-text-active-bg

0 commit comments

Comments
 (0)