sass-site/source/assets/sass/components/_pop-stripe.scss
Jonny Gerig Meyer 2024442f31
lint
2023-01-12 14:54:24 -05:00

39 lines
1.1 KiB
SCSS

@use 'sass:math';
@use 'sass:list';
@use 'sass:meta';
@use '../functions';
@use '../visual-design/theme';
$sl-colors: theme.$sl-color--hopbush theme.$sl-color--bouquet
theme.$sl-color--venus theme.$sl-color--patina theme.$sl-color--nebula
theme.$sl-color--white theme.$sl-color--dawn-pink theme.$sl-color--wafer
theme.$sl-color--iron theme.$sl-color--regent-grey theme.$sl-color--pale-sky
theme.$sl-color--midnight-blue;
@function stripes($position, $sl-colors) {
/* stylelint-disable annotation-no-unknown */
$sl-colors: if(
meta.type-of($sl-colors) != 'list',
compact($sl-colors),
$sl-colors
);
/* stylelint-enable annotation-no-unknown */
$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%;
}