Skip to content

Commit 108d731

Browse files
Update Path component styling to WCAG 2.1
Make changes to background colors for path stages to be compliant with new WCAG 2.1 standards
1 parent fe9e2c9 commit 108d731

File tree

3 files changed

+27
-27
lines changed

3 files changed

+27
-27
lines changed

ui/components/path-simple/base/_deprecate.scss

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// Copyright (c) 2015-present, salesforce.com, inc. All rights reserved
22
// Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license
33

4-
$legacy-color-background-path-incomplete: #e0e5ee;
5-
$legacy-color-background-path-incomplete-hover: #d8dde6;
6-
$legacy-color-background-path-complete: #51c983;
7-
$legacy-color-background-path-complete-hover: #1f8956;
8-
$legacy-color-background-path-current: #1172cf;
9-
$legacy-color-background-path-current-hover: #0d61af;
10-
$legacy-color-background-path-lost: #c23934;
4+
$legacy-color-background-path-incomplete: #f3f3f3;
5+
$legacy-color-background-path-incomplete-hover: #c9c9c9;
6+
$legacy-color-background-path-complete: #3ba755;
7+
$legacy-color-background-path-complete-hover: #2e844a;
8+
$legacy-color-background-path-current: #014486;
9+
$legacy-color-background-path-current-hover: #032d60;
10+
$legacy-color-background-path-lost: #ea001e;
1111

1212
.slds-path-coach {
1313
@include deprecate('4.0.0', 'Use .slds-path instead of .slds-path-coach') {
@@ -32,7 +32,7 @@ $legacy-color-background-path-lost: #c23934;
3232
@include tabs;
3333

3434
.slds-is-complete {
35-
background-color: $legacy-color-background-path-complete;
35+
background-color: var(--slds-g-color-success-base-60, #{$legacy-color-background-path-complete});
3636

3737
.slds-tabs_path__stage,
3838
.slds-tabs--path__stage {
@@ -50,7 +50,7 @@ $legacy-color-background-path-lost: #c23934;
5050
}
5151

5252
&:hover {
53-
background-color: $legacy-color-background-path-complete-hover;
53+
background-color: var(--slds-g-color-success-base-50, #{$legacy-color-background-path-complete-hover});
5454

5555
.slds-tabs_path__stage,
5656
.slds-tabs--path__stage {
@@ -70,26 +70,26 @@ $legacy-color-background-path-lost: #c23934;
7070
}
7171

7272
.slds-is-current {
73-
background-color: $legacy-color-background-path-current;
73+
background-color: var(--slds-g-color-palette-blue-30, #{$legacy-color-background-path-current});
7474

7575
&:hover {
76-
background-color: $legacy-color-background-path-current-hover;
76+
background-color: var(--slds-g-color-palette-blue-20, #{$legacy-color-background-path-current-hover});
7777
}
7878

7979
+ .slds-is-incomplete:before {
80-
background-color: $legacy-color-background-path-current;
80+
background-color: var(--slds-g-color-palette-blue-30, #{$legacy-color-background-path-current});
8181
}
8282

8383
&:hover + .slds-is-incomplete:before {
84-
background-color: $legacy-color-background-path-current-hover;
84+
background-color: var(--slds-g-color-palette-blue-20, #{$legacy-color-background-path-current-hover});
8585
}
8686
}
8787

8888
.slds-is-incomplete {
8989
background-color: var(--slds-g-color-neutral-base-95, #{$legacy-color-background-path-incomplete});
9090

9191
&:hover {
92-
background-color: var(--slds-g-color-neutral-base-90, #{$legacy-color-background-path-incomplete-hover});
92+
background-color: var(--slds-g-color-neutral-base-80, #{$legacy-color-background-path-incomplete-hover});
9393
}
9494

9595
.slds-tabs_path__link,
@@ -100,7 +100,7 @@ $legacy-color-background-path-lost: #c23934;
100100

101101
.slds-is-lost,
102102
.slds-is-lost:hover {
103-
background-color: $legacy-color-background-path-lost;
103+
background-color: var(--slds-g-color-error-base-50, #{$legacy-color-background-path-lost});
104104
}
105105

106106
// Lets make sure we have the right color when these steps are activated
@@ -203,12 +203,12 @@ $legacy-color-background-path-lost: #c23934;
203203
// The below logic makes the :before (which is actually a part of the previous section) the proper color based on tabs--path__item order
204204
+ .slds-is-complete:before,
205205
+ .slds-is-current:before {
206-
background-color: $legacy-color-background-path-complete;
206+
background-color: var(--slds-g-color-success-base-60, #{$legacy-color-background-path-complete});
207207
}
208208

209209
&:hover + .slds-is-complete:before,
210210
&:hover + .slds-is-current:before {
211-
background-color: $legacy-color-background-path-complete-hover;
211+
background-color: var(--slds-g-color-success-base-50, #{$legacy-color-background-path-complete-hover});
212212
}
213213

214214
+ .slds-is-incomplete:before,
@@ -218,7 +218,7 @@ $legacy-color-background-path-lost: #c23934;
218218

219219
&:hover + .slds-is-incomplete:before,
220220
&:hover + .slds-is-lost:before {
221-
background-color: var(--slds-g-color-neutral-base-90, #{$legacy-color-background-path-incomplete-hover});
221+
background-color: var(--slds-g-color-neutral-base-80, #{$legacy-color-background-path-incomplete-hover});
222222
}
223223
}
224224
}

ui/components/path/base/_index.scss

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -183,26 +183,26 @@
183183
// these mixins exist in order to alias selector assignment in the case
184184
// where state cannot be applied to the individual path step
185185
@mixin is-won() {
186-
background: $color-background-path-won;
186+
background: var(--slds-g-color-success-base-50, #{$color-background-path-won});
187187

188188
&:before,
189189
&:after,
190190
&:hover,
191191
&:hover:before,
192192
&:hover:after {
193-
background: $color-background-path-won;
193+
background: var(--slds-g-color-success-base-50, #{$color-background-path-won});
194194
}
195195
}
196196

197197
@mixin is-lost() {
198-
background: $color-background-path-lost;
198+
background: var(--slds-g-color-error-base-50, #{$color-background-path-lost});
199199

200200
&:before,
201201
&:after,
202202
&:hover,
203203
&:hover:before,
204204
&:hover:after {
205-
background: $color-background-path-lost;
205+
background: var(--slds-g-color-error-base-50, #{$color-background-path-lost});
206206
}
207207
}
208208

@@ -252,11 +252,11 @@
252252
* @restrict .slds-path__item
253253
*/
254254
.slds-is-complete {
255-
background: $color-background-path-complete;
255+
background: var(--slds-g-color-success-base-60, #{$color-background-path-complete});
256256

257257
&:before,
258258
&:after {
259-
background: $color-background-path-complete;
259+
background: var(--slds-g-color-success-base-60, #{$color-background-path-complete});
260260
}
261261

262262
.slds-path__stage {
@@ -272,11 +272,11 @@
272272
}
273273

274274
&:hover {
275-
background: $color-background-path-complete-hover;
275+
background: var(--slds-g-color-success-base-50, #{$color-background-path-complete-hover});
276276

277277
&:before,
278278
&:after {
279-
background: $color-background-path-complete-hover;
279+
background: var(--slds-g-color-success-base-50, #{$color-background-path-complete-hover});
280280
}
281281

282282
.slds-path__stage {

ui/components/path/tokens/background-color.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ imports:
1313

1414
props:
1515
COLOR_BACKGROUND_PATH_COMPLETE:
16-
value: '{!PALETTE_GREEN_70}'
16+
value: '{!PALETTE_GREEN_60}'
1717
comment: The background color for Salespath stages that are complete.
1818
COLOR_BACKGROUND_PATH_COMPLETE_HOVER:
1919
value: '{!PALETTE_GREEN_50}'

0 commit comments

Comments
 (0)