diff --git a/UNRELEASED-v9.md b/UNRELEASED-v9.md index 51e362184d5..120ef5d029a 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 `available-names()` scss function ([#4967](https://github.com/Shopify/polaris-react/pull/4967)) ### New components diff --git a/src/styles/foundation/_layout.scss b/src/styles/foundation/_layout.scss index 35ef9ae5a6e..f9ca5a07768 100644 --- a/src/styles/foundation/_layout.scss +++ b/src/styles/foundation/_layout.scss @@ -53,7 +53,7 @@ $layout-width-data: ( @if type-of($fetched-value) { @return $fetched-value; } @else { - @error 'Column `#{$name} - #{$value}` not found. Available columns: #{available-names($layout-width-data)}'; + @error 'Column `#{$name} - #{$value}` not found. Available columns:\a - primary (min, max)\a - secondary (min, max)\a - one-half-width (base)\a - one-third-width (base)\a - nav (base)\a - page-with-nav (base)\a - page-content (not-condensed, partially-condensed)\a - inner-spacing (base)\a - outer-spacing (min, max)'; } } diff --git a/src/styles/foundation/_utilities.scss b/src/styles/foundation/_utilities.scss index 353c0592da1..f95daea0fdc 100644 --- a/src/styles/foundation/_utilities.scss +++ b/src/styles/foundation/_utilities.scss @@ -1,37 +1,3 @@ -/// 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.