From d8af84e755a183c089a318826a6f6cba66e6c939 Mon Sep 17 00:00:00 2001 From: aveline Date: Wed, 26 Jan 2022 14:01:49 -0800 Subject: [PATCH 1/2] Remove `map-extend` scss function and `_utilities.scss` --- src/styles/_common.scss | 1 - src/styles/_public-api.scss | 1 - src/styles/foundation/_utilities.scss | 56 --------------------------- 3 files changed, 58 deletions(-) delete mode 100644 src/styles/foundation/_utilities.scss diff --git a/src/styles/_common.scss b/src/styles/_common.scss index 466bf516a01..8bfd760bbdb 100644 --- a/src/styles/_common.scss +++ b/src/styles/_common.scss @@ -4,7 +4,6 @@ // stylelint-disable scss/partial-no-import -@import './foundation/utilities'; @import './foundation/layout'; @import './foundation/focus-ring'; @import './foundation/accessibility'; diff --git a/src/styles/_public-api.scss b/src/styles/_public-api.scss index 0b9e9fe93dd..9b2189cbf08 100644 --- a/src/styles/_public-api.scss +++ b/src/styles/_public-api.scss @@ -16,7 +16,6 @@ // stylelint-disable scss/partial-no-import -@import './foundation/utilities'; @import './foundation/layout'; @import './foundation/focus-ring'; diff --git a/src/styles/foundation/_utilities.scss b/src/styles/foundation/_utilities.scss deleted file mode 100644 index 353c0592da1..00000000000 --- a/src/styles/foundation/_utilities.scss +++ /dev/null @@ -1,56 +0,0 @@ -/// Returns the list of available names in a given map. -/// @param {Map} $map - The map of data to list the names from. -/// @param {Number} $map - The level of depth to get names from. -/// @return {String} The list of names in the map. - -@function available-names($map, $level: 1) { - @if type-of($map) != 'map' { - @return null; - } - - $output: ''; - $newline: '\A '; - - @if $level == 1 { - @each $key, $value in $map { - $output: $output + - '#{$newline}- #{$key} #{available-names($value, $level + 1)}'; - } - } @else { - $output: '('; - $i: 1; - - @each $key, $value in $map { - $sep: if($i < length($map), ', ', ''); - $output: $output + '#{$key}#{$sep}#{available-names($value, $level + 1)}'; - $i: $i + 1; - } - - $output: $output + ')'; - } - - @return $output; -} - -// Merge multiple maps into one. -// @param {Map} $map - Initial default map. -// @param {ArgList} $maps - Other maps to merge. -// @return {Map} The final merged map. -@function map-extend($map, $maps...) { - @for $i from 1 through length($maps) { - @each $key, $value in nth($maps, $i) { - $map: map-merge( - $map, - ( - $key: $value, - ) - ); - - @if type-of($value) == map and type-of(map-get($map, $key)) == map { - $value: map-extend(map-get($map, $key), $value); - } - } - } - - @return $map; -} From 3db1d412de88b11b7bccb594c92a7d4f82af314c Mon Sep 17 00:00:00 2001 From: aveline Date: Wed, 26 Jan 2022 14:19:15 -0800 Subject: [PATCH 2/2] Update UNRELEASED-v9.md --- UNRELEASED-v9.md | 1 + 1 file changed, 1 insertion(+) diff --git a/UNRELEASED-v9.md b/UNRELEASED-v9.md index f320f469294..458476d5ae9 100644 --- a/UNRELEASED-v9.md +++ b/UNRELEASED-v9.md @@ -37,6 +37,7 @@ Use [the changelog guidelines](/documentation/Versioning%20and%20changelog.md) t - Removed the ms-high-contrast-color() function and replaced any instances with values ([#4938](https://github.com/Shopify/polaris-react/pull/4938)) - Removed the `border()` scss function ([#4934](https://github.com/Shopify/polaris-react/pull/4934)) - Removed the font-family() function and replaced any instances with tokens ([#4940](https://github.com/Shopify/polaris-react/pull/4940)) +- Removed the `map-extend` scss function ([#4970](https://github.com/Shopify/polaris-react/pull/4970)) ### New components