Skip to content

Commit c117e5b

Browse files
author
Airen
committed
add Zig Zag Sass mixin from @tony Banik
1 parent 0a7d73e commit c117e5b

36 files changed

+42
-0
lines changed

src/_sassMagic.scss

100644100755
File mode changed.

src/functions/_decimal.scss

100644100755
File mode changed.

src/functions/_exponent.scss

100644100755
File mode changed.

src/functions/_leastSquaresFit.scss

100644100755
File mode changed.

src/functions/_linear-interpolation.scss

100644100755
File mode changed.

src/functions/_list-remove.scss

100644100755
File mode changed.

src/functions/_list-sort.scss

100644100755
File mode changed.

src/functions/_map-sort.scss

100644100755
File mode changed.

src/functions/_mixcolor.scss

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/// 制作z字行下划线
2+
/// @param {String} $index
3+
/// @param {Number} $count
4+
/// @param {Number} $height
5+
/// @param {String} $start_color
6+
/// @param {String} $end_color
7+
/// @author Tony Banik
8+
/// @link https://codepen.io/tonybanik/pen/qMNGJZ
9+
10+
@function mixcolor($index, $count,$height,$start_color,$end_color: $start_color) {
11+
@if $end_color != $start_color {
12+
@return mix($end_color, $start_color, percentage($index / (($height * 2) * $count)));
13+
} @else {
14+
@return $start_color
15+
}
16+
}

src/functions/_number.scss

100644100755
File mode changed.

src/functions/_polygon.scss

100644100755
File mode changed.

src/functions/_unit-length.scss

100644100755
File mode changed.

src/functions/_z-index.scss

100644100755
File mode changed.

src/mixins/_angled-edges.scss

100644100755
File mode changed.

src/mixins/_animation.scss

100644100755
File mode changed.

src/mixins/_burger.scss

100644100755
File mode changed.

src/mixins/_corners.scss

100644100755
File mode changed.

src/mixins/_fade-text.scss

100644100755
File mode changed.

src/mixins/_flex-grid.scss

100644100755
File mode changed.

src/mixins/_full-width.scss

100644100755
File mode changed.

src/mixins/_haslines.scss

100644100755
File mode changed.

src/mixins/_hexi-flexi-grid.scss

100644100755
File mode changed.

src/mixins/_open-color.scss

100644100755
File mode changed.

src/mixins/_palettetown.scss

100644100755
File mode changed.

src/mixins/_plumber-box.scss

100644100755
File mode changed.

src/mixins/_plumber.scss

100644100755
File mode changed.

src/mixins/_poly-fluid-sizing.scss

100644100755
File mode changed.

src/mixins/_polygon.scss

100644100755
File mode changed.

src/mixins/_position.scss

100644100755
File mode changed.

src/mixins/_scrollbars.scss

100644100755
File mode changed.

src/mixins/_selector.scss

100644100755
File mode changed.

src/mixins/_sprite-spirit.scss

100644100755
File mode changed.

src/mixins/_sticky-footer.scss

100644100755
File mode changed.

src/mixins/_tilted.scss

100644100755
File mode changed.

src/mixins/_typographic.scss

100644100755
File mode changed.

src/mixins/_zigzag.scss

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
@mixin zigzag($count, $height, $start_color, $end_color: $start_color) {
2+
$value: 0 0 0;
3+
4+
@for $c from 0 through $count - 1 {
5+
@for $i from 1 through $height {
6+
$thiscolor: mixcolor((($c*($height*2))+$i),$count, $height, $start_color, $end_color);
7+
$value: $value, (($c*$height*2)+$i)+px ($i)+px 0 $thiscolor,
8+
}
9+
@for $i from 1 through $height{
10+
$thiscolor: mixcolor((($c*($height*2))+($i*2)),$count, $height, $start_color, $end_color);
11+
$value: $value, (($c*$height*2)+($height+$i))+px ($height - $i)+px 0 $thiscolor,
12+
}
13+
}
14+
15+
background: $start_color;
16+
margin-bottom:30px+$height;
17+
box-shadow: $value;
18+
19+
20+
&:after{
21+
content:''; display:block;
22+
width:calc(100% + #{($height*2)*$count}px);
23+
height:calc(100% + #{$height}px);
24+
}
25+
26+
}

0 commit comments

Comments
 (0)