diff --git a/UNRELEASED.md b/UNRELEASED.md index 5569c045506..259eccf7d9e 100644 --- a/UNRELEASED.md +++ b/UNRELEASED.md @@ -4,6 +4,7 @@ Use [the changelog guidelines](/documentation/Versioning%20and%20changelog.md) t ### Breaking changes +- Removed filter sass function and color-icon() mixin ([#4676](https://github.com/Shopify/polaris-react/pull/4676)) - Renamed `--p-duration-1-0-0` and `--p-duration-1-5-0` to `--p-duration-100` and `--p-duration-150`. ### Enhancements diff --git a/src/styles/_common.scss b/src/styles/_common.scss index 894a70fa23d..85124f8a350 100644 --- a/src/styles/_common.scss +++ b/src/styles/_common.scss @@ -6,7 +6,6 @@ @import './foundation/utilities'; @import './foundation/colors'; -@import './foundation/filters'; @import './foundation/spacing'; @import './foundation/border-width'; @import './foundation/borders'; diff --git a/src/styles/_public-api.scss b/src/styles/_public-api.scss index 36131fd4fad..779e36639fc 100644 --- a/src/styles/_public-api.scss +++ b/src/styles/_public-api.scss @@ -18,7 +18,6 @@ @import './foundation/utilities'; @import './foundation/colors'; -@import './foundation/filters'; @import './foundation/spacing'; @import './foundation/border-width'; @import './foundation/borders'; diff --git a/src/styles/foundation/_filters.scss b/src/styles/foundation/_filters.scss deleted file mode 100644 index 05c631c30db..00000000000 --- a/src/styles/foundation/_filters.scss +++ /dev/null @@ -1,34 +0,0 @@ -// stylelint-disable-next-line scss/partial-no-import -@import '../polaris-tokens/color-filters.color-map'; - -/// -/// Color filter data -/// -/// Shopify color filter palette, extended specifically for polaris-react. -/// -/// @type map -$color-filter-palette-data: $polaris-color-filters; - -/// Returns the filter list for a given color name and group. -/// -/// @param {String} $hue - The color’s hue. -/// @param {String} $value - The darkness/lightness of the color. Defaults to -/// base. -/// @return {List} The filter list. - -@function filter($hue, $value: base) { - $fetched-color: map-get(map-get($color-filter-palette-data, $hue), $value); - - @if map-has-key($color-filter-palette-data, $fetched-color) { - $fetched-color: map-get( - map-get($color-filter-palette-data, $fetched-color), - $value - ); - } - - @if type-of($fetched-color) == list { - @return $fetched-color; - } @else { - @error "Filter `#{$hue}, #{$value}` not found.\a Make sure arguments are strings.\a GOOD: `filter('yellow')`.\a BAD: `filter(yellow)`.\a\a Available options: #{available-names($color-filter-palette-data)}"; - } -} diff --git a/src/styles/shared/_icons.scss b/src/styles/shared/_icons.scss index 5df7bab9425..aae95dc0793 100644 --- a/src/styles/shared/_icons.scss +++ b/src/styles/shared/_icons.scss @@ -16,13 +16,3 @@ filter: $filter-color; } } - -@mixin color-icon($value, $hue: base) { - svg { - fill: color($value, $hue); - } - - img { - filter: filter($value, $hue); - } -}