Skip to content

Commit

Permalink
map-get to map.get
Browse files Browse the repository at this point in the history
  • Loading branch information
woodcox authored Apr 21, 2024
1 parent ccfc4e1 commit 7603e25
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

/// All variables must be defined separately
/// to the _config so that they can be overridden
/// using the _override-vars and/or _override-config.
Expand Down Expand Up @@ -48,4 +49,4 @@ $light-colors: (
$dark-colors: (
'text': map-get($gorko-colors, 'light'),
'bg': map-get($gorko-colors, 'dark')
) !default;
) !default;
16 changes: 8 additions & 8 deletions src/generator/workers/_process-collection.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@
@mixin process-collection($collection, $prefix, $selector, $is-breakpoint) {
// Check if the $collection is a map
@if meta.type-of($collection) == 'map' {
$items: map-get($collection, 'items');
$output: map-get($collection, 'output');
$property: map-get($collection, 'property');
$use-css-vars: map-get($collection, 'css-vars');
$items: map.get($collection, 'items');
$output: map.get($collection, 'output');
$property: map.get($collection, 'property');
$use-css-vars: map.get($collection, 'css-vars');
$vars-key: '';

$selector: _n.get-namespace('classes') + $selector;

/// If this collection is using CSS vars, the items come from the
/// 'css-vars' map in $gorko-config
@if ($use-css-vars) {
$vars: map-get(_c.$gorko-config, 'css-vars');
$vars-key: map-get($collection, 'items');
$items: map-get($vars, $vars-key);
$vars: map.get(_c.$gorko-config, 'css-vars');
$vars-key: map.get($collection, 'items');
$items: map.get($vars, $vars-key);
}

/// It'll only run if $items and $property aren't null. This means it'll ignore the breakpoints and design tokens, for example.
Expand Down Expand Up @@ -66,4 +66,4 @@
} @else {
@error "Invalid collection type: #{$collection}. Expected map or list of maps.";
}
}
}

0 comments on commit 7603e25

Please sign in to comment.