sass-site/source/assets/sass/components/_pop-stripe.scss

31 lines
913 B
SCSS
Raw Normal View History

2023-01-09 20:10:02 +01:00
$sl-colors: $sl-color--hopbush $sl-color--bouquet $sl-color--venus
$sl-color--patina $sl-color--nebula $sl-color--white $sl-color--dawn-pink
$sl-color--wafer $sl-color--iron $sl-color--regent-grey $sl-color--pale-sky
$sl-color--midnight-blue;
2023-01-06 22:40:29 +01:00
@function stripes($position, $sl-colors) {
2023-01-09 23:19:15 +01:00
/* stylelint-disable annotation-no-unknown */
2023-01-09 20:10:02 +01:00
$sl-colors: if(
type-of($sl-colors) != 'list',
compact($sl-colors),
$sl-colors
);
2023-01-09 23:19:15 +01:00
/* stylelint-enable annotation-no-unknown */
2023-01-06 22:40:29 +01:00
$gradient: compact();
2023-01-09 20:10:02 +01:00
$width: 100% / length($sl-colors);
2023-01-06 22:40:29 +01:00
@for $i from 1 through length($sl-colors) {
2023-01-09 20:10:02 +01:00
$pop: nth($sl-colors, $i);
$new: $pop ($width * ($i - 1)), $pop ($width * $i);
2023-01-06 22:40:29 +01:00
$gradient: join($gradient, $new, comma);
}
@return linear-gradient($position, $gradient);
}
.sl-c-pop-stripe {
height: sl-px-to-rem(4px);
background-image: stripes((to right), ($sl-colors));
background-size: 100%;
}