Skip to content

Commit 1e5ac40

Browse files
pksjcesimurai
andauthored
Change disabled color from muted to custom primer disabled color (#1512)
* Set disabled color where required Switched muted to new disabled color Update snapshot tests * Change colors only during disabled state of the component * Change color for disabled state only in buttontablelist * Fix up review comments for ButtonTableList * Update src/Button/ButtonTableList.tsx Co-authored-by: simurai <simurai@github.com> * Fix up review comments for ButtonTableList * Create smooth-squids-visit.md Co-authored-by: simurai <simurai@github.com>
1 parent f4b8c00 commit 1e5ac40

16 files changed

+29
-20
lines changed

.changeset/smooth-squids-visit.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/components": patch
3+
---
4+
5+
Change disabled color from muted to custom primer disabled color

src/ActionList/Item.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,9 @@ export interface ItemProps extends SxProp {
146146
const getItemVariant = (variant = 'default', disabled?: boolean) => {
147147
if (disabled) {
148148
return {
149-
color: get('colors.fg.muted'),
150-
iconColor: get('colors.fg.muted'),
151-
annotationColor: get('colors.fg.muted'),
149+
color: get('colors.primer.fg.disabled'),
150+
iconColor: get('colors.primer.fg.disabled'),
151+
annotationColor: get('colors.primer.fg.disabled'),
152152
hoverCursor: 'default'
153153
}
154154
}

src/Button/Button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const Button = styled(ButtonBase)<ButtonBaseProps & ButtonSystemProps & SxProp>`
2727
}
2828
2929
&:disabled {
30-
color: ${get('colors.fg.muted')};
30+
color: ${get('colors.primer.fg.disabled')};
3131
background-color: ${get('colors.btn.bg')};
3232
border-color: ${get('colors.btn.border')};
3333
}

src/Button/ButtonTableList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const ButtonTableList = styled.summary<StyledButtonTableListProps>`
3333
&:disabled {
3434
&,
3535
&:hover {
36-
color: rgba(${get('colors.fg.muted')}, 0.5);
36+
color: ${get('colors.primer.fg.disabled')};
3737
cursor: default;
3838
}
3939
}

src/Pagination/Pagination.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const Page = styled.a`
5555
5656
&[aria-disabled],
5757
&[aria-disabled]:hover {
58-
color: ${get('colors.fg.muted')}; // check
58+
color: ${get('colors.primer.fg.disabled')}; // check
5959
cursor: default;
6060
border-color: transparent;
6161
}

src/_TextInputWrapper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ const TextInputWrapper = styled.span<StyledWrapperProps>`
7979
${props =>
8080
props.disabled &&
8181
css`
82-
color: ${get('colors.fg.muted')};
82+
color: ${get('colors.primer.fg.disabled')};
8383
background-color: ${get('colors.input.disabledBg')};
8484
border-color: ${get('colors.border.default')};
8585
`}

src/__tests__/Pagination/__snapshots__/Pagination.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ exports[`Pagination renders consistently 1`] = `
6161
6262
.c2[aria-disabled],
6363
.c2[aria-disabled]:hover {
64-
color: #57606a;
64+
color: #8c959f;
6565
cursor: default;
6666
border-color: transparent;
6767
}

src/__tests__/__snapshots__/ActionMenu.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ exports[`ActionMenu renders consistently 1`] = `
6262
}
6363
6464
.c0:disabled {
65-
color: #57606a;
65+
color: #8c959f;
6666
background-color: #f6f8fa;
6767
border-color: rgba(27,31,36,0.15);
6868
}

src/__tests__/__snapshots__/AnchoredOverlay.test.tsx.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ exports[`AnchoredOverlay renders consistently 1`] = `
6868
}
6969
7070
.c1:disabled {
71-
color: #57606a;
71+
color: #8c959f;
7272
background-color: #f6f8fa;
7373
border-color: rgba(27,31,36,0.15);
7474
}
@@ -163,7 +163,7 @@ Object {
163163
}
164164
165165
.c1:disabled {
166-
color: #57606a;
166+
color: #8c959f;
167167
background-color: #f6f8fa;
168168
border-color: rgba(27,31,36,0.15);
169169
}
@@ -243,7 +243,7 @@ Object {
243243
<button
244244
aria-haspopup="true"
245245
aria-labelledby="react-aria-1"
246-
class="ButtonBase-sc-181ps9o-0 Button-xjtz72-0 jPURef"
246+
class="ButtonBase-sc-181ps9o-0 Button-xjtz72-0 iRqJHc"
247247
id="react-aria-1"
248248
tabindex="0"
249249
>

src/__tests__/__snapshots__/Button.test.tsx.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ exports[`Button renders consistently 1`] = `
6262
}
6363
6464
.c0:disabled {
65-
color: #57606a;
65+
color: #8c959f;
6666
background-color: #f6f8fa;
6767
border-color: rgba(27,31,36,0.15);
6868
}
@@ -134,7 +134,7 @@ exports[`Button respects the "disabled" prop 1`] = `
134134
}
135135
136136
.c0:disabled {
137-
color: #57606a;
137+
color: #8c959f;
138138
background-color: #f6f8fa;
139139
border-color: rgba(27,31,36,0.15);
140140
}
@@ -819,7 +819,7 @@ exports[`ButtonTableList renders consistently 1`] = `
819819
820820
.c0:disabled,
821821
.c0:disabled:hover {
822-
color: rgba(#57606a,0.5);
822+
color: #8c959f;
823823
cursor: default;
824824
}
825825

0 commit comments

Comments
 (0)