Skip to content

Commit

Permalink
Update _process-collection.scss
Browse files Browse the repository at this point in the history
  • Loading branch information
woodcox authored Apr 15, 2024
1 parent 4cd0f44 commit c564862
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/generator/workers/_process-collection.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
@use 'get-namespace' as _n;
@use '../../config' as _c;

$processed-properties: (); // Define a list to store processed properties

@mixin process-collection($collection, $prefix, $selector, $is-breakpoint) {
// Check if the $collection is a map
@if meta.type-of($collection) == 'map' {
Expand All @@ -27,14 +29,14 @@

/// If this collection is using CSS vars, the items come from the
/// 'css-vars' map in $gorko-config
@if ($use-css-vars) {
@if ($use-css-vars) {
$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.
@if ($property and $items) {
@if ($property and $items and not index($processed-properties, $property)) {
@if ($output == 'responsive') {
@include _css.generate-css(
#{$prefix + $selector},
Expand All @@ -56,6 +58,7 @@
);
}
}
$processed-properties: join($processed-properties, ($property)); // Add the processed property to the list
}
// Check if the $collection is a list of maps
} @else if meta.type-of($collection) == 'list' {
Expand Down

0 comments on commit c564862

Please sign in to comment.