sass-site/source/assets/sass/components/_pop-stripe.scss
2023-03-03 16:30:46 -06:00

36 lines
1.0 KiB
SCSS

@use 'sass:math';
@use 'sass:list';
@use 'sass:meta';
@use '../functions';
@use '../config/color/brand';
$sl-colors: brand.$sl-color--hopbush brand.$sl-color--bouquet
brand.$sl-color--venus brand.$sl-color--patina brand.$sl-color--nebula
brand.$sl-color--white brand.$sl-color--dawn-pink brand.$sl-color--wafer
brand.$sl-color--iron brand.$sl-color--regent-grey brand.$sl-color--pale-sky
brand.$sl-color--midnight-blue;
@function stripes($position, $sl-colors) {
$sl-colors: if(
meta.type-of($sl-colors) != 'list',
compact($sl-colors),
$sl-colors
);
$gradient: ();
$width: math.div(100%, list.length($sl-colors));
@for $i from 1 through list.length($sl-colors) {
$pop: list.nth($sl-colors, $i);
$new: $pop ($width * ($i - 1)), $pop ($width * $i);
$gradient: list.join($gradient, $new, comma);
}
@return linear-gradient($position, $gradient);
}
.sl-c-pop-stripe {
height: functions.sl-px-to-rem(4px);
background-image: stripes((to right), ($sl-colors));
background-size: 100%;
}