Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions UNRELEASED.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ Use [the changelog guidelines](/documentation/Versioning%20and%20changelog.md) t

### Code quality

- Clean up Button styling and $button-filled mixin([#4635](https://github.com/Shopify/polaris-react/pull/4635))
- Remove filter functions ([#4650](https://github.com/Shopify/polaris-react/pull/4650))
- Remove all color() invocations ([#4636](https://github.com/Shopify/polaris-react/pull/4636))
- Cleaned up Button styling and $button-filled mixin([#4635](https://github.com/Shopify/polaris-react/pull/4635))
- Removed miscellaneous css custom properties ([#4620](https://github.com/Shopify/polaris-react/pull/4620))
Expand Down
10 changes: 5 additions & 5 deletions src/components/Navigation/Navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,14 @@ $disabled-fade: 0.6;
@include recolor-icon(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this function used a bunch? I would assume it's a filter related function. If it is we could move it to this file.

var(--p-icon-hovered),
transparent,
$filter-color: filter('action')
$filter-color: var(--p-action-primary)
);
background: var(--p-background-hovered);

@media (-ms-high-contrast: active) {
@include recolor-icon(
$fill-color: var(--p-icon-on-interactive),
$filter-color: filter('white')
$filter-color: var(--p-icon-on-interactive)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These filter-color values passed to the 3rd argument of recolor-icon are sent as the filter property. They're not actual color values, they're filters like brightness(0) saturate(100%) invert(100%).

I think changing these to colors is going to break the behaviour, which is to allow for the recoloring of icons that are passed as svg datauris and rendered with an img tag

);
}
}
Expand Down Expand Up @@ -380,13 +380,13 @@ $secondary-item-font-size: rem(15px);
@media (-ms-high-contrast: active) {
@include recolor-icon(
$fill-color: var(--p-icon-on-interactive),
$filter-color: filter('white')
$filter-color: var(--p-icon-on-interactive)
);
}
}

&:hover {
@include recolor-icon($filter-color: filter('action'));
@include recolor-icon($filter-color: var(--p-icon-on-interactive));
}

&:focus {
Expand Down Expand Up @@ -421,7 +421,7 @@ $secondary-item-font-size: rem(15px);
@include recolor-icon(
var(--p-action-primary),
null,
$filter-color: filter('action')
$filter-color: var(--p-icon-on-interactive)
);
color: var(--p-text-primary);
}
Expand Down
12 changes: 9 additions & 3 deletions src/components/Navigation/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,13 @@ $nav-animation-variables: (
}

@mixin nav-item-icon-attributes {
@include recolor-icon(var(--p-icon), transparent, filter('icon'));
// hardcoding this variable for now because we need to rip out all instances
// of filter() eventually but can't for this one right now. The value is the
// equivalent value for filter('icon').
--p-icon-filter: brightness(0) saturate(100%) invert(36%) sepia(13%)
saturate(137%) hue-rotate(169deg) brightness(95%) contrast(87%);

@include recolor-icon(var(--p-icon), transparent, var(--p-icon-filter));
flex-shrink: 0;
align-self: flex-start;
width: nav(icon-size);
Expand All @@ -93,7 +99,7 @@ $nav-animation-variables: (

.Item:hover &,
.Item.keyFocused & {
@include recolor-icon(var(--p-icon), transparent, filter('icon'));
@include recolor-icon(var(--p-icon), transparent, var(--p-icon));
}

.Item-selected &,
Expand All @@ -104,7 +110,7 @@ $nav-animation-variables: (
@include recolor-icon(
var(--p-action-primary),
transparent,
filter('action')
var(--p-icon-on-interactive)
);
}

Expand Down