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
1 change: 1 addition & 0 deletions UNRELEASED-v9.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/styles/foundation/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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)';
}
}

Expand Down
34 changes: 0 additions & 34 deletions src/styles/foundation/_utilities.scss
Original file line number Diff line number Diff line change
@@ -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.
Expand Down