Skip to content

Commit 07f91d8

Browse files
committed
Fix badge colors
1 parent 615bb12 commit 07f91d8

File tree

4 files changed

+112
-10
lines changed

4 files changed

+112
-10
lines changed

polaris-react/src/components/Badge/Badge.scss

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,15 @@
1313
border-radius: var(--p-border-radius-5);
1414
color: var(--p-color-text);
1515

16-
:where(#{$se23}) & {
16+
#{$se23} & {
1717
background-color: var(--p-color-experimental-bg-transparent-subdued);
1818
color: var(--p-color-text-subdued);
1919
font-weight: var(--p-font-weight-medium);
20+
border-radius: var(--p-border-radius-2);
21+
22+
svg {
23+
fill: var(--p-color-text-subdued);
24+
}
2025
}
2126

2227
@media print {
@@ -29,6 +34,10 @@
2934

3035
#{$se23} & {
3136
color: var(--p-color-text-success);
37+
38+
svg {
39+
fill: var(--p-color-icon-success);
40+
}
3241
}
3342
}
3443

@@ -37,6 +46,10 @@
3746

3847
#{$se23} & {
3948
color: var(--p-color-text-info);
49+
50+
svg {
51+
fill: var(--p-color-icon-info);
52+
}
4053
}
4154
}
4255

@@ -45,14 +58,22 @@
4558

4659
#{$se23} & {
4760
color: var(--p-color-text-caution);
61+
62+
svg {
63+
fill: var(--p-color-icon-caution);
64+
}
4865
}
4966
}
5067

5168
.statusWarning {
5269
background-color: var(--p-color-bg-warning);
5370

5471
#{$se23} & {
55-
color: var(--p-color-text-warning-strong);
72+
color: var(--p-color-experimental-text-warning);
73+
74+
svg {
75+
fill: var(--p-color-icon-warning);
76+
}
5677
}
5778
}
5879

@@ -61,6 +82,10 @@
6182

6283
#{$se23} & {
6384
color: var(--p-color-text-critical);
85+
86+
svg {
87+
fill: var(--p-color-icon-critical);
88+
}
6489
}
6590
}
6691

polaris-react/src/components/Badge/Badge.stories.tsx

Lines changed: 77 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import React from 'react';
22
import type {ComponentMeta} from '@storybook/react';
3-
import {Badge} from '@shopify/polaris';
3+
import {
4+
Badge,
5+
HorizontalStack,
6+
LegacyCard,
7+
VerticalStack,
8+
} from '@shopify/polaris';
49

510
export default {
611
component: Badge,
@@ -10,10 +15,6 @@ export function Default() {
1015
return <Badge>Fulfilled</Badge>;
1116
}
1217

13-
export function Small() {
14-
return <Badge size="small">Fulfilled</Badge>;
15-
}
16-
1718
export function Informational() {
1819
return <Badge status="info">Draft</Badge>;
1920
}
@@ -69,3 +70,74 @@ export function WithStatusAndProgressLabelOverride() {
6970
</Badge>
7071
);
7172
}
73+
74+
export function DesignReview() {
75+
return (
76+
<LegacyCard sectioned>
77+
<VerticalStack gap="5">
78+
<HorizontalStack gap="5">
79+
<Badge>Fulfilled</Badge>
80+
<Badge status="info">Informational</Badge>
81+
<Badge status="success">Success</Badge>
82+
<Badge status="warning">Warning</Badge>
83+
<Badge status="attention">Attention</Badge>
84+
<Badge status="critical">Critical</Badge>
85+
</HorizontalStack>
86+
<HorizontalStack gap="5">
87+
<Badge progress="complete">Fulfilled</Badge>
88+
<Badge progress="complete" status="info">
89+
Informational
90+
</Badge>
91+
<Badge progress="complete" status="success">
92+
Success
93+
</Badge>
94+
<Badge progress="complete" status="warning">
95+
Warning
96+
</Badge>
97+
<Badge progress="complete" status="attention">
98+
Attention
99+
</Badge>
100+
<Badge progress="complete" status="critical">
101+
Critical
102+
</Badge>
103+
</HorizontalStack>
104+
<HorizontalStack gap="5">
105+
<Badge progress="partiallyComplete">Fulfilled</Badge>
106+
<Badge progress="partiallyComplete" status="info">
107+
Informational
108+
</Badge>
109+
<Badge progress="partiallyComplete" status="success">
110+
Success
111+
</Badge>
112+
<Badge progress="partiallyComplete" status="warning">
113+
Warning
114+
</Badge>
115+
<Badge progress="partiallyComplete" status="attention">
116+
Attention
117+
</Badge>
118+
<Badge progress="partiallyComplete" status="critical">
119+
Critical
120+
</Badge>
121+
</HorizontalStack>
122+
<HorizontalStack gap="5">
123+
<Badge progress="incomplete">Fulfilled</Badge>
124+
<Badge progress="incomplete" status="info">
125+
Informational
126+
</Badge>
127+
<Badge progress="incomplete" status="success">
128+
Success
129+
</Badge>
130+
<Badge progress="incomplete" status="warning">
131+
Warning
132+
</Badge>
133+
<Badge progress="incomplete" status="attention">
134+
Attention
135+
</Badge>
136+
<Badge progress="incomplete" status="critical">
137+
Critical
138+
</Badge>
139+
</HorizontalStack>
140+
</VerticalStack>
141+
</LegacyCard>
142+
);
143+
}

polaris-react/src/components/Badge/components/Pip/Pip.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
border-radius: 3px;
2323
// stylelint-disable-next-line -- se23 1.25px border width
2424
border-width: 1.25px;
25+
--pc-pip-color: var(--p-color-text-subdued);
2526
}
2627
}
2728

@@ -48,6 +49,10 @@
4849
.statusWarning {
4950
// stylelint-disable-next-line -- Polaris component custom properties
5051
--pc-pip-color: var(--p-color-icon-caution);
52+
53+
#{$se23} & {
54+
--pc-pip-color: var(--p-color-icon-warning);
55+
}
5156
}
5257

5358
.statusCritical {

polaris-tokens/src/token-groups/color.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ export const color: {
370370
},
371371
'color-bg-critical': {
372372
value: colors.red[200],
373-
valueExperimental: colorsExperimental.red[4],
373+
valueExperimental: colorsExperimental.red[6],
374374
description: '',
375375
},
376376
'color-bg-critical-subdued': {
@@ -690,7 +690,7 @@ export const color: {
690690
},
691691
'color-icon-critical': {
692692
value: colors.red[600],
693-
valueExperimental: colorsExperimental.red[12],
693+
valueExperimental: colorsExperimental.red[11],
694694
description: '',
695695
},
696696
'color-icon-caution': {
@@ -700,7 +700,7 @@ export const color: {
700700
},
701701
'color-icon-info': {
702702
value: colors.teal[600],
703-
valueExperimental: colorsExperimental.azure[12],
703+
valueExperimental: colorsExperimental.azure[11],
704704
description: '',
705705
},
706706
'color-icon-warning': {

0 commit comments

Comments
 (0)