Skip to content

Commit

Permalink
[Checkbox] Update icon hard coded color value (#10999)
Browse files Browse the repository at this point in the history
### WHY are these changes introduced?

Fixes Shopify/polaris-internal#1082

### WHAT is this pull request doing?

Removes hard coded value and replaces it with tokens
  • Loading branch information
kyledurand authored Oct 17, 2023
1 parent fb508b9 commit e34a4db
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/moody-scissors-greet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/polaris': patch
---

Updated `Checkbox` icon to use tokens vs hard coded value
11 changes: 8 additions & 3 deletions polaris-react/src/components/Checkbox/Checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@
transform var(--p-motion-duration-150) var(--p-motion-ease-out);
opacity: 1;

/* stylelint-disable-next-line selector-max-combinators -- need to target svg from icons package */
svg {
fill: var(--p-color-text-brand-on-bg-fill);
}

&.animated {
transition: initial;
}
Expand All @@ -86,7 +91,7 @@

// stylelint-disable-next-line selector-max-combinators -- target disabled icon color
~ .Icon svg {
fill: var(--p-color-checkbox-icon-disabled);
color: var(--p-color-checkbox-icon-disabled);
}
}

Expand Down Expand Up @@ -141,7 +146,7 @@
}

svg {
fill: var(--p-color-text-brand-on-bg-fill);
color: var(--p-color-text-brand-on-bg-fill);

position: absolute;
top: 0;
Expand All @@ -158,7 +163,7 @@
// stylelint-disable selector-max-specificity, selector-max-class, selector-max-combinators, selector-max-compound-selectors -- generated by polaris-migrator DO NOT COPY
.error {
.Icon svg {
fill: var(--p-color-text-critical-on-bg-fill);
color: var(--p-color-text-critical-on-bg-fill);
}

.Input {
Expand Down
2 changes: 1 addition & 1 deletion polaris-react/src/components/Checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export const Checkbox = forwardRef<CheckboxHandles, CheckboxProps>(
transform="translate(2 2.980376)"
opacity="0"
fill="none"
stroke="#fff"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
Expand Down

0 comments on commit e34a4db

Please sign in to comment.