sugarcss 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,50 @@
|
|
|
1
|
+
@function __base-difference($list, $values) {
|
|
2
|
+
$result: ();
|
|
3
|
+
|
|
4
|
+
@each $item in $list {
|
|
5
|
+
@if not index($values, $item) {
|
|
6
|
+
$result: append($result, $item);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@return $result;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@function __difference($arguments...) {
|
|
15
|
+
$index: 1;
|
|
16
|
+
$length: length($arguments);
|
|
17
|
+
$value: null;
|
|
18
|
+
|
|
19
|
+
$break: false;
|
|
20
|
+
@while ($index <= $length and not $break) {
|
|
21
|
+
$value: nth($arguments, $index);
|
|
22
|
+
|
|
23
|
+
@if __is-list-like($value) {
|
|
24
|
+
$break: true;
|
|
25
|
+
} @else {
|
|
26
|
+
$index: $index + 1;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
$values: __base-flatten($arguments, false, true, $index + 1);
|
|
31
|
+
|
|
32
|
+
@return __base-difference($value, $values);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
/// Creates a list excluding all values of the provided lists.
|
|
37
|
+
///
|
|
38
|
+
///
|
|
39
|
+
/// @access public
|
|
40
|
+
/// @group List
|
|
41
|
+
/// @param {List} $list The list to inspect.
|
|
42
|
+
/// @param {List...} $values... The lists of values to exclude.
|
|
43
|
+
/// @returns {List} Returns the new list of filtered values.
|
|
44
|
+
/// @example scss
|
|
45
|
+
/// $foo: _difference((1, 2, 3), (4, 2));
|
|
46
|
+
/// // => (1, 3)
|
|
47
|
+
|
|
48
|
+
@function _difference($args...) {
|
|
49
|
+
@return call('__difference', $args...);
|
|
50
|
+
}
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
@function __drop($list, $n: null, $guard: false) {
|
|
2
|
+
$length: if($list, length($list), 0);
|
|
3
|
+
|
|
4
|
+
@if ($length == 0) {
|
|
5
|
+
@return ();
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
@if (if($guard, __is-iteratee-call($list, $n, $guard), ($n == null))) {
|
|
9
|
+
$n: 1;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
$n: if(__is-falsey($n), 0, if($n < 0, 0, min($n, length($list))));
|
|
13
|
+
|
|
14
|
+
@return __base-slice($list, $n);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@function __drop-right($list, $n: null, $guard: false) {
|
|
19
|
+
$length: if($list, length($list), 0);
|
|
20
|
+
|
|
21
|
+
@if ($length == 0) {
|
|
22
|
+
@return ();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@if (if($guard, __is-iteratee-call($list, $n, $guard), ($n == null))) {
|
|
26
|
+
$n: 1;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
$n: $length - if(__is-number($n), $n, if(__is-falsey($n), 0, 1));
|
|
30
|
+
|
|
31
|
+
@return __base-slice($list, 0, if($n < 0, 0, $n));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
@function __drop-right-while($list, $predicate: '__identity', $this-arg: null) {
|
|
36
|
+
$length: if($list, length($list), 0);
|
|
37
|
+
|
|
38
|
+
@if ($length == 0) {
|
|
39
|
+
@return ();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
$predicate: __get-callback($predicate, $this-arg, 3);
|
|
43
|
+
|
|
44
|
+
@while ($length > 0
|
|
45
|
+
and __is-truthy(__exec($predicate, nth($list, $length), $length, $list))) {
|
|
46
|
+
$length: $length - 1;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@return __base-slice($list, 0, $length);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
@function __drop-while($list, $predicate: '__identity', $this-arg: null) {
|
|
54
|
+
$length: if($list, length($list), 0);
|
|
55
|
+
|
|
56
|
+
@if ($length == 0) {
|
|
57
|
+
@return ();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
$index: 1;
|
|
61
|
+
|
|
62
|
+
$predicate: __get-callback($predicate, $this-arg, 3);
|
|
63
|
+
|
|
64
|
+
@while ($index <= $length
|
|
65
|
+
and __is-truthy(__exec($predicate, nth($list, $index), $index, $list))) {
|
|
66
|
+
$index: $index + 1;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@return __base-slice($list, $index - 1);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
/// Creates a slice of `$list` with `$n` elements dropped from the beginning.
|
|
74
|
+
///
|
|
75
|
+
///
|
|
76
|
+
/// @access public
|
|
77
|
+
/// @group List
|
|
78
|
+
/// @param {List} $list The list to query.
|
|
79
|
+
/// @param {number} $n [1] - The number of elements to drop.
|
|
80
|
+
/// @returns {List} Returns the slice of `$list`.
|
|
81
|
+
/// @example scss
|
|
82
|
+
/// $foo: _drop((1, 2, 3));
|
|
83
|
+
/// // => (2, 3)
|
|
84
|
+
///
|
|
85
|
+
/// $foo: _drop((1, 2, 3), 2);
|
|
86
|
+
/// // => (3,)
|
|
87
|
+
///
|
|
88
|
+
/// $foo: _drop((1, 2, 3), 5);
|
|
89
|
+
/// // => ()
|
|
90
|
+
///
|
|
91
|
+
/// $foo: _drop((1, 2, 3), 0);
|
|
92
|
+
/// // => (1, 2, 3)
|
|
93
|
+
|
|
94
|
+
@function _drop($args...) {
|
|
95
|
+
@return call('__drop', $args...);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
/// Creates a slice of `$list` with `$n` elements dropped from the end.
|
|
100
|
+
///
|
|
101
|
+
///
|
|
102
|
+
/// @access public
|
|
103
|
+
/// @group List
|
|
104
|
+
/// @param {List} $list The list to query.
|
|
105
|
+
/// @param {number} $n [1] - The number of elements to drop.
|
|
106
|
+
/// @returns {List} Returns the slice of `$list`.
|
|
107
|
+
/// @example scss
|
|
108
|
+
/// $foo: _drop-right((1, 2, 3));
|
|
109
|
+
/// // => (1, 2)
|
|
110
|
+
///
|
|
111
|
+
/// $foo: _drop-right((1, 2, 3), 2);
|
|
112
|
+
/// // => (1,)
|
|
113
|
+
///
|
|
114
|
+
/// $foo: _drop-right((1, 2, 3), 5);
|
|
115
|
+
/// // => ()
|
|
116
|
+
///
|
|
117
|
+
/// $foo: _drop-right((1, 2, 3), 0);
|
|
118
|
+
/// // => (1, 2, 3)
|
|
119
|
+
|
|
120
|
+
@function _drop-right($args...) {
|
|
121
|
+
@return call('__drop-right', $args...);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
/// Creates a slice of `$list` excluding elements dropped from the end.
|
|
126
|
+
/// Elements are dropped until `$predicate` returns falsey. The predicate is
|
|
127
|
+
/// bound to `$this-arg` and invoked with three arguments; (value, index, list).
|
|
128
|
+
///
|
|
129
|
+
/// If a property name is provided for `$predicate` the created `_property`
|
|
130
|
+
/// style callback returns the property value of the given element.
|
|
131
|
+
/// If a value is also provided for `$this-arg` the created `_matches-property`
|
|
132
|
+
/// style callback returns `true` for elements that have a matching property
|
|
133
|
+
/// value, else `false`.
|
|
134
|
+
///
|
|
135
|
+
/// If a map is provided for `$predicate` the created `_matches` style
|
|
136
|
+
/// callback returns `true` for elements that match the properties of the given
|
|
137
|
+
/// object, else `false`.
|
|
138
|
+
///
|
|
139
|
+
///
|
|
140
|
+
/// @access public
|
|
141
|
+
/// @group List
|
|
142
|
+
/// @param {List} $list - The list to query.
|
|
143
|
+
/// @param {Function|Map|String} $predicate [_identity] - The function invoked
|
|
144
|
+
/// per iteration.
|
|
145
|
+
/// @param {*} $this-arg [null] - The `_this` binding of `$predicate`.
|
|
146
|
+
/// @returns {List} Returns the slice of `$list`.
|
|
147
|
+
/// @example scss
|
|
148
|
+
/// @function greater-than-two($value, $args...) {
|
|
149
|
+
/// @return $value > 2;
|
|
150
|
+
/// }
|
|
151
|
+
///
|
|
152
|
+
/// $foo: _drop-right-while((1, 2, 3, 4), greater-than-two);
|
|
153
|
+
/// // => (1, 2)
|
|
154
|
+
///
|
|
155
|
+
/// $users: (
|
|
156
|
+
/// ( 'user': 'barney', 'active': true ),
|
|
157
|
+
/// ( 'user': 'fred', 'active': false ),
|
|
158
|
+
/// ( 'user': 'pebbles', 'active': false )
|
|
159
|
+
/// );
|
|
160
|
+
///
|
|
161
|
+
/// // using the `_matches` callback shorthand
|
|
162
|
+
/// $foo: _pluck(_drop-right-while($users, ( 'user': 'pebbles', 'active': false )), 'user');
|
|
163
|
+
/// // => ('barney', 'fred')
|
|
164
|
+
///
|
|
165
|
+
/// // using the `_matches-property` callback shorthand
|
|
166
|
+
/// $foo: _pluck(_drop-right-while($users, 'active', false), 'user');
|
|
167
|
+
/// // => ('barney')
|
|
168
|
+
///
|
|
169
|
+
/// // using the `_property` callback shorthand
|
|
170
|
+
/// $foo: _pluck(_drop-right-while($users, 'active'), 'user');
|
|
171
|
+
/// // => ('barney', 'fred', 'pebbles')
|
|
172
|
+
|
|
173
|
+
@function _drop-right-while($args...) {
|
|
174
|
+
@return call('__drop-right-while', $args...);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
/// Creates a slice of `$list` excluding elements dropped from the beginning.
|
|
179
|
+
/// Elements are dropped until `$predicate` returns falsey. The predicate is
|
|
180
|
+
/// bound to `$this-arg` and invoked with three arguments; (value, index, list).
|
|
181
|
+
/// If a property name is provided for `$predicate` the created `_property`
|
|
182
|
+
/// style callback returns the property value of the given element.
|
|
183
|
+
/// If a value is also provided for `$this-arg` the created `_matches-property`
|
|
184
|
+
/// style callback returns `true` for elements that have a matching property
|
|
185
|
+
/// value, else `false`.
|
|
186
|
+
/// If a map is provided for `$predicate` the created `_matches` style
|
|
187
|
+
/// callback returns `true` for elements that have the properties of the given
|
|
188
|
+
/// object, else `false`.
|
|
189
|
+
///
|
|
190
|
+
///
|
|
191
|
+
/// @access public
|
|
192
|
+
/// @group List
|
|
193
|
+
/// @param {List} $list - The list to query.
|
|
194
|
+
/// @param {Function|Map|String} $predicate [_identity] - The function invoked
|
|
195
|
+
/// per iteration.
|
|
196
|
+
/// @param {*} $this-arg [null] - The `_this` binding of `$predicate`.
|
|
197
|
+
/// @returns {List} Returns the slice of `$list`.
|
|
198
|
+
/// @example scss
|
|
199
|
+
/// @function less-than-three($value, $args...) {
|
|
200
|
+
/// @return $value < 3;
|
|
201
|
+
/// }
|
|
202
|
+
///
|
|
203
|
+
/// $foo: _drop-while((1, 2, 3, 4), less-than-three);
|
|
204
|
+
/// // => (3, 4)
|
|
205
|
+
///
|
|
206
|
+
/// $users: (
|
|
207
|
+
/// ( 'user': 'barney', 'active': false ),
|
|
208
|
+
/// ( 'user': 'fred', 'active': false ),
|
|
209
|
+
/// ( 'user': 'pebbles', 'active': true )
|
|
210
|
+
/// );
|
|
211
|
+
///
|
|
212
|
+
/// // using the `_matches` callback shorthand
|
|
213
|
+
/// $foo: _pluck(_drop-while($users, ( 'user': 'barney', 'active': false )), 'user');
|
|
214
|
+
/// // => ('fred', 'pebbles')
|
|
215
|
+
///
|
|
216
|
+
/// // using the `_matches-property` callback shorthand
|
|
217
|
+
/// $foo: _pluck(_drop-while($users, 'active', false), 'user');
|
|
218
|
+
/// // => ('pebbles')
|
|
219
|
+
///
|
|
220
|
+
/// // using the `_property` callback shorthand
|
|
221
|
+
/// $foo: _pluck(_drop-while($users, 'active'), 'user');
|
|
222
|
+
/// // => ('barney', 'fred', 'pebbles')
|
|
223
|
+
|
|
224
|
+
@function _drop-while($args...) {
|
|
225
|
+
@return call('__drop-while', $args...);
|
|
226
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
@function __either($this, $that: null, $predicate: '__is-truthy') {
|
|
2
|
+
$this-bool: __exec(__base-callback($predicate), $this);
|
|
3
|
+
|
|
4
|
+
@return if($this-bool, $this, $that);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/// Returns initial `$this` value unless the `$predicate` applied to
|
|
8
|
+
/// `$this` is falsey; in which case, `$that` is returned.
|
|
9
|
+
///
|
|
10
|
+
/// The `$predicate` argument can be any type of supported Sassdash
|
|
11
|
+
/// callback.
|
|
12
|
+
///
|
|
13
|
+
/// @access public
|
|
14
|
+
/// @group Utility
|
|
15
|
+
/// @param {*} $this - The target preferred value
|
|
16
|
+
/// @param {*} $that [null] - The fallback value, in case `$this` is falsey.
|
|
17
|
+
/// @param {Function} $predicate ['is-truthy'] - The predicate to
|
|
18
|
+
/// check `$this` against
|
|
19
|
+
/// @returns {*} `$this` or `$that`
|
|
20
|
+
/// @example scss
|
|
21
|
+
/// $button-bg-color: false;
|
|
22
|
+
///
|
|
23
|
+
/// $foo: _either($button-bg-color, #C0FFEE);
|
|
24
|
+
/// // => #C0FFEE
|
|
25
|
+
///
|
|
26
|
+
/// $foo: _either($button-bg-color, #C0FFEE, _is-color);
|
|
27
|
+
/// // => #C0FFEE
|
|
28
|
+
///
|
|
29
|
+
/// $button-bg-color: green;
|
|
30
|
+
///
|
|
31
|
+
/// $foo: _either($button-bg-color, #C0FFEE);
|
|
32
|
+
/// // => green
|
|
33
|
+
///
|
|
34
|
+
/// // Usage with "shifted argument" callback
|
|
35
|
+
/// $foo: _either('abcde', 'xyz', str-index 'abc');
|
|
36
|
+
/// // => 'abcde'
|
|
37
|
+
///
|
|
38
|
+
/// $foo: _either('hijkl', 'xyz', str-index 'abc');
|
|
39
|
+
/// // => 'xyz'
|
|
40
|
+
@function _either($args...) {
|
|
41
|
+
@return call('__either', $args...);
|
|
42
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
@function __encode-uri-char($char, $args...) {
|
|
4
|
+
$char-code: _char-code($char);
|
|
5
|
+
|
|
6
|
+
@if not $char-code {
|
|
7
|
+
@return $char;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@if (($char-code >= 48 and $char-code <= 57)
|
|
11
|
+
or ($char-code >= 65 and $char-code <= 90)
|
|
12
|
+
or ($char-code >= 97 and $char-code <= 122)) {
|
|
13
|
+
@return $char;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@return unquote("%#{str-slice(ie-hex-str(rgb($char-code,0,0)),4,5)}");
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@function __encode($string, $args...) {
|
|
21
|
+
@return _($string,
|
|
22
|
+
_map __encode-uri-char,
|
|
23
|
+
_join);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
/// Converts a `$string` to a URL encoding representation by converting
|
|
28
|
+
/// certain characters to their 2-digit hexadecimal equivalent,
|
|
29
|
+
/// preceded by a "%" sign.
|
|
30
|
+
///
|
|
31
|
+
/// @access public
|
|
32
|
+
/// @group String
|
|
33
|
+
/// @param {String} $string The string to encode.
|
|
34
|
+
/// @returns {String} Returns the encoded string.
|
|
35
|
+
///
|
|
36
|
+
/// @example scss
|
|
37
|
+
/// $foo: _encode('Hello world');
|
|
38
|
+
/// // => 'Hello%20world'
|
|
39
|
+
|
|
40
|
+
@function _encode($args...) {
|
|
41
|
+
@return call('__encode', $args...);
|
|
42
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
@function __ends-with($string, $target: $__undefined__, $position: str-length($string)) {
|
|
2
|
+
@if __is-undefined($target) {
|
|
3
|
+
@return false;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
$string: __base-to-string($string);
|
|
7
|
+
$target: __base-to-string($target);
|
|
8
|
+
$length: str-length($string);
|
|
9
|
+
$position: if(__is-falsey($position), 0, $position);
|
|
10
|
+
$position: min(if($position < 0, 0, $position), $length) + 1 - str-length($target);
|
|
11
|
+
|
|
12
|
+
@return if($position >= 1,
|
|
13
|
+
__string-index-of($string, $target, $position) == $position,
|
|
14
|
+
false);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@function __ends-with-any($string, $targets: (), $position: str-length($string)) {
|
|
18
|
+
$result: false;
|
|
19
|
+
$index: 1;
|
|
20
|
+
|
|
21
|
+
@while $index <= length($targets) and not $result {
|
|
22
|
+
$target-string: nth($targets, $index);
|
|
23
|
+
$result: __ends-with($string, $target-string, $position);
|
|
24
|
+
|
|
25
|
+
$index: $index + 1;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@return $result;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
/// Checks if `$string` ends with the given target string.
|
|
33
|
+
///
|
|
34
|
+
///
|
|
35
|
+
/// @access public
|
|
36
|
+
/// @group String
|
|
37
|
+
/// @param {string} $string [''] - The string to search.
|
|
38
|
+
/// @param {string} $target - The string to search for.
|
|
39
|
+
/// @param {number} $position [str-length($string)] - The position to search from.
|
|
40
|
+
/// @returns {boolean} Returns `true` if `$string` ends with `$target`, else `false`.
|
|
41
|
+
/// @example scss
|
|
42
|
+
/// $foo: _ends-with('abc', 'c');
|
|
43
|
+
/// // => true
|
|
44
|
+
///
|
|
45
|
+
/// $foo: _ends-with('abc', 'b');
|
|
46
|
+
/// // => false
|
|
47
|
+
///
|
|
48
|
+
/// $foo: _ends-with('abc', 'b', 2);
|
|
49
|
+
/// // => true
|
|
50
|
+
|
|
51
|
+
@function _ends-with($args...) {
|
|
52
|
+
@return call('__ends-with', $args...);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/// Checks if `$string` ends with any of the strings in `$targets` list.
|
|
56
|
+
///
|
|
57
|
+
///
|
|
58
|
+
/// @access public
|
|
59
|
+
/// @group String
|
|
60
|
+
/// @param {string} $string [''] - The string to search.
|
|
61
|
+
/// @param {string} $targets [()] - The list of strings to search for.
|
|
62
|
+
/// @param {number} $position [str-length($string)] - The position to search from.
|
|
63
|
+
/// @returns {boolean} Returns `true` if `$string` ends with any of the strings in `$targets`, else `false`.
|
|
64
|
+
/// @example scss
|
|
65
|
+
/// $foo: _ends-with-any('abc', 'a' 'c');
|
|
66
|
+
/// // => true
|
|
67
|
+
///
|
|
68
|
+
/// $foo: _ends-with-any('abc', 'a' 'b');
|
|
69
|
+
/// // => false
|
|
70
|
+
///
|
|
71
|
+
/// $foo: _ends-with-any('abc', 'a' 'b', 2);
|
|
72
|
+
/// // => true
|
|
73
|
+
|
|
74
|
+
@function _ends-with-any($args...) {
|
|
75
|
+
@return call('__ends-with-any', $args...);
|
|
76
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
@function __escape-string-char($char) {
|
|
2
|
+
@return '\\#{__const('string-escapes' $char)}';
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@function __escape-html-char($char) {
|
|
7
|
+
$escaped-char: __const('html-escapes' $char);
|
|
8
|
+
|
|
9
|
+
@return if($escaped-char, $escaped-char, $char);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@function __escape($string) {
|
|
14
|
+
$string: __base-to-string($string);
|
|
15
|
+
|
|
16
|
+
@each $unescaped, $escaped in __const('html-escapes') {
|
|
17
|
+
$string: __string-replace($string, $unescaped, $escaped);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@return $string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
/// Converts the characters "&", "<", ">", '"', "'", and '`', in `$string` to
|
|
25
|
+
/// their corresponding HTML entities.
|
|
26
|
+
/// **Note:** No other characters are escaped.
|
|
27
|
+
///
|
|
28
|
+
///
|
|
29
|
+
/// @access public
|
|
30
|
+
/// @group String
|
|
31
|
+
/// @param {string} $string [''] - The string to escape.
|
|
32
|
+
/// @returns {string} Returns the escaped string.
|
|
33
|
+
/// @example scss
|
|
34
|
+
/// $foo: _escape('fred, barney, & pebbles');
|
|
35
|
+
/// // => 'fred, barney, & pebbles'
|
|
36
|
+
|
|
37
|
+
@function _escape($args...) {
|
|
38
|
+
@return call('__escape', $args...);
|
|
39
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
@function __base-every-iteratee($value, $index, $collection) {
|
|
2
|
+
$predicate: __this('predicate');
|
|
3
|
+
$result: if(__is-truthy(__exec($predicate, $value, $index, $collection)), true, false);
|
|
4
|
+
$_: __this('result', $result);
|
|
5
|
+
|
|
6
|
+
@return null;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@function __base-every($collection, $predicate) {
|
|
11
|
+
$_: __scope((
|
|
12
|
+
'result': true,
|
|
13
|
+
'predicate': $predicate
|
|
14
|
+
));
|
|
15
|
+
$_: __base-each($collection, '__base-every-iteratee');
|
|
16
|
+
$result: __this('result');
|
|
17
|
+
$_: __scope(false);
|
|
18
|
+
|
|
19
|
+
@return if($result, true, false);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@function __list-every($list, $predicate) {
|
|
24
|
+
$index: 1;
|
|
25
|
+
$length: length($list);
|
|
26
|
+
|
|
27
|
+
@while ($index <= $length) {
|
|
28
|
+
$iteration: __exec($predicate, nth($list, $index), $index, $list);
|
|
29
|
+
|
|
30
|
+
@if (not __is-truthy($iteration)) {
|
|
31
|
+
@return false;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
$index: $index + 1;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@return true;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
@function __every($collection, $predicate: '__identity', $this-arg: $__undefined__) {
|
|
42
|
+
$function: if(__is-list($collection), '__list-every', '__base-every');
|
|
43
|
+
|
|
44
|
+
@if not __function-exists($predicate)
|
|
45
|
+
or not __is-undefined($this-arg) {
|
|
46
|
+
$predicate: __get-callback($predicate, $this-arg, 3);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@return __exec($function, $collection, $predicate);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
/// Checks if `$predicate` returns truthy for **all** elements of `$collection`.
|
|
54
|
+
/// The predicate is bound to `$this-arg` and invoked with three arguments:
|
|
55
|
+
/// (value, index|key, collection).
|
|
56
|
+
///
|
|
57
|
+
/// If a property name is provided for `$predicate` the created `_property`
|
|
58
|
+
/// style callback returns the property value of the given element.
|
|
59
|
+
///
|
|
60
|
+
/// If a value is also provided for `$this-arg` the created `_matches-property`
|
|
61
|
+
/// style callback returns `true` for elements that have a matching property
|
|
62
|
+
/// value, else `false`.
|
|
63
|
+
///
|
|
64
|
+
/// If a map is provided for `$predicate` the created `_matches` style
|
|
65
|
+
/// callback returns `true` for elements that have the properties of the given
|
|
66
|
+
/// object, else `false`.
|
|
67
|
+
///
|
|
68
|
+
///
|
|
69
|
+
/// @access public
|
|
70
|
+
/// @group Collection
|
|
71
|
+
/// @param {List|Map|string} $collection The collection to iterate over.
|
|
72
|
+
/// @param {Function|Map|string} $predicate [_identity] - The function invoked
|
|
73
|
+
/// per iteration.
|
|
74
|
+
/// @param {*} $this-arg [null] - The `_this` binding of `$predicate`.
|
|
75
|
+
/// @returns {boolean} Returns `true` if all elements pass the predicate check,
|
|
76
|
+
/// else `false`.
|
|
77
|
+
/// @example scss
|
|
78
|
+
/// $foo: _every((true, 1, null, 'yes'), _is-boolean);
|
|
79
|
+
/// // => false
|
|
80
|
+
///
|
|
81
|
+
/// $users: (
|
|
82
|
+
/// ( 'user': 'barney', 'active': false ),
|
|
83
|
+
/// ( 'user': 'fred', 'active': false )
|
|
84
|
+
/// );
|
|
85
|
+
///
|
|
86
|
+
/// // using the `_matches` callback shorthand
|
|
87
|
+
/// $foo: _every($users, ( 'user': 'barney', 'active': false ));
|
|
88
|
+
/// // => false
|
|
89
|
+
///
|
|
90
|
+
/// // using the `_matches-property` callback shorthand
|
|
91
|
+
/// $foo: _every($users, 'active', false);
|
|
92
|
+
/// // => true
|
|
93
|
+
///
|
|
94
|
+
/// // using the `_property` callback shorthand
|
|
95
|
+
/// $foo: _every($users, 'active');
|
|
96
|
+
/// // => false
|
|
97
|
+
|
|
98
|
+
@function _every($args...) {
|
|
99
|
+
@return call('__every', $args...);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/// @alias _every
|
|
103
|
+
|
|
104
|
+
@function _all($args...) {
|
|
105
|
+
@return call('__every', $args...);
|
|
106
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
@function __exec($function, $args...) {
|
|
2
|
+
@if function-exists($function) {
|
|
3
|
+
@return call($function, $args...);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
@return __call($function, null, $args...);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/// Dynamically calls a standard Sass function, similar to
|
|
10
|
+
/// `call($function, $args...)`, with the ability to call scoped
|
|
11
|
+
/// functions, such as those returned from Sassdash functions like
|
|
12
|
+
/// `_bind()`, `_callback()`, etc., that otherwise can't be called via `call()`.
|
|
13
|
+
///
|
|
14
|
+
/// @access public
|
|
15
|
+
/// @group Function
|
|
16
|
+
/// @param {Function} $function - The function/Sassdash callback to call.
|
|
17
|
+
/// @param {Any...} $args... - The arguments to apply to the function.
|
|
18
|
+
/// @returns {*} Returns the result of calling `$function` with the given `$args...`.
|
|
19
|
+
/// @example scss
|
|
20
|
+
/// $is-primary: _callback(('color': $color-primary));
|
|
21
|
+
///
|
|
22
|
+
/// $theme: (
|
|
23
|
+
/// 'name': 'sassdash-theme',
|
|
24
|
+
/// 'color': $color-primary
|
|
25
|
+
/// );
|
|
26
|
+
///
|
|
27
|
+
/// $foo: _exec($is-primary, $theme);
|
|
28
|
+
/// // => true
|
|
29
|
+
@function _exec($args...) {
|
|
30
|
+
@return call('__exec', $args...);
|
|
31
|
+
}
|