doggystyle 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +16 -0
- data/.hound.yml +5 -0
- data/.npmignore +18 -0
- data/.ruby-version +1 -0
- data/.scss-lint.yml +243 -0
- data/.travis.yml +5 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +40 -0
- data/RELEASING.md +1 -0
- data/Rakefile +9 -0
- data/bin/doggystyle +5 -0
- data/bower.json +38 -0
- data/circle.yml +13 -0
- data/core/_imports.scss +229 -0
- data/core/animations/_jump.scss +7 -0
- data/core/animations/_shake.scss +24 -0
- data/core/animations/_wobble.scss +8 -0
- data/core/functions/_mobile-first.scss +3 -0
- data/core/functions/_opposite-direction.scss +45 -0
- data/core/functions/casts/_to-bool.scss +19 -0
- data/core/functions/casts/_to-color.scss +74 -0
- data/core/functions/casts/_to-list.scss +38 -0
- data/core/functions/casts/_to-map.scss +27 -0
- data/core/functions/casts/_to-null.scss +15 -0
- data/core/functions/casts/_to-number.scss +66 -0
- data/core/functions/casts/_to-string.scss +15 -0
- data/core/functions/colours/_colour-contrast.scss +61 -0
- data/core/functions/colours/_colour.scss +69 -0
- data/core/functions/colours/_random-colour.scss +78 -0
- data/core/functions/lists/_contains.scss +62 -0
- data/core/functions/lists/_first.scss +19 -0
- data/core/functions/lists/_insert-nth.scss +37 -0
- data/core/functions/lists/_last.scss +11 -0
- data/core/functions/lists/_merge.scss +30 -0
- data/core/functions/lists/_prepend.scss +11 -0
- data/core/functions/lists/_remove-nth.scss +53 -0
- data/core/functions/lists/_remove.scss +30 -0
- data/core/functions/lists/_replace-nth.scss +55 -0
- data/core/functions/lists/_replace.scss +36 -0
- data/core/functions/lists/_reverse.scss +31 -0
- data/core/functions/lists/_second.scss +19 -0
- data/core/functions/lists/_shift.scss +24 -0
- data/core/functions/lists/_slice.scss +52 -0
- data/core/functions/lists/_sort.scss +51 -0
- data/core/functions/maps/_map-deep-get.scss +51 -0
- data/core/functions/maps/_map-deep-set.scss +34 -0
- data/core/functions/maps/_map-depth.scss +23 -0
- data/core/functions/maps/_map-extend.scss +47 -0
- data/core/functions/maps/_map-has-keys.scss +23 -0
- data/core/functions/maps/_map-has-nested-keys.scss +24 -0
- data/core/functions/maps/_map-set.scss +4 -0
- data/core/functions/maps/_map-zip.scss +50 -0
- data/core/functions/numbers/_add-unit.scss +54 -0
- data/core/functions/numbers/_pad.scss +16 -0
- data/core/functions/numbers/_spacer.scss +16 -0
- data/core/functions/numbers/_strip.scss +29 -0
- data/core/functions/numbers/_units.scss +17 -0
- data/core/functions/svg/_dots.scss +84 -0
- data/core/functions/svg/_fake-radius.scss +131 -0
- data/core/functions/svg/_lines.scss +76 -0
- data/core/functions/svg/_svg.scss +12 -0
- data/core/functions/text/_smart-lineheight.scss +13 -0
- data/core/functions/text/_string-explode.scss +45 -0
- data/core/functions/text/_string-replace.scss +38 -0
- data/core/helpers/_custom-elements.scss +114 -0
- data/core/helpers/_eases.scss +44 -0
- data/core/helpers/_reset.scss +282 -0
- data/core/helpers/_show-breakpoints.scss +25 -0
- data/core/helpers/_strings.scss +648 -0
- data/core/helpers/_warnings.scss +3 -0
- data/core/helpers/checks/_check.scss +69 -0
- data/core/helpers/checks/_is-absolute-length.scss +25 -0
- data/core/helpers/checks/_is-angel.scss +25 -0
- data/core/helpers/checks/_is-arglist.scss +11 -0
- data/core/helpers/checks/_is-bool.scss +23 -0
- data/core/helpers/checks/_is-calc.scss +11 -0
- data/core/helpers/checks/_is-colour.scss +23 -0
- data/core/helpers/checks/_is-dark.scss +14 -0
- data/core/helpers/checks/_is-duration.scss +15 -0
- data/core/helpers/checks/_is-false.scss +13 -0
- data/core/helpers/checks/_is-first-character.scss +11 -0
- data/core/helpers/checks/_is-frequency.scss +15 -0
- data/core/helpers/checks/_is-function.scss +44 -0
- data/core/helpers/checks/_is-integer.scss +15 -0
- data/core/helpers/checks/_is-length.scss +16 -0
- data/core/helpers/checks/_is-light.scss +14 -0
- data/core/helpers/checks/_is-list.scss +11 -0
- data/core/helpers/checks/_is-map.scss +11 -0
- data/core/helpers/checks/_is-null.scss +11 -0
- data/core/helpers/checks/_is-number.scss +19 -0
- data/core/helpers/checks/_is-percentage.scss +13 -0
- data/core/helpers/checks/_is-position.scss +16 -0
- data/core/helpers/checks/_is-pseudo.scss +24 -0
- data/core/helpers/checks/_is-relative-length.scss +25 -0
- data/core/helpers/checks/_is-resolution.scss +15 -0
- data/core/helpers/checks/_is-selector.scss +3 -0
- data/core/helpers/checks/_is-string.scss +11 -0
- data/core/helpers/checks/_is-time.scss +15 -0
- data/core/helpers/checks/_is-unit.scss +16 -0
- data/core/helpers/private/_arglist-to-list.scss +36 -0
- data/core/helpers/private/_brightness.scss +13 -0
- data/core/helpers/private/_find-digits.scss +41 -0
- data/core/helpers/private/_find-integer.scss +40 -0
- data/core/helpers/private/_from-hex.scss +48 -0
- data/core/helpers/private/_from-hsl.scss +55 -0
- data/core/helpers/private/_from-rgb.scss +55 -0
- data/core/helpers/private/_get-color-value.scss +26 -0
- data/core/helpers/private/_hash-fix.scss +15 -0
- data/core/helpers/private/_hex-to-dec.scss +28 -0
- data/core/helpers/private/_length.scss +26 -0
- data/core/helpers/private/_lightness.scss +15 -0
- data/core/helpers/private/_list-items-to-strings.scss +8 -0
- data/core/helpers/private/_min-max-number.scss +12 -0
- data/core/helpers/private/_pow.scss +29 -0
- data/core/helpers/private/_string-compare.scss +38 -0
- data/core/helpers/private/_string-explode.scss +43 -0
- data/core/helpers/private/_sudo.scss +23 -0
- data/core/helpers/symbols/_arrows.scss +337 -0
- data/core/helpers/symbols/_block.scss +97 -0
- data/core/helpers/symbols/_box.scss +385 -0
- data/core/helpers/symbols/_common.scss +101 -0
- data/core/helpers/symbols/_currency.scss +82 -0
- data/core/helpers/symbols/_dingbats.scss +565 -0
- data/core/helpers/symbols/_geometric.scss +289 -0
- data/core/helpers/symbols/_letterlike.scss +235 -0
- data/core/helpers/symbols/_misc.scss +568 -0
- data/core/helpers/symbols/_operators.scss +766 -0
- data/core/helpers/symbols/_punctuation.scss +214 -0
- data/core/mixins/_align.scss +15 -0
- data/core/mixins/_animate.scss +16 -0
- data/core/mixins/_aspect-ratio.scss +86 -0
- data/core/mixins/_backface-visibility.scss +7 -0
- data/core/mixins/_background-image.scss +13 -0
- data/core/mixins/_blend.scss +10 -0
- data/core/mixins/_blendmodes.scss +24 -0
- data/core/mixins/_border-radius.scss +105 -0
- data/core/mixins/_browsers.scss +155 -0
- data/core/mixins/_bulletpoint.scss +12 -0
- data/core/mixins/_center.scss +3 -0
- data/core/mixins/_clearfix.scss +7 -0
- data/core/mixins/_columns.scss +22 -0
- data/core/mixins/_custom-property.scss +15 -0
- data/core/mixins/_devices.scss +97 -0
- data/core/mixins/_dropdown.scss +38 -0
- data/core/mixins/_fake-radius.scss +99 -0
- data/core/mixins/_filters.scss +163 -0
- data/core/mixins/_flip.scss +11 -0
- data/core/mixins/_font-face.scss +11 -0
- data/core/mixins/_fontsize.scss +126 -0
- data/core/mixins/_gallery.scss +134 -0
- data/core/mixins/_gradient.scss +72 -0
- data/core/mixins/_image-size.scss +18 -0
- data/core/mixins/_image.scss +12 -0
- data/core/mixins/_inputs.scss +18 -0
- data/core/mixins/_keyframes.scss +8 -0
- data/core/mixins/_last.scss +5 -0
- data/core/mixins/_nth-last.scss +7 -0
- data/core/mixins/_nth.scss +10 -0
- data/core/mixins/_placeholder.scss +15 -0
- data/core/mixins/_prefixer.scss +55 -0
- data/core/mixins/_selection.scss +15 -0
- data/core/mixins/_shadow.scss +7 -0
- data/core/mixins/_size.scss +13 -0
- data/core/mixins/_smart-horizontal.scss +21 -0
- data/core/mixins/_sudo-image.scss +12 -0
- data/core/mixins/_text-shadow.scss +30 -0
- data/core/mixins/_transforms.scss +264 -0
- data/core/mixins/_transition.scss +189 -0
- data/core/mixins/_triangle-classic.scss +170 -0
- data/core/mixins/_triangle.scss +250 -0
- data/core/mixins/_unwrap.scss +5 -0
- data/core/mixins/_user-select.scss +5 -0
- data/core/mixins/_vertical.scss +10 -0
- data/core/mixins/columns/_columns.scss +92 -0
- data/core/mixins/flexbox/_flex-container.scss +201 -0
- data/core/mixins/flexbox/_flex-grid.scss +235 -0
- data/core/mixins/flexbox/_flex-items.scss +140 -0
- data/core/mixins/flexbox/_flex-remove.scss +12 -0
- data/core/mixins/grid/_break-between.scss +6 -0
- data/core/mixins/grid/_grid.scss +150 -0
- data/core/mixins/svg/_svg-size.scss +4 -0
- data/core/mixins/svg/_svg.scss +9 -0
- data/core/placeholders/_clear.scss +27 -0
- data/core/placeholders/_cursor.scss +35 -0
- data/core/placeholders/_misc.scss +20 -0
- data/core/placeholders/_rendering.scss +21 -0
- data/core/placeholders/_text.scss +41 -0
- data/core/settings/_colours.scss +30 -0
- data/core/settings/_directories.scss +7 -0
- data/core/settings/_global.scss +14 -0
- data/core/settings/_grid.scss +24 -0
- data/core/settings/_padding.scss +8 -0
- data/core/settings/_spacing.scss +8 -0
- data/core/settings/_text.scss +13 -0
- data/doggystyle.gemspec +29 -0
- data/eyeglass-exports.js +7 -0
- data/features/install.feature +29 -0
- data/features/step_definitions/doggystyle_steps.rb +31 -0
- data/features/support/bourbon_support.rb +19 -0
- data/features/support/env.rb +1 -0
- data/features/update.feature +30 -0
- data/features/version.feature +5 -0
- data/index.js +7 -0
- data/lib/doggystyle.rb +7 -0
- data/lib/doggystyle/generator.rb +81 -0
- data/lib/doggystyle/version.rb +3 -0
- data/package.json +33 -0
- data/spec/doggystyle/library/border_color_spec.rb +51 -0
- data/spec/doggystyle/library/border_radius_spec.rb +25 -0
- data/spec/doggystyle/library/border_style_spec.rb +51 -0
- data/spec/doggystyle/library/border_width_spec.rb +51 -0
- data/spec/doggystyle/library/buttons_spec.rb +53 -0
- data/spec/doggystyle/library/clearfix_spec.rb +18 -0
- data/spec/doggystyle/library/contrast_switch_spec.rb +23 -0
- data/spec/doggystyle/library/ellipsis_spec.rb +20 -0
- data/spec/doggystyle/library/font_face_spec_1.rb +16 -0
- data/spec/doggystyle/library/font_face_spec_2.rb +21 -0
- data/spec/doggystyle/library/font_face_spec_3.rb +16 -0
- data/spec/doggystyle/library/font_face_spec_4.rb +17 -0
- data/spec/doggystyle/library/font_stacks_spec.rb +40 -0
- data/spec/doggystyle/library/hide_text_spec.rb +17 -0
- data/spec/doggystyle/library/hide_visually_spec.rb +35 -0
- data/spec/doggystyle/library/margin_spec.rb +51 -0
- data/spec/doggystyle/library/modular_scale_spec.rb +43 -0
- data/spec/doggystyle/library/padding_spec.rb +51 -0
- data/spec/doggystyle/library/position_spec.rb +67 -0
- data/spec/doggystyle/library/prefixer_spec.rb +34 -0
- data/spec/doggystyle/library/shade_spec.rb +31 -0
- data/spec/doggystyle/library/size_spec.rb +31 -0
- data/spec/doggystyle/library/strip_unit_spec.rb +31 -0
- data/spec/doggystyle/library/text_inputs_spec.rb +75 -0
- data/spec/doggystyle/library/tint_spec.rb +31 -0
- data/spec/doggystyle/library/triangle_spec.rb +31 -0
- data/spec/doggystyle/library/word_wrap_spec.rb +29 -0
- data/spec/doggystyle/utilities/assign_inputs_spec.rb +50 -0
- data/spec/doggystyle/utilities/collapse_directionals.rb +25 -0
- data/spec/doggystyle/utilities/directional_values_spec.rb +21 -0
- data/spec/doggystyle/utilities/font_source_declaration_spec.rb +29 -0
- data/spec/doggystyle/utilities/retrieve_bourbon_setting_spec.rb +31 -0
- data/spec/doggystyle/utilities/unpack_spec.rb +32 -0
- data/spec/doggystyle/validators/contains_spec.rb +27 -0
- data/spec/doggystyle/validators/is_length_spec.rb +49 -0
- data/spec/doggystyle/validators/is_light_spec.rb +37 -0
- data/spec/doggystyle/validators/is_number_spec.rb +43 -0
- data/spec/doggystyle/validators/is_size_spec.rb +43 -0
- data/spec/fixtures/_setup.scss +1 -0
- data/spec/fixtures/library/border-color.scss +26 -0
- data/spec/fixtures/library/border-radius.scss +17 -0
- data/spec/fixtures/library/border-style.scss +21 -0
- data/spec/fixtures/library/border-width.scss +21 -0
- data/spec/fixtures/library/buttons.scss +17 -0
- data/spec/fixtures/library/clearfix.scss +5 -0
- data/spec/fixtures/library/contrast-switch.scss +9 -0
- data/spec/fixtures/library/ellipsis.scss +5 -0
- data/spec/fixtures/library/font-face-1.scss +6 -0
- data/spec/fixtures/library/font-face-2.scss +10 -0
- data/spec/fixtures/library/font-face-3.scss +8 -0
- data/spec/fixtures/library/font-face-4.scss +7 -0
- data/spec/fixtures/library/font-stacks.scss +41 -0
- data/spec/fixtures/library/hide-text.scss +5 -0
- data/spec/fixtures/library/hide-visually.scss +9 -0
- data/spec/fixtures/library/margin.scss +21 -0
- data/spec/fixtures/library/modular-scale.scss +29 -0
- data/spec/fixtures/library/padding.scss +21 -0
- data/spec/fixtures/library/position.scss +25 -0
- data/spec/fixtures/library/prefixer.scss +13 -0
- data/spec/fixtures/library/shade.scss +17 -0
- data/spec/fixtures/library/size.scss +13 -0
- data/spec/fixtures/library/strip-unit.scss +17 -0
- data/spec/fixtures/library/text-inputs.scss +21 -0
- data/spec/fixtures/library/tint.scss +17 -0
- data/spec/fixtures/library/triangle.scss +9 -0
- data/spec/fixtures/library/word-wrap.scss +9 -0
- data/spec/fixtures/utilities/assign-inputs.scss +19 -0
- data/spec/fixtures/utilities/collapse-directionals.scss +17 -0
- data/spec/fixtures/utilities/directional-values.scss +13 -0
- data/spec/fixtures/utilities/font-source-declaration.scss +11 -0
- data/spec/fixtures/utilities/retrieve-bourbon-setting.scss +16 -0
- data/spec/fixtures/utilities/unpack.scss +17 -0
- data/spec/fixtures/validators/contains.scss +28 -0
- data/spec/fixtures/validators/is-length.scss +35 -0
- data/spec/fixtures/validators/is-light.scss +29 -0
- data/spec/fixtures/validators/is-number.scss +31 -0
- data/spec/fixtures/validators/is-size.scss +31 -0
- data/spec/spec_helper.rb +22 -0
- data/spec/support/matchers/have_rule.rb +35 -0
- data/spec/support/matchers/have_ruleset.rb +20 -0
- data/spec/support/matchers/have_value.rb +17 -0
- data/spec/support/parser_support.rb +16 -0
- data/spec/support/sass_support.rb +10 -0
- metadata +527 -0
@@ -0,0 +1,72 @@
|
|
1
|
+
@mixin gradient($args...) {
|
2
|
+
background-image: -webkit-linear-gradient($args);
|
3
|
+
background-image: -o-linear-gradient($args);
|
4
|
+
background-image: linear-gradient($args);
|
5
|
+
}
|
6
|
+
|
7
|
+
@mixin gradient-right($start-colour:white, $end-colour:black, $direction:left) {
|
8
|
+
@include gradient-horizontal($start-colour, $end-colour, $direction);
|
9
|
+
}
|
10
|
+
|
11
|
+
@mixin gradient-left($start-colour:white, $end-colour:black, $direction:right) {
|
12
|
+
@include gradient-horizontal($start-colour, $end-colour, $direction);
|
13
|
+
}
|
14
|
+
|
15
|
+
@mixin gradient-top($start-colour:white, $end-colour:black, $direction:top) {
|
16
|
+
@include gradient-vertical($start-colour, $end-colour, $direction);
|
17
|
+
}
|
18
|
+
|
19
|
+
@mixin gradient-bottom($start-colour:white, $end-colour:black, $direction:bottom) {
|
20
|
+
@include gradient-vertical($start-colour, $end-colour, $direction);
|
21
|
+
}
|
22
|
+
|
23
|
+
@mixin gradient-directional($start-colour:white, $end-colour:black, $deg:45) {
|
24
|
+
background-repeat: repeat-x;
|
25
|
+
background-image: -webkit-linear-gradient(addUnit($deg, deg), $start-colour, $end-colour);
|
26
|
+
background-image: -o-linear-gradient(addUnit($deg, deg), $start-colour, $end-colour);
|
27
|
+
background-image: linear-gradient(addUnit($deg, deg), $start-colour, $end-colour);
|
28
|
+
}
|
29
|
+
|
30
|
+
@mixin gradient-horizontal($args...) {
|
31
|
+
$properties : _gradient-properties($args...);
|
32
|
+
|
33
|
+
// $properties : @if(contains($properties, left right), to $properties, $properties);
|
34
|
+
|
35
|
+
background-image: -webkit-linear-gradient(#{$properties}); // Safari 5.1-6, Chrome 10+
|
36
|
+
background-image: -o-linear-gradient(#{$properties}); // Opera 12
|
37
|
+
background-image: linear-gradient(#{$properties}); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+
|
38
|
+
background-repeat: repeat-x;
|
39
|
+
}
|
40
|
+
|
41
|
+
@mixin gradient-vertical($args...) {
|
42
|
+
$properties : _gradient-properties($args...);
|
43
|
+
|
44
|
+
// $properties : @if(contains($properties, left right), to $properties, $properties);
|
45
|
+
|
46
|
+
background-image: -webkit-linear-gradient(#{$properties}); // Safari 5.1-6, Chrome 10+
|
47
|
+
background-image: -o-linear-gradient(#{$properties}); // Opera 12
|
48
|
+
background-image: linear-gradient(#{$properties}); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+
|
49
|
+
background-repeat: repeat-x;
|
50
|
+
}
|
51
|
+
|
52
|
+
@mixin gradient-radial($args...) {
|
53
|
+
$properties : _gradient-properties($args...);
|
54
|
+
|
55
|
+
background: -webkit-radial-gradient(#{$properties});
|
56
|
+
background: -o-radial-gradient(#{$properties});
|
57
|
+
background: -moz-radial-gradient(#{$properties});
|
58
|
+
background: radial-gradient(#{$properties});
|
59
|
+
background-repeat: no-repeat;
|
60
|
+
}
|
61
|
+
|
62
|
+
@function _gradient-properties($args...) {
|
63
|
+
$properties : ();
|
64
|
+
|
65
|
+
$args: if(length($args) > 0, $args, null);
|
66
|
+
|
67
|
+
@for $i from 1 through length($args) {
|
68
|
+
$properties : append($properties, nth($args, $i), comma);
|
69
|
+
}
|
70
|
+
|
71
|
+
@return $properties;
|
72
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
// WARNING: Compass used Ruby to support certain functions. imageHeight and imageWidth were dependant on this.
|
2
|
+
|
3
|
+
// Set width and height using image dimensions. You can also attribute max or min too.
|
4
|
+
// Note: Image url's are relative to the image directory set in your config.rb file.
|
5
|
+
@mixin image-size($img, $property:null) {
|
6
|
+
@if $property == null {
|
7
|
+
// Set image width and height as normal
|
8
|
+
height:imageHeight($img); width:imageWidth($img);
|
9
|
+
} @else if $property == half {
|
10
|
+
// Set the width and height, but half the actual output. Ideal if you're using x2 resolution images for retina screens.
|
11
|
+
height:imageHeight($img, half); width:imageWidth($img, half);
|
12
|
+
} @else if (str-index(#{$property}, "%")) {
|
13
|
+
// Use the width and height, but only as a defiend percentage
|
14
|
+
height:imageHeight($img, $property); width:imageWidth($img, $property);
|
15
|
+
} @else {
|
16
|
+
#{$property}-height:imageHeight($img); #{$property}-width:imageWidth($img);
|
17
|
+
}
|
18
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
// Insert image into background, and change the size of the element to the image size too.
|
2
|
+
@mixin image($img, $responsive:true, $property:null){
|
3
|
+
@include background-image($img); display:block;
|
4
|
+
@if ($responsive) {
|
5
|
+
@include aspect-ratio($img);
|
6
|
+
@include image-size($img, "max");
|
7
|
+
background-size:100%;
|
8
|
+
} @else {
|
9
|
+
background-size:100% auto;
|
10
|
+
@include image-size($img, $property);
|
11
|
+
}
|
12
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
// Style up all sorts of text input fields
|
2
|
+
|
3
|
+
@mixin input-text($types:color date datetime datetime-local email month number password search tel text time url week textarea) {
|
4
|
+
|
5
|
+
$new-list:();
|
6
|
+
|
7
|
+
@each $type in $types {
|
8
|
+
@if $type == textarea {
|
9
|
+
$new-list: append($new-list, textarea, comma);
|
10
|
+
} @else {
|
11
|
+
$new-list: append($new-list, #{'input[type=' + $type + ']'}, comma);
|
12
|
+
}
|
13
|
+
}
|
14
|
+
#{$new-list} {
|
15
|
+
font-size:$fs;
|
16
|
+
@content;
|
17
|
+
}
|
18
|
+
}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
@mixin keyframes($animationName) {
|
2
|
+
@at-root (without: media) {
|
3
|
+
@-webkit-keyframes #{$animationName} { @content; }
|
4
|
+
@-moz-keyframes #{$animationName} { @content; }
|
5
|
+
@-o-keyframes #{$animationName} { @content; }
|
6
|
+
@keyframes #{$animationName} { @content; }
|
7
|
+
}
|
8
|
+
}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
@mixin nth($nth:1, $repeat:null) {
|
2
|
+
// TODO: Make is so you can add an array of nth numbers so you can target specific items by number, e.g. @include nth((1,2,5,6,8)) { ... }
|
3
|
+
@if ($repeat == true) {
|
4
|
+
// Repeat this for every instance. So if repeat is trye, and nth is 3, the @content will be assigned to every third element.
|
5
|
+
&:nth-of-type(#{$nth + n + "+" + $nth}) { @content }
|
6
|
+
} @else {
|
7
|
+
// Only apply the @content to one specific element.
|
8
|
+
&:nth-of-type(#{$nth}) { @content }
|
9
|
+
}
|
10
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
// Place holder animation
|
2
|
+
@mixin placeholder($colour:#a9a9a9) {
|
3
|
+
|
4
|
+
$placeholders: ":-webkit-input" ":-moz" "-moz" "-ms-input";
|
5
|
+
@each $placeholder in $placeholders {
|
6
|
+
&:focus:#{$placeholder}-placeholder {
|
7
|
+
color:transparent; @content;
|
8
|
+
}
|
9
|
+
|
10
|
+
&:#{$placeholder}-placeholder {
|
11
|
+
color:$colour; @include ani(color);
|
12
|
+
}
|
13
|
+
}
|
14
|
+
|
15
|
+
}
|
@@ -0,0 +1,55 @@
|
|
1
|
+
$vendors : webkit moz ms o;
|
2
|
+
|
3
|
+
/// Prefix a property with a given vendor type
|
4
|
+
///
|
5
|
+
/// @author Mark Notton
|
6
|
+
///
|
7
|
+
/// @access public
|
8
|
+
///
|
9
|
+
/// @param {String} $properties - Property string that will get prefixed
|
10
|
+
/// @param {String} $value - Value string
|
11
|
+
/// @param {List | String} $prefixes - optional - Define the vendor prefixes you want to use
|
12
|
+
/// Only vendors in the $vendors variable will be allowed.
|
13
|
+
/// Add 'only' if you want to exclude a non-prefixed property
|
14
|
+
/// Add 'all' if you want to use all the vendors in the $vendors variable
|
15
|
+
/// @param {Bool} $important - If true, an important tag will be added to the end of each value;
|
16
|
+
///
|
17
|
+
/// @require {Mixin} contains
|
18
|
+
/// @require {Mixin} list-remove
|
19
|
+
/// @require {Variable} $vendors
|
20
|
+
///
|
21
|
+
/// @example scss - Usage
|
22
|
+
/// .foo { @include prefixer(height, 100px); }
|
23
|
+
/// .bar { @include prefixer(height, 200px, webkit only, true); }
|
24
|
+
///
|
25
|
+
/// @example css - CSS output
|
26
|
+
/// .foo {
|
27
|
+
/// -webkit-height: 100px;
|
28
|
+
/// -moz-height: 100px;
|
29
|
+
/// height: 100px;
|
30
|
+
/// }
|
31
|
+
///
|
32
|
+
/// .bar { -webkit-height: 200px !important; }
|
33
|
+
///
|
34
|
+
@mixin prefixer($properties, $value, $prefixes:webkit moz, $important:false) {
|
35
|
+
|
36
|
+
$prefixes : if($prefixes == all, $vendors, $prefixes);
|
37
|
+
$strict : false;
|
38
|
+
|
39
|
+
@if contains($prefixes, only) {
|
40
|
+
$prefixes: remove($prefixes, only);
|
41
|
+
$strict : true;
|
42
|
+
}
|
43
|
+
|
44
|
+
@each $property in $properties {
|
45
|
+
@each $prefix in $prefixes {
|
46
|
+
|
47
|
+
@if index($vendors, $prefix) {
|
48
|
+
#{"-" + $prefix + "-" + $property}: $value if($important == true, $imp, null);
|
49
|
+
}
|
50
|
+
}
|
51
|
+
@if not $strict {
|
52
|
+
#{$property}: $value if($important == true, $imp, null);
|
53
|
+
}
|
54
|
+
}
|
55
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
@mixin selection($background-color:$selection, $text-colour:$background-color) {
|
2
|
+
@if ($text-colour == null or $text-colour == $background-color) {
|
3
|
+
$text-colour:colour-contrast($background-color);
|
4
|
+
}
|
5
|
+
::-moz-selection {
|
6
|
+
color: $text-colour;
|
7
|
+
background: col($background-color 0.5);
|
8
|
+
@content;
|
9
|
+
}
|
10
|
+
::selection {
|
11
|
+
color: $text-colour;
|
12
|
+
background: col($background-color 0.5);
|
13
|
+
@content;
|
14
|
+
}
|
15
|
+
}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
// Shadow
|
2
|
+
@mixin shadow($height:5, $width:100%, $strength:0.2, $gap:0, $sudo:before) {
|
3
|
+
&:#{$sudo} { content:""; position:absolute; top:100%; left:0; margin-top:$gap#{px}; width:$width; height:$height#{px}; opacity:$strength;
|
4
|
+
background: $svg-gradient-shadow no-repeat top left / 100% 100%;
|
5
|
+
@content;
|
6
|
+
}
|
7
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/// Sets the width and height to the same values
|
2
|
+
/// If the second para "special" is defined as min or max, the dimenstions will be prefixed with that
|
3
|
+
@mixin size($sizes, $special:null) {
|
4
|
+
$prefix : null;
|
5
|
+
$width: first($sizes);
|
6
|
+
@if contains($special, (min, max)) {
|
7
|
+
$prefix : $special + "-";
|
8
|
+
}
|
9
|
+
|
10
|
+
$height : check($special, check(second($sizes), first($sizes)));
|
11
|
+
#{$prefix}width: addUnit($width);
|
12
|
+
#{$prefix}height: addUnit($height);
|
13
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
@mixin smart-horizontal($width, $gutter:$pad, $break:null) {
|
2
|
+
$gutter : if($gutter == 0, null, $gutter);
|
3
|
+
$max-width : $width;
|
4
|
+
$width : if(is-null($gutter), 100%, calc(100% - #{$gutter*2}));
|
5
|
+
$margin-left : if(is-null($gutter), #{- addUnit($max-width/2)}, calc(0% - #{addUnit($max-width/2)} - #{addUnit($gutter)}));
|
6
|
+
$left1 : if(is-null($gutter), 50%, calc(50% + #{addUnit($gutter)}));
|
7
|
+
$left2 : if(is-null($gutter), 0, addUnit($gutter));
|
8
|
+
$break : if(is-null($break), if(is-null($gutter), $max-width, $max-width + $gutter*2), $break);
|
9
|
+
|
10
|
+
position:absolute;
|
11
|
+
width:$width;
|
12
|
+
max-width:addUnit($max-width);
|
13
|
+
left:$left1;
|
14
|
+
margin-left:$margin-left;
|
15
|
+
@include ani(left margin-left);
|
16
|
+
@include break($break) {
|
17
|
+
left:$left2;
|
18
|
+
margin-left:0;
|
19
|
+
}
|
20
|
+
@content;
|
21
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
@mixin sudo-image($image, $size, $sudo:before) {
|
2
|
+
&#{_sudo($sudo)} {
|
3
|
+
content:"";
|
4
|
+
position:absolute;
|
5
|
+
top:0; left:0;
|
6
|
+
background:url($image-url + $image) center center / 100% 100% no-repeat;
|
7
|
+
@include aspect-ratio($size, null);
|
8
|
+
@include size(100%);
|
9
|
+
@include size($size, max);
|
10
|
+
@content;
|
11
|
+
}
|
12
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
/// Text Shadow
|
2
|
+
/// @param {Size} $x [2px] - X
|
3
|
+
/// @param {Size} $y [2px] - Y
|
4
|
+
/// @param {Size} $blur [2px] - Blur
|
5
|
+
/// @param {Color} $color [rgba(0,0,0,.4)] - Color
|
6
|
+
|
7
|
+
@mixin text-shadow($x: 0px, $y: 0px, $blur: 5px, $color: rgba(0,0,0,0.4)) {
|
8
|
+
@include prefixer(text-shadow, addUnit($x) addUnit($y) addUnit($blur) $color);
|
9
|
+
}
|
10
|
+
|
11
|
+
|
12
|
+
/// Box Shadow
|
13
|
+
/// @param {Size} $x [2px] - X
|
14
|
+
/// @param {Size} $y [2px] - Y
|
15
|
+
/// @param {Size} $blur [2px] - Blur
|
16
|
+
/// @param {Color} $color [rgba(0,0,0,.4)] - Color
|
17
|
+
|
18
|
+
@mixin box-shadow($x: 0px, $y: 0px, $blur: 5px, $color: rgba(0,0,0,0.4)) {
|
19
|
+
@include prefixer(box-shadow, addUnit($x) addUnit($y) addUnit($blur) $color);
|
20
|
+
}
|
21
|
+
|
22
|
+
/// Box Inner Shadow
|
23
|
+
/// @param {Size} $x [2px] - X
|
24
|
+
/// @param {Size} $y [2px] - Y
|
25
|
+
/// @param {Size} $blur [2px] - Blur
|
26
|
+
/// @param {Color} $color [rgba(0,0,0,.4)] - Color
|
27
|
+
|
28
|
+
@mixin box-inner-shadow($x: 0px, $y: 0px, $blur: 5px, $color: rgba(0,0,0,0.4)) {
|
29
|
+
@include prefixer(box-shadow, inset addUnit($x) addUnit($y) addUnit($blur) $color);
|
30
|
+
}
|
@@ -0,0 +1,264 @@
|
|
1
|
+
// Transform types
|
2
|
+
$transform-types : matrix translate translateX translateY scale scaleX scaleY rotate skew skewX skewY matrix3d translate3d translateZ scale3d scaleZ rotate3d rotateX rotateY rotateZ perspective;
|
3
|
+
|
4
|
+
// Transform values
|
5
|
+
$transform-values : inherit initial unset none;
|
6
|
+
|
7
|
+
/// Transforms mixin that allows various syntax's
|
8
|
+
///
|
9
|
+
/// @author Mark Notton
|
10
|
+
///
|
11
|
+
/// @access public
|
12
|
+
///
|
13
|
+
/// @param {Map} $settings - Each argument should consist of a transform type and it's value
|
14
|
+
///
|
15
|
+
/// @require {variable} transform-types
|
16
|
+
/// @require {variable} transform-values
|
17
|
+
/// @require {function} _arglist-to-list
|
18
|
+
/// @require {function} contains
|
19
|
+
/// @require {function} is-function
|
20
|
+
/// @require {function} is-string
|
21
|
+
/// @require {mixin} prefixer
|
22
|
+
///
|
23
|
+
/// @example scss - Usage
|
24
|
+
/// Doggy Style Syntax
|
25
|
+
/// @include transform(rotate 90, scale 0.8);
|
26
|
+
/// Bourbon Syntax
|
27
|
+
/// @include transform(rotate(90deg) scale(0.8));
|
28
|
+
/// Generic Syntax
|
29
|
+
/// @include transform(rotate(90deg), scale(0.8));
|
30
|
+
///
|
31
|
+
/// @example css - CSS Output
|
32
|
+
/// -webkit-transform: rotate(90deg) scale(0.8);
|
33
|
+
/// -moz-transform: rotate(90deg) scale(0.8);
|
34
|
+
/// transform: rotate(90deg) scale(0.8);
|
35
|
+
|
36
|
+
@mixin transform($settings...) {
|
37
|
+
|
38
|
+
$transforms : ();
|
39
|
+
$fallback-settings : ();
|
40
|
+
$important : null;
|
41
|
+
|
42
|
+
@if not contains($transform-values, $settings, true) and length($settings) >= 1 {
|
43
|
+
|
44
|
+
// This is an over-engineered section of code to to allow for all types of syntaxes.
|
45
|
+
// Essestially making it work with Bourbon and other frameworks.
|
46
|
+
@if length($settings) == 1 {
|
47
|
+
@for $i from 1 through length($settings) {
|
48
|
+
@each $setting in nth($settings, $i) {
|
49
|
+
@if is-function($setting) {
|
50
|
+
$fallback-settings : append($fallback-settings, $setting, comma);
|
51
|
+
}
|
52
|
+
}
|
53
|
+
}
|
54
|
+
}
|
55
|
+
$settings-lists : if(length($fallback-settings) > 1, $fallback-settings, _arglist-to-list($settings));
|
56
|
+
|
57
|
+
@each $settings in $settings-lists {
|
58
|
+
|
59
|
+
@if is-function($settings) {
|
60
|
+
$settings : is-function($settings);
|
61
|
+
}
|
62
|
+
|
63
|
+
$transform : null;
|
64
|
+
|
65
|
+
$value : ();
|
66
|
+
|
67
|
+
// Check for transforms
|
68
|
+
@each $setting in $settings {
|
69
|
+
@if is-string($setting) and contains($transform-types, $setting) {
|
70
|
+
$transform : $setting;
|
71
|
+
}
|
72
|
+
}
|
73
|
+
|
74
|
+
// Check and validate all transform types
|
75
|
+
@each $setting in $settings {
|
76
|
+
@if not is-string($setting) {
|
77
|
+
@if contains($transform, (translate translateY translateX translateZ translate3d perspective)) {
|
78
|
+
// Values that require a unit
|
79
|
+
@each $val in $setting {
|
80
|
+
$value : append($value, addUnit($val), comma);
|
81
|
+
}
|
82
|
+
} @elseif contains($transform, (rotate rotateX rotateY rotateZ skew skewX skewY)) {
|
83
|
+
// Values that require an angle
|
84
|
+
@each $val in $setting {
|
85
|
+
$value : append($value, addUnit($val, deg), comma);
|
86
|
+
}
|
87
|
+
} @else {
|
88
|
+
// All other values
|
89
|
+
$value : append($value, $setting);
|
90
|
+
}
|
91
|
+
} @elseif contains($transform-values, $setting) {
|
92
|
+
// Values that are strings and are global values
|
93
|
+
$value : append($value, $setting);
|
94
|
+
}
|
95
|
+
}
|
96
|
+
|
97
|
+
// Append transform and value to the transforms list
|
98
|
+
@if $transform != null {
|
99
|
+
$transforms : append($transforms, $transform+"("+$value+")");
|
100
|
+
}
|
101
|
+
|
102
|
+
}
|
103
|
+
} @else {
|
104
|
+
$transforms : nth($settings, 1);
|
105
|
+
}
|
106
|
+
|
107
|
+
|
108
|
+
@include prefixer(transform, $transforms, webkit moz, $important);
|
109
|
+
|
110
|
+
}
|
111
|
+
|
112
|
+
|
113
|
+
/// Transform origin
|
114
|
+
@mixin transform-origin($value) {
|
115
|
+
|
116
|
+
$values : ();
|
117
|
+
|
118
|
+
@if length($value) > 1 {
|
119
|
+
@each $val in $value {
|
120
|
+
$values : append($values, addUnit($val));
|
121
|
+
}
|
122
|
+
} @else {
|
123
|
+
$values : addUnit($value);
|
124
|
+
}
|
125
|
+
|
126
|
+
@include prefixer(transform-origin, $values, webkit);
|
127
|
+
}
|
128
|
+
|
129
|
+
|
130
|
+
@mixin transform-style($value) {
|
131
|
+
@if contains((flat preserve-3d initial inherit), $value) {
|
132
|
+
@include prefixer(transform-style, $value, webkit);
|
133
|
+
} @else {
|
134
|
+
@include warning($value + ": is an invalid value for 'transform-style'");
|
135
|
+
}
|
136
|
+
}
|
137
|
+
|
138
|
+
/// Matrix
|
139
|
+
@mixin matrix($args...) {
|
140
|
+
@include transform(matrix($args));
|
141
|
+
}
|
142
|
+
|
143
|
+
@mixin matrix3d($args...) {
|
144
|
+
@include transform(matrix3d($args));
|
145
|
+
}
|
146
|
+
|
147
|
+
|
148
|
+
/// Translate
|
149
|
+
@mixin translate($values) {
|
150
|
+
$x : nth($values, 1);
|
151
|
+
$y : if( length($values) > 1, nth($values, 2), 0);
|
152
|
+
@include transform(translate(addUnit($x), addUnit($y)));
|
153
|
+
}
|
154
|
+
|
155
|
+
@mixin translateX($x) {
|
156
|
+
@include transform(translateX(addUnit($x)));
|
157
|
+
}
|
158
|
+
|
159
|
+
@mixin translateY($y) {
|
160
|
+
@include transform(translateY(addUnit($y)));
|
161
|
+
}
|
162
|
+
|
163
|
+
@mixin translate3d($values) {
|
164
|
+
$x : nth($values, 1);
|
165
|
+
$y : if( length($values) > 1, nth($values, 2), 0);
|
166
|
+
$z : if( length($values) > 2, nth($values, 3), 0);
|
167
|
+
@include transform(translate3d($x, $y, $z));
|
168
|
+
}
|
169
|
+
|
170
|
+
@mixin translateZ($value) {
|
171
|
+
@include transform(translateZ(addUnit($value)));
|
172
|
+
}
|
173
|
+
|
174
|
+
|
175
|
+
/// Scale
|
176
|
+
@mixin scale($values) {
|
177
|
+
$width: nth($values, 1);
|
178
|
+
$height : if(length($values) > 1, nth($values, 2), $width);
|
179
|
+
|
180
|
+
|
181
|
+
@include transform(scale($width, $height));
|
182
|
+
}
|
183
|
+
|
184
|
+
@mixin scaleX($value) {
|
185
|
+
@include transform(scaleX(strip($value)));
|
186
|
+
}
|
187
|
+
|
188
|
+
@mixin scaleY($value) {
|
189
|
+
@include transform(scaleY(strip($value)));
|
190
|
+
}
|
191
|
+
|
192
|
+
@mixin scale3d($values) {
|
193
|
+
$x : strip(nth($values, 1));
|
194
|
+
$y : if( length($values) > 1, strip(nth($values, 2)), 0);
|
195
|
+
$z : if( length($values) > 2, strip(nth($values, 3)), 0);
|
196
|
+
@include transform(scale3d($x, $y, $z));
|
197
|
+
}
|
198
|
+
|
199
|
+
@mixin scaleZ($value) {
|
200
|
+
@include transform(scaleZ(strip($value)));
|
201
|
+
}
|
202
|
+
|
203
|
+
|
204
|
+
/// Rotate
|
205
|
+
@mixin rotate($value) {
|
206
|
+
@include transform(rotate(addUnit($value, deg)));
|
207
|
+
}
|
208
|
+
|
209
|
+
@mixin rotateX($value) {
|
210
|
+
@include transform(rotateX(addUnit($value, deg)));
|
211
|
+
}
|
212
|
+
|
213
|
+
@mixin rotateY($value) {
|
214
|
+
@include transform(rotateY(addUnit($value, deg)));
|
215
|
+
}
|
216
|
+
|
217
|
+
@mixin rotateZ($value) {
|
218
|
+
@include transform(rotateZ(addUnit($value, deg)));
|
219
|
+
}
|
220
|
+
|
221
|
+
@mixin rotate3d($values) {
|
222
|
+
$x : strip(nth($values, 1));
|
223
|
+
$y : if( length($values) > 1, strip(nth($values, 2)), 0);
|
224
|
+
$z : if( length($values) > 2, strip(nth($values, 3)), 0);
|
225
|
+
$deg : if( length($values) > 3, addUnit(nth($values, 4), deg), 0);
|
226
|
+
@include transform(rotate3d($x, $y, $z, $deg));
|
227
|
+
}
|
228
|
+
|
229
|
+
|
230
|
+
/// Skew
|
231
|
+
@mixin skew($values) {
|
232
|
+
$x : addUnit(nth($values, 1), deg);
|
233
|
+
$y : addUnit(if( length($values) > 1, nth($values, 2), 0), deg);
|
234
|
+
@include transform(skew($x, $y));
|
235
|
+
}
|
236
|
+
|
237
|
+
@mixin skewX($value) {
|
238
|
+
@include transform(skewX(addUnit($value, deg)));
|
239
|
+
}
|
240
|
+
|
241
|
+
@mixin skewY($value) {
|
242
|
+
@include transform(skewY(addUnit($value, deg)));
|
243
|
+
}
|
244
|
+
|
245
|
+
|
246
|
+
/// Perspective
|
247
|
+
@mixin perspective($value:600) {
|
248
|
+
@include prefixer(perspective, addUnit($value), webkit);
|
249
|
+
}
|
250
|
+
|
251
|
+
@mixin perspective-origin($value:50% 50%) {
|
252
|
+
|
253
|
+
$values : ();
|
254
|
+
|
255
|
+
@if length($value) > 1 {
|
256
|
+
@each $val in $value {
|
257
|
+
$values : append($values, addUnit($val));
|
258
|
+
}
|
259
|
+
} @else {
|
260
|
+
$values : addUnit($value);
|
261
|
+
}
|
262
|
+
|
263
|
+
@include prefixer(perspective-origin, $values, webkit);
|
264
|
+
}
|