mirror of
https://github.com/danog/sass-site.git
synced 2024-12-15 02:47:36 +01:00
36 lines
1.0 KiB
SCSS
36 lines
1.0 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) {
|
|
$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%;
|
|
}
|