mirror of
https://github.com/danog/sass-site.git
synced 2024-12-13 01:47:44 +01:00
36 lines
915 B
SCSS
36 lines
915 B
SCSS
@use 'sass:math';
|
|
@use 'sass:list';
|
|
@use 'sass:meta';
|
|
@use '../functions';
|
|
@use '../config/color/brand';
|
|
|
|
$sl-colors: brand.$hopbush brand.$bouquet
|
|
brand.$venus brand.$patina brand.$nebula
|
|
brand.$white brand.$dawn-pink brand.$wafer
|
|
brand.$iron brand.$regent-grey brand.$pale-sky
|
|
brand.$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%;
|
|
}
|