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 14b1388 commit d6c677a
Showing 1 changed file with 33 additions and 32 deletions.
65 changes: 33 additions & 32 deletions src/generator/workers/_process-collection.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,42 +31,31 @@

@mixin process-collection($collection, $prefix, $selector, $is-breakpoint) {
@if type-of($collection) == 'list' {

// Process each item in the list
@each $item in $collection {
// Extract values from the current collection
$items: map.get($item, "items");
@debug 'items:' $items;
$output: map.get($item, "output");
@debug 'output:' $output;
$property: map.get($item, "property");
@debug 'property:' $property;
$css-vars: map.get($item, "css-vars");
@debug 'css-var:' $css-vars;
$vars-key: '';
@each $item in $collection {
// Extract values from the current collection
$items: map.get($item, "items");
@debug 'items:' $items;
$output: map.get($item, "output");
@debug 'output:' $output;
$property: map.get($item, "property");
@debug 'property:' $property;
$css-vars: map.get($item, "css-vars");
@debug 'css-var:' $css-vars;
$vars-key: '';

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

@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 $output == 'responsive' {
@include _css.generate-css(
#{$prefix + $selector},
$property,
$items,
$use-css-vars,
$vars-key
);
@if $use-css-vars {
$vars: map-get(_c.$gorko-config, 'css-vars');
$vars-key: map-get($collection, 'items');
$items: map-get($vars, $vars-key);
}

@if $output == 'standard' {
@if not $is-breakpoint {

/// 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 $output == 'responsive' {
@include _css.generate-css(
#{$prefix + $selector},
$property,
Expand All @@ -75,6 +64,18 @@
$vars-key
);
}

@if $output == 'standard' {
@if not $is-breakpoint {
@include _css.generate-css(
#{$prefix + $selector},
$property,
$items,
$use-css-vars,
$vars-key
);
}
}
}
}
} @else if type-of($collection) == 'map' {
Expand Down

0 comments on commit d6c677a

Please sign in to comment.