Skip to content

Commit

Permalink
Merge branch 'master' into sivanova/tile-manager
Browse files Browse the repository at this point in the history
  • Loading branch information
SisIvanova authored Nov 11, 2024
2 parents 855f582 + 1228c30 commit 663020a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions sass/color/_functions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,10 @@ $_enhanced-accessibility: false;
$_hsl-alpha: hsl(from $s h s l / $_alpha);
$_mix-alpha: color-mix(in oklch, $s #{$_alpha * 100%}, transparent);

@if $palette and not($contrast) {
@if $palette {
$s: map.get($palette, $color);
$base: map.get($s, $variant);
$raw: map.get($s, #{$variant}-raw);
$raw: if($contrast, map.get($s, #{$variant}-contrast), map.get($s, #{$variant}-raw));

@return if($raw and $variant != 500, rgba($raw, $_alpha), rgba($base, $_alpha));
}
Expand Down
5 changes: 3 additions & 2 deletions test/_color.spec.scss
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,11 @@ $_palette: palette(
@include assert-equal($value, hsl(from (var(--ig-secondary-A400)) h s l / 1));
}

@include it('should return a contrast shade of type string w/ palette as only argument') {
@include it('should return a contrast shade of type color w/ palette as only argument') {
$value: contrast-color($_palette, $opacity: .5);
$expected: color-mix(in oklch, var(--ig-primary-500-contrast) 50%, transparent);
$expected: rgba(0 0 0 / .5);

@include assert-equal(type-of($value), color);
@include assert-equal($expected, $value);
}

Expand Down

0 comments on commit 663020a

Please sign in to comment.