sugarcss 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/sugarcss.rb +30 -0
- data/stylesheets/_sugar.scss +4 -0
- data/stylesheets/sugar/_BEM.scss +101 -0
- data/stylesheets/sugar/_animations.scss +101 -0
- data/stylesheets/sugar/_clearfix.scss +56 -0
- data/stylesheets/sugar/_colors.scss +126 -0
- data/stylesheets/sugar/_effects.scss +65 -0
- data/stylesheets/sugar/_filters.scss +67 -0
- data/stylesheets/sugar/_forms.scss +13 -0
- data/stylesheets/sugar/_functions.scss +328 -0
- data/stylesheets/sugar/_helper-classes.scss +109 -0
- data/stylesheets/sugar/_helper-functions.scss +56 -0
- data/stylesheets/sugar/_helper-mixins.scss +383 -0
- data/stylesheets/sugar/_icons.scss +21 -0
- data/stylesheets/sugar/_images.scss +150 -0
- data/stylesheets/sugar/_lists.scss +148 -0
- data/stylesheets/sugar/_medias.scss +141 -0
- data/stylesheets/sugar/_reset.scss +38 -0
- data/stylesheets/sugar/_shapes.scss +528 -0
- data/stylesheets/sugar/_sugar.scss +606 -0
- data/stylesheets/sugar/_typo.scss +849 -0
- data/stylesheets/sugar/_units.scss +120 -0
- data/stylesheets/sugar/tools/_arrow.scss +70 -0
- data/stylesheets/sugar/tools/_blank.scss +0 -0
- data/stylesheets/sugar/tools/_list.scss +103 -0
- data/stylesheets/sugar/tools/_map.scss +93 -0
- data/stylesheets/sugar/tools/_math.scss +196 -0
- data/stylesheets/sugar/tools/_string.scss +65 -0
- data/stylesheets/sugar/vendors/animatecss/_animate.scss +1474 -0
- data/stylesheets/sugar/vendors/animatecss/_base.scss +31 -0
- data/stylesheets/sugar/vendors/animatecss/attention_seekers/_bounce.scss +26 -0
- data/stylesheets/sugar/vendors/animatecss/attention_seekers/_flash.scss +14 -0
- data/stylesheets/sugar/vendors/animatecss/attention_seekers/_jello.scss +34 -0
- data/stylesheets/sugar/vendors/animatecss/attention_seekers/_pulse.scss +20 -0
- data/stylesheets/sugar/vendors/animatecss/attention_seekers/_rubberBand.scss +34 -0
- data/stylesheets/sugar/vendors/animatecss/attention_seekers/_shake.scss +18 -0
- data/stylesheets/sugar/vendors/animatecss/attention_seekers/_swing.scss +27 -0
- data/stylesheets/sugar/vendors/animatecss/attention_seekers/_tada.scss +26 -0
- data/stylesheets/sugar/vendors/animatecss/attention_seekers/_wobble.scss +36 -0
- data/stylesheets/sugar/vendors/animatecss/bouncing_entrances/_bounceIn.scss +37 -0
- data/stylesheets/sugar/vendors/animatecss/bouncing_entrances/_bounceInDown.scss +32 -0
- data/stylesheets/sugar/vendors/animatecss/bouncing_entrances/_bounceInLeft.scss +32 -0
- data/stylesheets/sugar/vendors/animatecss/bouncing_entrances/_bounceInRight.scss +32 -0
- data/stylesheets/sugar/vendors/animatecss/bouncing_entrances/_bounceInUp.scss +32 -0
- data/stylesheets/sugar/vendors/animatecss/bouncing_exits/_bounceOut.scss +20 -0
- data/stylesheets/sugar/vendors/animatecss/bouncing_exits/_bounceOutDown.scss +20 -0
- data/stylesheets/sugar/vendors/animatecss/bouncing_exits/_bounceOutLeft.scss +16 -0
- data/stylesheets/sugar/vendors/animatecss/bouncing_exits/_bounceOutRight.scss +16 -0
- data/stylesheets/sugar/vendors/animatecss/bouncing_exits/_bounceOutUp.scss +20 -0
- data/stylesheets/sugar/vendors/animatecss/fading_entrances/_fadeIn.scss +9 -0
- data/stylesheets/sugar/vendors/animatecss/fading_entrances/_fadeInDown.scss +16 -0
- data/stylesheets/sugar/vendors/animatecss/fading_entrances/_fadeInDownBig.scss +16 -0
- data/stylesheets/sugar/vendors/animatecss/fading_entrances/_fadeInLeft.scss +16 -0
- data/stylesheets/sugar/vendors/animatecss/fading_entrances/_fadeInLeftBig.scss +16 -0
- data/stylesheets/sugar/vendors/animatecss/fading_entrances/_fadeInRight.scss +16 -0
- data/stylesheets/sugar/vendors/animatecss/fading_entrances/_fadeInRightBig.scss +16 -0
- data/stylesheets/sugar/vendors/animatecss/fading_entrances/_fadeInUp.scss +16 -0
- data/stylesheets/sugar/vendors/animatecss/fading_entrances/_fadeInUpBig.scss +16 -0
- data/stylesheets/sugar/vendors/animatecss/fading_exits/_fadeOut.scss +9 -0
- data/stylesheets/sugar/vendors/animatecss/fading_exits/_fadeOutDown.scss +15 -0
- data/stylesheets/sugar/vendors/animatecss/fading_exits/_fadeOutDownBig.scss +15 -0
- data/stylesheets/sugar/vendors/animatecss/fading_exits/_fadeOutLeft.scss +15 -0
- data/stylesheets/sugar/vendors/animatecss/fading_exits/_fadeOutLeftBig.scss +15 -0
- data/stylesheets/sugar/vendors/animatecss/fading_exits/_fadeOutRight.scss +15 -0
- data/stylesheets/sugar/vendors/animatecss/fading_exits/_fadeOutRightBig.scss +15 -0
- data/stylesheets/sugar/vendors/animatecss/fading_exits/_fadeOutUp.scss +15 -0
- data/stylesheets/sugar/vendors/animatecss/fading_exits/_fadeOutUpBig.scss +15 -0
- data/stylesheets/sugar/vendors/animatecss/flippers/_flip.scss +32 -0
- data/stylesheets/sugar/vendors/animatecss/flippers/_flipInX.scss +31 -0
- data/stylesheets/sugar/vendors/animatecss/flippers/_flipInY.scss +31 -0
- data/stylesheets/sugar/vendors/animatecss/flippers/_flipOutX.scss +21 -0
- data/stylesheets/sugar/vendors/animatecss/flippers/_flipOutY.scss +21 -0
- data/stylesheets/sugar/vendors/animatecss/lightspeed/_lightSpeedIn.scss +27 -0
- data/stylesheets/sugar/vendors/animatecss/lightspeed/_lightSpeedOut.scss +16 -0
- data/stylesheets/sugar/vendors/animatecss/rotating_entrances/_rotateIn.scss +18 -0
- data/stylesheets/sugar/vendors/animatecss/rotating_entrances/_rotateInDownLeft.scss +18 -0
- data/stylesheets/sugar/vendors/animatecss/rotating_entrances/_rotateInDownRight.scss +18 -0
- data/stylesheets/sugar/vendors/animatecss/rotating_entrances/_rotateInUpLeft.scss +18 -0
- data/stylesheets/sugar/vendors/animatecss/rotating_entrances/_rotateInUpRight.scss +18 -0
- data/stylesheets/sugar/vendors/animatecss/rotating_exits/_rotateOut.scss +17 -0
- data/stylesheets/sugar/vendors/animatecss/rotating_exits/_rotateOutDownLeft.scss +17 -0
- data/stylesheets/sugar/vendors/animatecss/rotating_exits/_rotateOutDownRight.scss +17 -0
- data/stylesheets/sugar/vendors/animatecss/rotating_exits/_rotateOutUpLeft.scss +17 -0
- data/stylesheets/sugar/vendors/animatecss/rotating_exits/_rotateOutUpRight.scss +17 -0
- data/stylesheets/sugar/vendors/animatecss/sliding_entrances/_slideInDown.scss +15 -0
- data/stylesheets/sugar/vendors/animatecss/sliding_entrances/_slideInLeft.scss +15 -0
- data/stylesheets/sugar/vendors/animatecss/sliding_entrances/_slideInRight.scss +15 -0
- data/stylesheets/sugar/vendors/animatecss/sliding_entrances/_slideInUp.scss +15 -0
- data/stylesheets/sugar/vendors/animatecss/sliding_exits/_slideOutDown.scss +15 -0
- data/stylesheets/sugar/vendors/animatecss/sliding_exits/_slideOutLeft.scss +15 -0
- data/stylesheets/sugar/vendors/animatecss/sliding_exits/_slideOutRight.scss +15 -0
- data/stylesheets/sugar/vendors/animatecss/sliding_exits/_slideOutUp.scss +15 -0
- data/stylesheets/sugar/vendors/animatecss/specials/_hinge.scss +29 -0
- data/stylesheets/sugar/vendors/animatecss/specials/_rollIn.scss +18 -0
- data/stylesheets/sugar/vendors/animatecss/specials/_rollOut.scss +17 -0
- data/stylesheets/sugar/vendors/animatecss/zooming_entrances/_zoomIn.scss +15 -0
- data/stylesheets/sugar/vendors/animatecss/zooming_entrances/_zoomInDown.scss +18 -0
- data/stylesheets/sugar/vendors/animatecss/zooming_entrances/_zoomInLeft.scss +18 -0
- data/stylesheets/sugar/vendors/animatecss/zooming_entrances/_zoomInRight.scss +18 -0
- data/stylesheets/sugar/vendors/animatecss/zooming_entrances/_zoomInUp.scss +18 -0
- data/stylesheets/sugar/vendors/animatecss/zooming_exits/_zoomOut.scss +19 -0
- data/stylesheets/sugar/vendors/animatecss/zooming_exits/_zoomOutDown.scss +19 -0
- data/stylesheets/sugar/vendors/animatecss/zooming_exits/_zoomOutLeft.scss +17 -0
- data/stylesheets/sugar/vendors/animatecss/zooming_exits/_zoomOutRight.scss +17 -0
- data/stylesheets/sugar/vendors/animatecss/zooming_exits/_zoomOutUp.scss +19 -0
- data/stylesheets/sugar/vendors/cssgram/_1977.scss +16 -0
- data/stylesheets/sugar/vendors/cssgram/_aden.scss +18 -0
- data/stylesheets/sugar/vendors/cssgram/_brooklyn.scss +17 -0
- data/stylesheets/sugar/vendors/cssgram/_cssgram.scss +18 -0
- data/stylesheets/sugar/vendors/cssgram/_earlybird.scss +17 -0
- data/stylesheets/sugar/vendors/cssgram/_gingham.scss +17 -0
- data/stylesheets/sugar/vendors/cssgram/_hudson.scss +18 -0
- data/stylesheets/sugar/vendors/cssgram/_inkwell.scss +11 -0
- data/stylesheets/sugar/vendors/cssgram/_lark.scss +21 -0
- data/stylesheets/sugar/vendors/cssgram/_lofi.scss +16 -0
- data/stylesheets/sugar/vendors/cssgram/_mayfair.scss +18 -0
- data/stylesheets/sugar/vendors/cssgram/_moon.scss +21 -0
- data/stylesheets/sugar/vendors/cssgram/_nashville.scss +22 -0
- data/stylesheets/sugar/vendors/cssgram/_perpetua.scss +17 -0
- data/stylesheets/sugar/vendors/cssgram/_reyes.scss +18 -0
- data/stylesheets/sugar/vendors/cssgram/_shared.scss +29 -0
- data/stylesheets/sugar/vendors/cssgram/_toaster.scss +17 -0
- data/stylesheets/sugar/vendors/cssgram/_walden.scss +18 -0
- data/stylesheets/sugar/vendors/cssgram/_xpro2.scss +17 -0
- data/stylesheets/sugar/vendors/fontawesome/_font-awesome.scss +2019 -0
- data/stylesheets/sugar/vendors/modularscale/_modular-scale-tests.scss +74 -0
- data/stylesheets/sugar/vendors/modularscale/_modular-scale.scss +18 -0
- data/stylesheets/sugar/vendors/modularscale/modular-scale/_calc.scss +17 -0
- data/stylesheets/sugar/vendors/modularscale/modular-scale/_function-list.scss +68 -0
- data/stylesheets/sugar/vendors/modularscale/modular-scale/_function.scss +55 -0
- data/stylesheets/sugar/vendors/modularscale/modular-scale/_generate-list.scss +103 -0
- data/stylesheets/sugar/vendors/modularscale/modular-scale/_pow.scss +40 -0
- data/stylesheets/sugar/vendors/modularscale/modular-scale/_ratios.scss +20 -0
- data/stylesheets/sugar/vendors/modularscale/modular-scale/_respond.scss +49 -0
- data/stylesheets/sugar/vendors/modularscale/modular-scale/_round-px.scss +6 -0
- data/stylesheets/sugar/vendors/modularscale/modular-scale/_sort-list.scss +93 -0
- data/stylesheets/sugar/vendors/modularscale/modular-scale/_tests.scss +22 -0
- data/stylesheets/sugar/vendors/sassdash/_sassdash.scss +6 -0
- data/stylesheets/sugar/vendors/sassdash/api/_add.scss +43 -0
- data/stylesheets/sugar/vendors/sassdash/api/_after.scss +66 -0
- data/stylesheets/sugar/vendors/sassdash/api/_ary.scss +43 -0
- data/stylesheets/sugar/vendors/sassdash/api/_assign.scss +113 -0
- data/stylesheets/sugar/vendors/sassdash/api/_at.scss +50 -0
- data/stylesheets/sugar/vendors/sassdash/api/_before.scss +64 -0
- data/stylesheets/sugar/vendors/sassdash/api/_bind.scss +46 -0
- data/stylesheets/sugar/vendors/sassdash/api/_call.scss +0 -0
- data/stylesheets/sugar/vendors/sassdash/api/_callback.scss +167 -0
- data/stylesheets/sugar/vendors/sassdash/api/_case.scss +179 -0
- data/stylesheets/sugar/vendors/sassdash/api/_chunk.scss +44 -0
- data/stylesheets/sugar/vendors/sassdash/api/_compact.scss +32 -0
- data/stylesheets/sugar/vendors/sassdash/api/_compare.scss +180 -0
- data/stylesheets/sugar/vendors/sassdash/api/_concat.scss +62 -0
- data/stylesheets/sugar/vendors/sassdash/api/_constant.scss +32 -0
- data/stylesheets/sugar/vendors/sassdash/api/_context.scss +51 -0
- data/stylesheets/sugar/vendors/sassdash/api/_count-by.scss +51 -0
- data/stylesheets/sugar/vendors/sassdash/api/_create.scss +78 -0
- data/stylesheets/sugar/vendors/sassdash/api/_debug.scss +26 -0
- data/stylesheets/sugar/vendors/sassdash/api/_declare.scss +46 -0
- data/stylesheets/sugar/vendors/sassdash/api/_defaults.scss +41 -0
- data/stylesheets/sugar/vendors/sassdash/api/_difference.scss +50 -0
- data/stylesheets/sugar/vendors/sassdash/api/_drop.scss +226 -0
- data/stylesheets/sugar/vendors/sassdash/api/_either.scss +42 -0
- data/stylesheets/sugar/vendors/sassdash/api/_encode.scss +42 -0
- data/stylesheets/sugar/vendors/sassdash/api/_ends-with.scss +76 -0
- data/stylesheets/sugar/vendors/sassdash/api/_escape.scss +39 -0
- data/stylesheets/sugar/vendors/sassdash/api/_every.scss +106 -0
- data/stylesheets/sugar/vendors/sassdash/api/_exec.scss +31 -0
- data/stylesheets/sugar/vendors/sassdash/api/_extrema.scss +224 -0
- data/stylesheets/sugar/vendors/sassdash/api/_fill.scss +74 -0
- data/stylesheets/sugar/vendors/sassdash/api/_filter.scss +112 -0
- data/stylesheets/sugar/vendors/sassdash/api/_find.scss +448 -0
- data/stylesheets/sugar/vendors/sassdash/api/_first.scss +29 -0
- data/stylesheets/sugar/vendors/sassdash/api/_flatten.scss +88 -0
- data/stylesheets/sugar/vendors/sassdash/api/_flow.scss +145 -0
- data/stylesheets/sugar/vendors/sassdash/api/_for.scss +325 -0
- data/stylesheets/sugar/vendors/sassdash/api/_functions.scss +42 -0
- data/stylesheets/sugar/vendors/sassdash/api/_group-by.scss +90 -0
- data/stylesheets/sugar/vendors/sassdash/api/_has.scss +30 -0
- data/stylesheets/sugar/vendors/sassdash/api/_identity.scss +20 -0
- data/stylesheets/sugar/vendors/sassdash/api/_includes.scss +76 -0
- data/stylesheets/sugar/vendors/sassdash/api/_index-by.scss +43 -0
- data/stylesheets/sugar/vendors/sassdash/api/_index-of.scss +154 -0
- data/stylesheets/sugar/vendors/sassdash/api/_initial.scss +19 -0
- data/stylesheets/sugar/vendors/sassdash/api/_intersection.scss +59 -0
- data/stylesheets/sugar/vendors/sassdash/api/_invert.scss +48 -0
- data/stylesheets/sugar/vendors/sassdash/api/_invoke.scss +74 -0
- data/stylesheets/sugar/vendors/sassdash/api/_is-empty.scss +48 -0
- data/stylesheets/sugar/vendors/sassdash/api/_is-equal.scss +175 -0
- data/stylesheets/sugar/vendors/sassdash/api/_is-match.scss +116 -0
- data/stylesheets/sugar/vendors/sassdash/api/_is-type.scss +479 -0
- data/stylesheets/sugar/vendors/sassdash/api/_join.scss +47 -0
- data/stylesheets/sugar/vendors/sassdash/api/_keys.scss +48 -0
- data/stylesheets/sugar/vendors/sassdash/api/_last.scss +21 -0
- data/stylesheets/sugar/vendors/sassdash/api/_map.scss +265 -0
- data/stylesheets/sugar/vendors/sassdash/api/_matches.scss +85 -0
- data/stylesheets/sugar/vendors/sassdash/api/_memoize.scss +105 -0
- data/stylesheets/sugar/vendors/sassdash/api/_merge.scss +148 -0
- data/stylesheets/sugar/vendors/sassdash/api/_modify.scss +17 -0
- data/stylesheets/sugar/vendors/sassdash/api/_module.scss +111 -0
- data/stylesheets/sugar/vendors/sassdash/api/_negate.scss +42 -0
- data/stylesheets/sugar/vendors/sassdash/api/_noop.scss +19 -0
- data/stylesheets/sugar/vendors/sassdash/api/_omit.scss +52 -0
- data/stylesheets/sugar/vendors/sassdash/api/_once.scss +27 -0
- data/stylesheets/sugar/vendors/sassdash/api/_pad.scss +121 -0
- data/stylesheets/sugar/vendors/sassdash/api/_pairs.scss +26 -0
- data/stylesheets/sugar/vendors/sassdash/api/_parse-int.scss +69 -0
- data/stylesheets/sugar/vendors/sassdash/api/_partial.scss +91 -0
- data/stylesheets/sugar/vendors/sassdash/api/_partition.scss +53 -0
- data/stylesheets/sugar/vendors/sassdash/api/_pick.scss +80 -0
- data/stylesheets/sugar/vendors/sassdash/api/_pluck.scss +27 -0
- data/stylesheets/sugar/vendors/sassdash/api/_property.scss +91 -0
- data/stylesheets/sugar/vendors/sassdash/api/_pull.scss +43 -0
- data/stylesheets/sugar/vendors/sassdash/api/_push.scss +27 -0
- data/stylesheets/sugar/vendors/sassdash/api/_rand.scss +79 -0
- data/stylesheets/sugar/vendors/sassdash/api/_range.scss +59 -0
- data/stylesheets/sugar/vendors/sassdash/api/_reduce.scss +146 -0
- data/stylesheets/sugar/vendors/sassdash/api/_reject.scss +68 -0
- data/stylesheets/sugar/vendors/sassdash/api/_repeat.scss +33 -0
- data/stylesheets/sugar/vendors/sassdash/api/_replace.scss +40 -0
- data/stylesheets/sugar/vendors/sassdash/api/_rest.scss +26 -0
- data/stylesheets/sugar/vendors/sassdash/api/_result.scss +48 -0
- data/stylesheets/sugar/vendors/sassdash/api/_reverse.scss +64 -0
- data/stylesheets/sugar/vendors/sassdash/api/_rules.scss +55 -0
- data/stylesheets/sugar/vendors/sassdash/api/_sample.scss +33 -0
- data/stylesheets/sugar/vendors/sassdash/api/_shuffle.scss +37 -0
- data/stylesheets/sugar/vendors/sassdash/api/_size.scss +37 -0
- data/stylesheets/sugar/vendors/sassdash/api/_slice.scss +60 -0
- data/stylesheets/sugar/vendors/sassdash/api/_some.scss +110 -0
- data/stylesheets/sugar/vendors/sassdash/api/_sort.scss +335 -0
- data/stylesheets/sugar/vendors/sassdash/api/_sorted-index.scss +135 -0
- data/stylesheets/sugar/vendors/sassdash/api/_splice.scss +45 -0
- data/stylesheets/sugar/vendors/sassdash/api/_split.scss +43 -0
- data/stylesheets/sugar/vendors/sassdash/api/_starts-with.scss +78 -0
- data/stylesheets/sugar/vendors/sassdash/api/_sum.scss +44 -0
- data/stylesheets/sugar/vendors/sassdash/api/_take.scss +211 -0
- data/stylesheets/sugar/vendors/sassdash/api/_times.scss +33 -0
- data/stylesheets/sugar/vendors/sassdash/api/_to-list.scss +52 -0
- data/stylesheets/sugar/vendors/sassdash/api/_to-string.scss +35 -0
- data/stylesheets/sugar/vendors/sassdash/api/_trim.scss +138 -0
- data/stylesheets/sugar/vendors/sassdash/api/_trunc.scss +92 -0
- data/stylesheets/sugar/vendors/sassdash/api/_unescape.scss +48 -0
- data/stylesheets/sugar/vendors/sassdash/api/_union.scss +19 -0
- data/stylesheets/sugar/vendors/sassdash/api/_uniq.scss +86 -0
- data/stylesheets/sugar/vendors/sassdash/api/_unique-id.scss +27 -0
- data/stylesheets/sugar/vendors/sassdash/api/_unzip.scss +77 -0
- data/stylesheets/sugar/vendors/sassdash/api/_values.scss +54 -0
- data/stylesheets/sugar/vendors/sassdash/api/_where.scss +28 -0
- data/stylesheets/sugar/vendors/sassdash/api/_without.scss +26 -0
- data/stylesheets/sugar/vendors/sassdash/api/_words.scss +50 -0
- data/stylesheets/sugar/vendors/sassdash/api/_xor.scss +35 -0
- data/stylesheets/sugar/vendors/sassdash/api/_zip.scss +80 -0
- data/stylesheets/sugar/vendors/sassdash/constants/_char.scss +97 -0
- data/stylesheets/sugar/vendors/sassdash/constants/_constructor.scss +1 -0
- data/stylesheets/sugar/vendors/sassdash/constants/_escapes.scss +26 -0
- data/stylesheets/sugar/vendors/sassdash/constants/_flags.scss +9 -0
- data/stylesheets/sugar/vendors/sassdash/constants/_global.scss +11 -0
- data/stylesheets/sugar/vendors/sassdash/constants/_module.scss +9 -0
- data/stylesheets/sugar/vendors/sassdash/constants/_native.scss +80 -0
- data/stylesheets/sugar/vendors/sassdash/constants/_number.scss +26 -0
- data/stylesheets/sugar/vendors/sassdash/constants/_trunc.scss +2 -0
- data/stylesheets/sugar/vendors/sassdash/constants/_units.scss +10 -0
- data/stylesheets/sugar/vendors/sassdash/helpers/_aggregator.scss +47 -0
- data/stylesheets/sugar/vendors/sassdash/helpers/_call.scss +77 -0
- data/stylesheets/sugar/vendors/sassdash/helpers/_chain.scss +37 -0
- data/stylesheets/sugar/vendors/sassdash/helpers/_char.scss +115 -0
- data/stylesheets/sugar/vendors/sassdash/helpers/_coercion.scss +90 -0
- data/stylesheets/sugar/vendors/sassdash/helpers/_compounder.scss +25 -0
- data/stylesheets/sugar/vendors/sassdash/helpers/_module.scss +8 -0
- data/stylesheets/sugar/vendors/sassdash/helpers/_number.scss +165 -0
- data/stylesheets/sugar/vendors/sassdash/helpers/_scope.scss +43 -0
- data/stylesheets/sugar/vendors/sassdash/static/_local.scss +268 -0
- data/stylesheets/sugar/vendors/sassdash/static/_module.scss +2 -0
- data/stylesheets/sugar/vendors/sassdash/static/_static.scss +84 -0
- metadata +334 -0
@@ -0,0 +1,335 @@
|
|
1
|
+
@function __base-sort-by($list, $comparer) {
|
2
|
+
$length: length($list);
|
3
|
+
$list: __sort($list, $comparer);
|
4
|
+
$list: __to-map($list);
|
5
|
+
|
6
|
+
@while ($length > 0) {
|
7
|
+
$list: __set($list, $length, __get(__get($list, $length), 'value'));
|
8
|
+
$length: $length - 1;
|
9
|
+
}
|
10
|
+
|
11
|
+
@return __to-list($list);
|
12
|
+
}
|
13
|
+
|
14
|
+
|
15
|
+
@function __base-compare-ascending($value, $other) {
|
16
|
+
@if __is-string($value) or __is-string($other)
|
17
|
+
or __is-color($value) or __is-color($other) {
|
18
|
+
@return __string-compare-ascending($value, $other);
|
19
|
+
}
|
20
|
+
|
21
|
+
$value: if(__is-falsey($value), 0, $value);
|
22
|
+
$other: if(__is-falsey($other), 0, $other);
|
23
|
+
|
24
|
+
@if $value > $other {
|
25
|
+
@return 1;
|
26
|
+
}
|
27
|
+
|
28
|
+
@if $value < $other {
|
29
|
+
@return -1;
|
30
|
+
}
|
31
|
+
|
32
|
+
@return 0;
|
33
|
+
}
|
34
|
+
|
35
|
+
|
36
|
+
@function __string-compare-ascending($value, $other) {
|
37
|
+
@return __sort-predicate-string($value, $other, 'asc');
|
38
|
+
}
|
39
|
+
|
40
|
+
|
41
|
+
@function __compare-ascending($map, $other) {
|
42
|
+
@return __either(__base-compare-ascending(__get($map, 'criteria'), __get($other, 'criteria')), (__get($map, 'index') - __get($other, 'index')));
|
43
|
+
}
|
44
|
+
|
45
|
+
|
46
|
+
@function __compare-multiple-ascending($map, $other) {
|
47
|
+
$index: 1;
|
48
|
+
$map-criteria: __get($map, 'criteria');
|
49
|
+
$other-criteria: __get($other, 'criteria');
|
50
|
+
$length: length($map-criteria);
|
51
|
+
|
52
|
+
@while ($index <= $length) {
|
53
|
+
$result: __base-compare-ascending(nth($map-criteria, $index), nth($other-criteria, $index));
|
54
|
+
|
55
|
+
@if ($result) {
|
56
|
+
@return $result;
|
57
|
+
}
|
58
|
+
|
59
|
+
$index: $index + 1;
|
60
|
+
}
|
61
|
+
|
62
|
+
@return (__get($map, 'index') - __get($other, 'index'));
|
63
|
+
}
|
64
|
+
|
65
|
+
|
66
|
+
@function __sort-predicate-asc($first, $second) {
|
67
|
+
@if __is-string($first) or __is-string($second)
|
68
|
+
or __is-color($first) or __is-color($second) {
|
69
|
+
@return __sort-predicate-string($first, $second, 'asc');
|
70
|
+
}
|
71
|
+
|
72
|
+
@return if($first > $second, 1, if($first < $second, -1, 0));
|
73
|
+
}
|
74
|
+
|
75
|
+
|
76
|
+
@function __sort-predicate-desc($first, $second) {
|
77
|
+
@if __is-string($first) or __is-string($second)
|
78
|
+
or __is-color($first) or __is-color($second) {
|
79
|
+
@return __sort-predicate-string($first, $second, 'desc');
|
80
|
+
}
|
81
|
+
|
82
|
+
@return if($first < $second, 1, if($first > $second, -1, 0));
|
83
|
+
}
|
84
|
+
|
85
|
+
|
86
|
+
@function __sort-predicate-string($first, $second, $direction: 'asc') {
|
87
|
+
$index: 1;
|
88
|
+
$result: 0;
|
89
|
+
|
90
|
+
$first-length: str-length($first);
|
91
|
+
$second-length: str-length($second);
|
92
|
+
|
93
|
+
@while $result == 0
|
94
|
+
and $index <= $first-length
|
95
|
+
and $index <= $second-length {
|
96
|
+
$first-char-code: __char-code-at($first, 1);
|
97
|
+
$second-char-code: __char-code-at($second, 1);
|
98
|
+
|
99
|
+
$result: if($first-char-code > $second-char-code, 1, if($first-char-code < $second-char-code, -1, 0));
|
100
|
+
|
101
|
+
$index: $index + 1;
|
102
|
+
}
|
103
|
+
|
104
|
+
@if $result == 0 and $first-length != $second-length {
|
105
|
+
$result: if($first-length > $second-length, 1, if($first-length < $second-length, -1, 0))
|
106
|
+
}
|
107
|
+
|
108
|
+
@if $direction == 'desc' {
|
109
|
+
$result: $result * -1;
|
110
|
+
}
|
111
|
+
|
112
|
+
@return $result;
|
113
|
+
}
|
114
|
+
|
115
|
+
|
116
|
+
@function __sort-iteratee($value, $index, $collection, $predicate, $args...) {
|
117
|
+
@return __sort($value, $predicate);
|
118
|
+
}
|
119
|
+
|
120
|
+
|
121
|
+
@function __sort($list, $predicate: 'asc') {
|
122
|
+
$predicate-map: (
|
123
|
+
'asc': '__sort-predicate-asc',
|
124
|
+
'desc': '__sort-predicate-desc'
|
125
|
+
);
|
126
|
+
|
127
|
+
$comparison-function: __either(__get($predicate-map, $predicate), $predicate);
|
128
|
+
$less: ();
|
129
|
+
$equal: ();
|
130
|
+
$large: ();
|
131
|
+
|
132
|
+
@if length($list) > 1 {
|
133
|
+
|
134
|
+
$seed: nth($list, ceil(length($list) / 2));
|
135
|
+
|
136
|
+
@each $item in $list {
|
137
|
+
$comparison: __exec($comparison-function, $item, $seed);
|
138
|
+
|
139
|
+
@if $comparison == 0 {
|
140
|
+
$equal: append($equal, $item);
|
141
|
+
} @else if $comparison < 0 {
|
142
|
+
$less: append($less, $item);
|
143
|
+
} @else if $comparison > 0 {
|
144
|
+
$large: append($large, $item);
|
145
|
+
}
|
146
|
+
}
|
147
|
+
|
148
|
+
@return join(join(__sort($less, $predicate), $equal), __sort($large, $predicate));
|
149
|
+
}
|
150
|
+
|
151
|
+
@return $list;
|
152
|
+
}
|
153
|
+
|
154
|
+
|
155
|
+
@function __sort-by-iteratee($value, $key, $collection) {
|
156
|
+
$result: __this('result');
|
157
|
+
$iteratee: __this('iteratee');
|
158
|
+
$index: __this('index');
|
159
|
+
$result: append($result, (
|
160
|
+
'criteria': __exec($iteratee, $value, $key, $collection),
|
161
|
+
'index': $index,
|
162
|
+
'value': $value
|
163
|
+
));
|
164
|
+
$_: __this('result', $result);
|
165
|
+
$_: __this('index', $index + 1);
|
166
|
+
|
167
|
+
@return true;
|
168
|
+
}
|
169
|
+
|
170
|
+
|
171
|
+
@function __sort-by($collection, $iteratee: '__identity', $this-arg: $__undefined__) {
|
172
|
+
$index: 1;
|
173
|
+
$length: if(__is-map-like($collection), length($collection), 0);
|
174
|
+
$result: ();
|
175
|
+
|
176
|
+
@if $length == 0 {
|
177
|
+
@return $result;
|
178
|
+
}
|
179
|
+
|
180
|
+
@if (__is-truthy($this-arg) and __is-iteratee-call($collection, $iteratee, $this-arg)) {
|
181
|
+
$iteratee: null;
|
182
|
+
}
|
183
|
+
|
184
|
+
$iteratee: __get-callback($iteratee, $this-arg, 3);
|
185
|
+
$_: __scope((
|
186
|
+
'result': $result,
|
187
|
+
'iteratee': $iteratee,
|
188
|
+
'index': $index
|
189
|
+
));
|
190
|
+
$sort-by-iteratee: __bind('__sort-by-iteratee');
|
191
|
+
$_: __base-each($collection, $sort-by-iteratee);
|
192
|
+
$result: __this('result');
|
193
|
+
$_: __scope(false);
|
194
|
+
|
195
|
+
@return __base-sort-by($result, '__compare-ascending');
|
196
|
+
}
|
197
|
+
|
198
|
+
|
199
|
+
@function __sort-by-all-iteratee($value, $key, $collection) {
|
200
|
+
$props: __this('props');
|
201
|
+
$result: __this('result');
|
202
|
+
$index: __this('index');
|
203
|
+
$length: length($props);
|
204
|
+
$criteria: ();
|
205
|
+
|
206
|
+
@while ($length > 0) {
|
207
|
+
$criteria: __set($criteria, $length, if($value == null, $__undefined__, __get($value, __get($props, $length))));
|
208
|
+
$length: $length - 1;
|
209
|
+
}
|
210
|
+
|
211
|
+
$criteria: __to-list($criteria);
|
212
|
+
$result: append($result, (
|
213
|
+
'criteria': $criteria,
|
214
|
+
'index': $index,
|
215
|
+
'value': $value
|
216
|
+
));
|
217
|
+
$_: __this('result', $result);
|
218
|
+
$_: __this('index', $index + 1);
|
219
|
+
|
220
|
+
@return true;
|
221
|
+
}
|
222
|
+
|
223
|
+
|
224
|
+
@function __sort-by-all($arguments...) {
|
225
|
+
$collection: nth($arguments, 1);
|
226
|
+
$args: $arguments;
|
227
|
+
|
228
|
+
@if (length($args) > 3 and __is-iteratee-call(nth($args, 2), nth($args, 3), nth($args, 4))) {
|
229
|
+
$args: ($collection, nth($args, 2));
|
230
|
+
}
|
231
|
+
|
232
|
+
$index: 1;
|
233
|
+
$length: if($collection, length($collection), 0);
|
234
|
+
$props: __base-flatten($args, false, false, 1);
|
235
|
+
$result: ();
|
236
|
+
|
237
|
+
$_: __scope((
|
238
|
+
'props': $props,
|
239
|
+
'result': $result,
|
240
|
+
'index': $index
|
241
|
+
));
|
242
|
+
$iteratee: __bind('__sort-by-all-iteratee');
|
243
|
+
$_: __base-each($collection, $iteratee);
|
244
|
+
$result: __this('result');
|
245
|
+
$_: __scope(false);
|
246
|
+
|
247
|
+
@return __base-sort-by($result, '__compare-multiple-ascending');
|
248
|
+
}
|
249
|
+
|
250
|
+
|
251
|
+
/// Sorts elements of a list by `$predicate`
|
252
|
+
/// and returns a new list with the sorted elements.
|
253
|
+
///
|
254
|
+
/// @access public
|
255
|
+
/// @group List
|
256
|
+
/// @param {List} $list The list to sort.
|
257
|
+
/// @param {Function|String} $predicate ['asc'] The predicate used for comparison.
|
258
|
+
/// @returns {List} Returns sorted list.
|
259
|
+
/// @example scss
|
260
|
+
/// $foo: _sort(3 1 4 2 6 5 8 7 9);
|
261
|
+
/// // => 1 2 3 4 5 6 7 8 9
|
262
|
+
///
|
263
|
+
/// $foo: _sort(3 1 4 2 6 5 8 7 9, 'desc');
|
264
|
+
/// // => 9 8 7 6 5 4 3 2 1
|
265
|
+
|
266
|
+
@function _sort($args...) {
|
267
|
+
@return call('__sort', $args...);
|
268
|
+
}
|
269
|
+
|
270
|
+
|
271
|
+
/// Creates a list of elements, sorted in ascending order by the results of
|
272
|
+
/// running each element in a collection through `$iteratee`. This method performs
|
273
|
+
/// a stable sort, that is, it preserves the original sort order of equal elements.
|
274
|
+
///
|
275
|
+
/// The `$iteratee` is bound to `$this-arg` and invoked with three arguments;
|
276
|
+
/// (value, index|key, collection).
|
277
|
+
///
|
278
|
+
/// If a property name is provided for `$predicate` the created `_property`
|
279
|
+
/// style callback returns the property value of the given element.
|
280
|
+
///
|
281
|
+
/// If a value is also provided for `$this-arg` the created `_matches-property`
|
282
|
+
/// style callback returns `true` for elements that have a matching property
|
283
|
+
/// value, else `false`.
|
284
|
+
///
|
285
|
+
/// If a map is provided for `$predicate` the created `_matches` style
|
286
|
+
/// callback returns `true` for elements that have the properties of the given
|
287
|
+
/// object, else `false`.
|
288
|
+
///
|
289
|
+
///
|
290
|
+
/// @access public
|
291
|
+
/// @group Collection
|
292
|
+
/// @param {List|Map|string} $collection The collection to iterate over.
|
293
|
+
/// @param {List|Function|Map|string} $iteratee [_identity] - The function
|
294
|
+
/// invoked per iteration. If a property name or a map is provided it is
|
295
|
+
/// used to create a `_property` or `_matches` style callback respectively.
|
296
|
+
/// @param {*} $this-arg [null] - The `_this` binding of `$iteratee`.
|
297
|
+
/// @returns {List} Returns the new sorted list.
|
298
|
+
/// @example scss
|
299
|
+
/// $users: (
|
300
|
+
/// ( 'user': 'fred' ),
|
301
|
+
/// ( 'user': 'pebbles' ),
|
302
|
+
/// ( 'user': 'barney' )
|
303
|
+
/// );
|
304
|
+
/// // using the `_property` callback shorthand
|
305
|
+
/// $foo: _pluck(_sort-by($users, 'user'), 'user');
|
306
|
+
/// // => ('barney', 'fred', 'pebbles')
|
307
|
+
|
308
|
+
@function _sort-by($args...) {
|
309
|
+
@return call('__sort-by', $args...);
|
310
|
+
}
|
311
|
+
|
312
|
+
|
313
|
+
/// This method is like `_sort-by` except that it sorts by property names
|
314
|
+
/// instead of an iteratee function.
|
315
|
+
///
|
316
|
+
///
|
317
|
+
/// @access public
|
318
|
+
/// @group Collection
|
319
|
+
/// @param {List|Map|string} $collection The collection to iterate over.
|
320
|
+
/// @param {String...|List(String)} $props The property names to sort by,
|
321
|
+
/// specified as individual property names or lists of property names.
|
322
|
+
/// @returns {List} Returns the new sorted list.
|
323
|
+
/// @example scss
|
324
|
+
/// $users: (
|
325
|
+
/// ( 'user': 'barney', 'age': 36 ),
|
326
|
+
/// ( 'user': 'fred', 'age': 40 ),
|
327
|
+
/// ( 'user': 'barney', 'age': 26 ),
|
328
|
+
/// ( 'user': 'fred', 'age': 30 )
|
329
|
+
/// );
|
330
|
+
/// $foo: _map(_sort-by-all($users, ('user', 'age')), _values);
|
331
|
+
/// // => (('barney', 26), ('barney', 36), ('fred', 30), ('fred', 40))
|
332
|
+
|
333
|
+
@function _sort-by-all($args...) {
|
334
|
+
@return call('__sort-by-all', $args...);
|
335
|
+
}
|
@@ -0,0 +1,135 @@
|
|
1
|
+
@function __sorted-index($list, $value, $iteratee: '__identity', $this-arg: null) {
|
2
|
+
$function: __get-callback($iteratee);
|
3
|
+
|
4
|
+
@return if($function == __base-callback and $iteratee == null,
|
5
|
+
__binary-index($list, $value),
|
6
|
+
__binary-index-by($list, $value, __exec($function, $iteratee, $this-arg, 1)));
|
7
|
+
}
|
8
|
+
|
9
|
+
|
10
|
+
@function __sorted-last-index($list, $value, $iteratee: '__identity', $this-arg: null) {
|
11
|
+
$function: __get-callback($iteratee);
|
12
|
+
|
13
|
+
@return if($function == __base-callback and $iteratee == null,
|
14
|
+
__binary-index($list, $value),
|
15
|
+
__binary-index-by($list, $value, __exec($function, $iteratee, $this-arg, 1), true));
|
16
|
+
}
|
17
|
+
|
18
|
+
|
19
|
+
@function __binary-index($list, $value, $ret-highest: false, $args...) {
|
20
|
+
$low: 0;
|
21
|
+
$high: if($list, length($list), $low);
|
22
|
+
|
23
|
+
@if __is-number($value) {
|
24
|
+
@while ($low < $high) {
|
25
|
+
$mid: floor(($low + $high) / 2);
|
26
|
+
$computed: nth($list, $mid);
|
27
|
+
|
28
|
+
@if (if($ret-highest, ($computed <= $value), ($computed < $value))) {
|
29
|
+
$low: $mid + 1;
|
30
|
+
} @else {
|
31
|
+
$high: $mid;
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
35
|
+
@return $high;
|
36
|
+
}
|
37
|
+
|
38
|
+
@return __binary-index-by($list, $value, '__identity', $ret-highest);
|
39
|
+
}
|
40
|
+
|
41
|
+
|
42
|
+
@function __binary-index-by($list, $value, $iteratee, $ret-highest: false) {
|
43
|
+
$value: __exec($iteratee, $value);
|
44
|
+
|
45
|
+
$low: 0;
|
46
|
+
$high: if($list, length($list), 0);
|
47
|
+
$val-is-undefined: ($value == null);
|
48
|
+
|
49
|
+
@while ($low < $high) {
|
50
|
+
$mid: floor(($low + $high) / 2);
|
51
|
+
$computed: __exec($iteratee, nth($list, $mid));
|
52
|
+
|
53
|
+
@if ($val-is-undefined) {
|
54
|
+
$set-low: ($ret-highest > 0 or not ($computed == null));
|
55
|
+
} @else {
|
56
|
+
$set-low: if($ret-highest > 0, ($computed <= $value), ($computed < $value));
|
57
|
+
}
|
58
|
+
|
59
|
+
@if ($set-low) {
|
60
|
+
$low: $mid + 1;
|
61
|
+
} @else {
|
62
|
+
$high: $mid;
|
63
|
+
}
|
64
|
+
}
|
65
|
+
|
66
|
+
@return min($high, __const('MAX_LIST_INDEX'));
|
67
|
+
}
|
68
|
+
|
69
|
+
|
70
|
+
/// Uses a binary search to determine the lowest index at which `$value` should
|
71
|
+
/// be inserted into `$list` in order to maintain its sort order. If an iteratee
|
72
|
+
/// function is provided it is invoked for `$value` and each element of `$list`
|
73
|
+
/// to compute their sort ranking. The iteratee is bound to `$this-arg` and
|
74
|
+
/// invoked with one argument; (value).
|
75
|
+
///
|
76
|
+
/// If a property name is provided for `$predicate` the created `_property`
|
77
|
+
/// style callback returns the property value of the given element.
|
78
|
+
///
|
79
|
+
/// If a value is also provided for `$this-arg` the created `_matches-property`
|
80
|
+
/// style callback returns `true` for elements that have a matching property
|
81
|
+
/// value, else `false`.
|
82
|
+
///
|
83
|
+
/// If a map is provided for `$predicate` the created `_matches` style
|
84
|
+
/// callback returns `true` for elements that have the properties of the given
|
85
|
+
/// object, else `false`.
|
86
|
+
///
|
87
|
+
///
|
88
|
+
/// @access public
|
89
|
+
/// @group List
|
90
|
+
/// @param {List} $list The sorted list to inspect.
|
91
|
+
/// @param {*} $value The value to evaluate.
|
92
|
+
/// @param {Function|Map|string} $iteratee [_identity] - The function invoked
|
93
|
+
/// per iteration.
|
94
|
+
/// @param {*} $this-arg [NULL] - The `_this` binding of `$iteratee`.
|
95
|
+
/// @returns {number} Returns the index at which `$value` should be inserted
|
96
|
+
/// into `$list`.
|
97
|
+
/// @example scss
|
98
|
+
/// $foo: _sorted-index((30, 50), 40);
|
99
|
+
/// // => 2
|
100
|
+
///
|
101
|
+
/// $foo: _sorted-index((4, 4, 5, 5), 5);
|
102
|
+
/// // => 3
|
103
|
+
///
|
104
|
+
/// $dict: { 'data': { 'thirty': 30, 'forty': 40, 'fifty': 50 } };
|
105
|
+
///
|
106
|
+
/// // using the `_property` callback shorthand
|
107
|
+
/// $foo: _sorted-index((( 'x': 30 ), ( 'x': 50 )), ( 'x': 40 ), 'x');
|
108
|
+
/// // => 2
|
109
|
+
|
110
|
+
@function _sorted-index($args...) {
|
111
|
+
@return call('__sorted-index', $args...);
|
112
|
+
}
|
113
|
+
|
114
|
+
|
115
|
+
/// This method is like `_sorted-index` except that it returns the highest
|
116
|
+
/// index at which `$value` should be inserted into `$list` in order to
|
117
|
+
/// maintain its sort order.
|
118
|
+
///
|
119
|
+
///
|
120
|
+
/// @access public
|
121
|
+
/// @group List
|
122
|
+
/// @param {List} $list The sorted list to inspect.
|
123
|
+
/// @param {*} $value The value to evaluate.
|
124
|
+
/// @param {Function|Map|string} $iteratee [_identity] - The function invoked
|
125
|
+
/// per iteration.
|
126
|
+
/// @param {*} $this-arg [null] - The `_this` binding of `$iteratee`.
|
127
|
+
/// @returns {number} Returns the index at which `$value` should be inserted
|
128
|
+
/// into `$list`.
|
129
|
+
/// @example scss
|
130
|
+
/// $foo: _sorted-last-index((4, 4, 5, 5), 5);
|
131
|
+
/// // => 5
|
132
|
+
|
133
|
+
@function _sorted-last-index($args...) {
|
134
|
+
@return call('__sorted-last-index', $args...);
|
135
|
+
}
|
@@ -0,0 +1,45 @@
|
|
1
|
+
@function __splice($list, $start, $delete-count: 1, $items...) {
|
2
|
+
$length: length($list);
|
3
|
+
$result: ();
|
4
|
+
$index: 1;
|
5
|
+
|
6
|
+
// @return false;
|
7
|
+
|
8
|
+
@while $index < $start {
|
9
|
+
$result: append($result, nth($list, $index));
|
10
|
+
$index: $index + 1;
|
11
|
+
}
|
12
|
+
|
13
|
+
@each $item in $items {
|
14
|
+
$result: append($result, $item);
|
15
|
+
}
|
16
|
+
|
17
|
+
$index: $start + $delete-count;
|
18
|
+
|
19
|
+
@while $index <= $length {
|
20
|
+
$result: append($result, nth($list, $index));
|
21
|
+
$index: $index + 1;
|
22
|
+
}
|
23
|
+
|
24
|
+
@return $result;
|
25
|
+
}
|
26
|
+
|
27
|
+
|
28
|
+
/// Removes items from a `$list` and adds new items in their place.
|
29
|
+
/// Similar to the native JavaScript [splice() function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice).
|
30
|
+
///
|
31
|
+
/// @access public
|
32
|
+
/// @group List
|
33
|
+
/// @param {List} $list - List to splice.
|
34
|
+
/// @param {Number} $start - Index to start changing the list.
|
35
|
+
/// @param {Number} $delete-count [1] - Number of list items to remove.
|
36
|
+
/// @param {Any...} $items... - Items to add to the lsit.
|
37
|
+
/// @example scss
|
38
|
+
/// $margin: 10px 3px 5px 20px;
|
39
|
+
///
|
40
|
+
/// $margin: _splice($margin, 2, 2, 15px);
|
41
|
+
/// // => 10px 15px 20px
|
42
|
+
|
43
|
+
@function _splice($args...) {
|
44
|
+
@return call('__splice', $args...);
|
45
|
+
}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
@function __string-split($string, $delimiter: '', $guard: null, $args...) {
|
2
|
+
@if $guard and __is-iteratee-call($string, $delimiter, $guard) {
|
3
|
+
$delimiter: '';
|
4
|
+
}
|
5
|
+
|
6
|
+
$string: __to-string($string);
|
7
|
+
|
8
|
+
@if not $delimiter
|
9
|
+
or str-length($delimiter) == 0
|
10
|
+
or $delimiter == '' {
|
11
|
+
@return __to-list($string);
|
12
|
+
}
|
13
|
+
|
14
|
+
$delimiter-index: str-index($string, $delimiter);
|
15
|
+
|
16
|
+
@if not $delimiter-index {
|
17
|
+
@return append((), $string);
|
18
|
+
}
|
19
|
+
|
20
|
+
@return join(
|
21
|
+
str-slice($string, 1, $delimiter-index - 1),
|
22
|
+
__string-split(
|
23
|
+
str-slice($string, $delimiter-index + str-length($delimiter)),
|
24
|
+
$delimiter
|
25
|
+
)
|
26
|
+
);
|
27
|
+
}
|
28
|
+
|
29
|
+
|
30
|
+
/// Splits a string from indexes of `$delimiter` to a list.
|
31
|
+
///
|
32
|
+
/// @access public
|
33
|
+
/// @group String
|
34
|
+
/// @param {String} $string - String to split.
|
35
|
+
/// @param {String} $delimiter [null] - Characters to use for separating the `$string`.
|
36
|
+
/// @returns {List} Returns list of substrings from split `$string`.
|
37
|
+
/// @example scss
|
38
|
+
/// $foo: _split('a--b--c--d--e', '--');
|
39
|
+
/// // => 'a' 'b' 'c' 'd' 'e'
|
40
|
+
|
41
|
+
@function _split($args...) {
|
42
|
+
@return call('__string-split', $args...);
|
43
|
+
}
|
@@ -0,0 +1,78 @@
|
|
1
|
+
@function __starts-with($string, $target, $position: 1) {
|
2
|
+
@if __is-list-like($target) {
|
3
|
+
$result: false;
|
4
|
+
|
5
|
+
@each $target-string in $target {
|
6
|
+
$result: __either($result, __starts-with($string, $target-string, $position));
|
7
|
+
}
|
8
|
+
|
9
|
+
@return $result;
|
10
|
+
}
|
11
|
+
|
12
|
+
$string: __base-to-string($string);
|
13
|
+
$target: __base-to-string($target);
|
14
|
+
$position: if(__is-falsey($position), 0, $position);
|
15
|
+
$position: min(if($position <= 0, 1, $position), str-length($string));
|
16
|
+
|
17
|
+
@return if($target == '',
|
18
|
+
true,
|
19
|
+
__string-last-index-of($string, $target, $position) == $position);
|
20
|
+
}
|
21
|
+
|
22
|
+
@function __starts-with-any($string, $targets: (), $position: 1) {
|
23
|
+
$result: false;
|
24
|
+
$index: 1;
|
25
|
+
|
26
|
+
@while $index <= length($targets) and not $result {
|
27
|
+
$target-string: nth($targets, $index);
|
28
|
+
$result: __starts-with($string, $target-string, $position);
|
29
|
+
|
30
|
+
$index: $index + 1;
|
31
|
+
}
|
32
|
+
|
33
|
+
@return $result;
|
34
|
+
}
|
35
|
+
|
36
|
+
/// Checks if `$string` starts with the given target string.
|
37
|
+
///
|
38
|
+
///
|
39
|
+
/// @access public
|
40
|
+
/// @group String
|
41
|
+
/// @param {string} $string [''] - The string to search.
|
42
|
+
/// @param {string} $target - The string to search for.
|
43
|
+
/// @param {number} $position [1] - The position to search from.
|
44
|
+
/// @returns {boolean} Returns `true` if `$string` starts with `$target`, else `false`.
|
45
|
+
/// @example scss
|
46
|
+
/// $foo: _starts-with('abc', 'a');
|
47
|
+
/// // => true
|
48
|
+
///
|
49
|
+
/// $foo: _starts-with('abc', 'b');
|
50
|
+
/// // => false
|
51
|
+
///
|
52
|
+
/// $foo: _starts-with('abc', 'b', 1);
|
53
|
+
/// // => true
|
54
|
+
|
55
|
+
@function _starts-with($args...) {
|
56
|
+
@return call('__starts-with', $args...);
|
57
|
+
}
|
58
|
+
|
59
|
+
/// Checks if `$string` starts with any of the strings in `$targets` list.
|
60
|
+
///
|
61
|
+
///
|
62
|
+
/// @access public
|
63
|
+
/// @group String
|
64
|
+
/// @param {string} $string [''] - The string to search.
|
65
|
+
/// @param {string} $targets [()] - The list of strings to search for.
|
66
|
+
/// @param {number} $position [1] - The position to search from.
|
67
|
+
/// @returns {boolean} Returns `true` if `$string` starts with any of the strings in `$targets`, else `false`.
|
68
|
+
/// @example scss
|
69
|
+
/// $foo: _starts-with-any('abc', 'a' 'b');
|
70
|
+
/// // => true
|
71
|
+
/// $foo: _starts-with-any('abc', 'b' 'c');
|
72
|
+
/// // => false
|
73
|
+
/// $foo: _starts-with-any('abc', 'b' 'c', 1);
|
74
|
+
/// // => true
|
75
|
+
|
76
|
+
@function _starts-with-any($args...) {
|
77
|
+
@return call('__starts-with-any', $args...);
|
78
|
+
}
|
@@ -0,0 +1,44 @@
|
|
1
|
+
|
2
|
+
@function __sum($collection, $iteratee: '__identity', $this-arg: null, $args...) {
|
3
|
+
@if $this-arg and __is-iteratee-call($collection, $iteratee, $this-arg) {
|
4
|
+
$iteratee: '__identity';
|
5
|
+
$this-arg: null;
|
6
|
+
}
|
7
|
+
|
8
|
+
$collection: __to-list($collection);
|
9
|
+
|
10
|
+
$iteratee: __get-callback($iteratee, $this-arg, 3);
|
11
|
+
$length: length($collection);
|
12
|
+
$result: 0;
|
13
|
+
|
14
|
+
@while $length > 0 {
|
15
|
+
$value: __parse-float(__exec($iteratee, nth($collection, $length)));
|
16
|
+
|
17
|
+
$value: __either($value, 0);
|
18
|
+
|
19
|
+
$result: $result + $value;
|
20
|
+
|
21
|
+
$length: $length - 1;
|
22
|
+
}
|
23
|
+
|
24
|
+
@return $result;
|
25
|
+
}
|
26
|
+
|
27
|
+
|
28
|
+
///
|
29
|
+
/// Gets the sum of the values in `$collection`.
|
30
|
+
///
|
31
|
+
/// @access public
|
32
|
+
/// @group Math
|
33
|
+
/// @param {Array|Object|string} $collection The collection to iterate over.
|
34
|
+
/// @returns {number} Returns the sum.
|
35
|
+
/// @example scss
|
36
|
+
/// $foo: _sum(4 6 2);
|
37
|
+
/// // => 12
|
38
|
+
///
|
39
|
+
/// $foo: _sum(('a': 4, 'b': 6, 'c': 2));
|
40
|
+
/// // => 12
|
41
|
+
|
42
|
+
@function _sum($args...) {
|
43
|
+
@return call('__sum', $args...);
|
44
|
+
}
|