garth-jekyll-theme 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. checksums.yaml +4 -4
  2. data/_sass/bourbon/_bourbon.scss +45 -80
  3. data/_sass/bourbon/bourbon/helpers/_buttons-list.scss +14 -0
  4. data/_sass/bourbon/bourbon/helpers/_scales.scss +27 -0
  5. data/_sass/bourbon/bourbon/helpers/_text-inputs-list.scss +26 -0
  6. data/_sass/bourbon/bourbon/library/_border-color.scss +25 -0
  7. data/_sass/bourbon/bourbon/library/_border-radius.scss +85 -0
  8. data/_sass/bourbon/bourbon/library/_border-style.scss +24 -0
  9. data/_sass/bourbon/bourbon/library/_border-width.scss +24 -0
  10. data/_sass/bourbon/bourbon/library/_buttons.scss +84 -0
  11. data/_sass/bourbon/{addons → bourbon/library}/_clearfix.scss +5 -5
  12. data/_sass/bourbon/bourbon/library/_contrast-switch.scss +60 -0
  13. data/_sass/bourbon/{addons → bourbon/library}/_ellipsis.scss +13 -6
  14. data/_sass/bourbon/bourbon/library/_font-face.scss +65 -0
  15. data/_sass/bourbon/bourbon/library/_font-stacks.scss +87 -0
  16. data/_sass/bourbon/bourbon/library/_hide-text.scss +24 -0
  17. data/_sass/bourbon/bourbon/library/_hide-visually.scss +65 -0
  18. data/_sass/bourbon/bourbon/library/_margin.scss +34 -0
  19. data/_sass/bourbon/bourbon/library/_modular-scale.scss +113 -0
  20. data/_sass/bourbon/bourbon/library/_padding.scss +34 -0
  21. data/_sass/bourbon/{addons → bourbon/library}/_position.scss +19 -13
  22. data/_sass/bourbon/bourbon/library/_prefixer.scss +38 -0
  23. data/_sass/bourbon/bourbon/library/_shade.scss +33 -0
  24. data/_sass/bourbon/bourbon/library/_size.scss +49 -0
  25. data/_sass/bourbon/bourbon/library/_strip-unit.scss +17 -0
  26. data/_sass/bourbon/bourbon/library/_text-inputs.scss +163 -0
  27. data/_sass/bourbon/{addons → bourbon/library}/_timing-functions.scss +7 -3
  28. data/_sass/bourbon/bourbon/library/_tint.scss +33 -0
  29. data/_sass/bourbon/bourbon/library/_triangle.scss +82 -0
  30. data/_sass/bourbon/bourbon/library/_value-prefixer.scss +38 -0
  31. data/_sass/bourbon/{addons → bourbon/library}/_word-wrap.scss +3 -3
  32. data/_sass/bourbon/bourbon/settings/_settings.scss +51 -0
  33. data/_sass/bourbon/bourbon/utilities/_assign-inputs.scss +29 -0
  34. data/_sass/bourbon/bourbon/utilities/_collapse-directionals.scss +51 -0
  35. data/_sass/bourbon/bourbon/utilities/_directional-values.scss +58 -0
  36. data/_sass/bourbon/{helpers → bourbon/utilities}/_font-source-declaration.scss +26 -17
  37. data/_sass/bourbon/bourbon/utilities/_retrieve-bourbon-setting.scss +16 -0
  38. data/_sass/bourbon/{functions → bourbon/utilities}/_unpack.scss +7 -5
  39. data/_sass/bourbon/{functions → bourbon/validators}/_contains-falsy.scss +5 -5
  40. data/_sass/bourbon/{functions → bourbon/validators}/_contains.scss +9 -8
  41. data/_sass/bourbon/bourbon/validators/_is-color.scss +13 -0
  42. data/_sass/bourbon/{functions → bourbon/validators}/_is-length.scss +6 -2
  43. data/_sass/bourbon/{functions → bourbon/validators}/_is-light.scss +7 -5
  44. data/_sass/bourbon/bourbon/validators/_is-number.scss +15 -0
  45. data/_sass/bourbon/bourbon/validators/_is-size.scss +18 -0
  46. data/_sass/neat/_neat-helpers.scss +8 -0
  47. data/_sass/neat/_neat.scss +23 -0
  48. data/_sass/neat/functions/_new-breakpoint.scss +49 -0
  49. data/_sass/neat/functions/_private.scss +114 -0
  50. data/_sass/neat/grid/_box-sizing.scss +15 -0
  51. data/_sass/neat/grid/_direction-context.scss +33 -0
  52. data/_sass/neat/grid/_display-context.scss +28 -0
  53. data/_sass/neat/grid/_fill-parent.scss +22 -0
  54. data/_sass/neat/grid/_media.scss +92 -0
  55. data/_sass/neat/grid/_omega.scss +87 -0
  56. data/_sass/neat/grid/_outer-container.scss +38 -0
  57. data/_sass/neat/grid/_pad.scss +25 -0
  58. data/_sass/neat/grid/_private.scss +35 -0
  59. data/_sass/neat/grid/_row.scss +52 -0
  60. data/_sass/neat/grid/_shift.scss +50 -0
  61. data/_sass/neat/grid/_span-columns.scss +94 -0
  62. data/_sass/neat/grid/_to-deprecate.scss +97 -0
  63. data/_sass/neat/grid/_visual-grid.scss +42 -0
  64. data/_sass/neat/settings/_disable-warnings.scss +13 -0
  65. data/_sass/neat/settings/_grid.scss +51 -0
  66. data/_sass/neat/settings/_visual-grid.scss +27 -0
  67. data/_sass/theme.scss +6 -0
  68. metadata +66 -79
  69. data/_sass/bourbon/_bourbon-deprecated-upcoming.scss +0 -411
  70. data/_sass/bourbon/addons/_border-color.scss +0 -26
  71. data/_sass/bourbon/addons/_border-radius.scss +0 -48
  72. data/_sass/bourbon/addons/_border-style.scss +0 -25
  73. data/_sass/bourbon/addons/_border-width.scss +0 -25
  74. data/_sass/bourbon/addons/_buttons.scss +0 -64
  75. data/_sass/bourbon/addons/_font-stacks.scss +0 -31
  76. data/_sass/bourbon/addons/_hide-text.scss +0 -27
  77. data/_sass/bourbon/addons/_margin.scss +0 -26
  78. data/_sass/bourbon/addons/_padding.scss +0 -26
  79. data/_sass/bourbon/addons/_prefixer.scss +0 -66
  80. data/_sass/bourbon/addons/_retina-image.scss +0 -25
  81. data/_sass/bourbon/addons/_size.scss +0 -51
  82. data/_sass/bourbon/addons/_text-inputs.scss +0 -113
  83. data/_sass/bourbon/addons/_triangle.scss +0 -63
  84. data/_sass/bourbon/css3/_animation.scss +0 -43
  85. data/_sass/bourbon/css3/_appearance.scss +0 -3
  86. data/_sass/bourbon/css3/_backface-visibility.scss +0 -3
  87. data/_sass/bourbon/css3/_background-image.scss +0 -42
  88. data/_sass/bourbon/css3/_background.scss +0 -55
  89. data/_sass/bourbon/css3/_border-image.scss +0 -59
  90. data/_sass/bourbon/css3/_calc.scss +0 -4
  91. data/_sass/bourbon/css3/_columns.scss +0 -47
  92. data/_sass/bourbon/css3/_filter.scss +0 -4
  93. data/_sass/bourbon/css3/_flex-box.scss +0 -287
  94. data/_sass/bourbon/css3/_font-face.scss +0 -24
  95. data/_sass/bourbon/css3/_font-feature-settings.scss +0 -4
  96. data/_sass/bourbon/css3/_hidpi-media-query.scss +0 -10
  97. data/_sass/bourbon/css3/_hyphens.scss +0 -4
  98. data/_sass/bourbon/css3/_image-rendering.scss +0 -14
  99. data/_sass/bourbon/css3/_keyframes.scss +0 -36
  100. data/_sass/bourbon/css3/_linear-gradient.scss +0 -38
  101. data/_sass/bourbon/css3/_perspective.scss +0 -8
  102. data/_sass/bourbon/css3/_placeholder.scss +0 -8
  103. data/_sass/bourbon/css3/_radial-gradient.scss +0 -39
  104. data/_sass/bourbon/css3/_selection.scss +0 -42
  105. data/_sass/bourbon/css3/_text-decoration.scss +0 -19
  106. data/_sass/bourbon/css3/_transform.scss +0 -15
  107. data/_sass/bourbon/css3/_transition.scss +0 -71
  108. data/_sass/bourbon/css3/_user-select.scss +0 -3
  109. data/_sass/bourbon/functions/_assign-inputs.scss +0 -11
  110. data/_sass/bourbon/functions/_is-number.scss +0 -11
  111. data/_sass/bourbon/functions/_is-size.scss +0 -13
  112. data/_sass/bourbon/functions/_modular-scale.scss +0 -69
  113. data/_sass/bourbon/functions/_px-to-em.scss +0 -13
  114. data/_sass/bourbon/functions/_px-to-rem.scss +0 -15
  115. data/_sass/bourbon/functions/_shade.scss +0 -24
  116. data/_sass/bourbon/functions/_strip-units.scss +0 -17
  117. data/_sass/bourbon/functions/_tint.scss +0 -24
  118. data/_sass/bourbon/functions/_transition-property-name.scss +0 -22
  119. data/_sass/bourbon/helpers/_convert-units.scss +0 -21
  120. data/_sass/bourbon/helpers/_directional-values.scss +0 -96
  121. data/_sass/bourbon/helpers/_gradient-positions-parser.scss +0 -13
  122. data/_sass/bourbon/helpers/_linear-angle-parser.scss +0 -25
  123. data/_sass/bourbon/helpers/_linear-gradient-parser.scss +0 -41
  124. data/_sass/bourbon/helpers/_linear-positions-parser.scss +0 -61
  125. data/_sass/bourbon/helpers/_linear-side-corner-parser.scss +0 -31
  126. data/_sass/bourbon/helpers/_radial-arg-parser.scss +0 -69
  127. data/_sass/bourbon/helpers/_radial-gradient-parser.scss +0 -50
  128. data/_sass/bourbon/helpers/_radial-positions-parser.scss +0 -18
  129. data/_sass/bourbon/helpers/_render-gradients.scss +0 -26
  130. data/_sass/bourbon/helpers/_shape-size-stripper.scss +0 -10
  131. data/_sass/bourbon/helpers/_str-to-num.scss +0 -50
  132. data/_sass/bourbon/settings/_asset-pipeline.scss +0 -7
  133. data/_sass/bourbon/settings/_prefixer.scss +0 -9
  134. data/_sass/bourbon/settings/_px-to-em.scss +0 -1
@@ -2,20 +2,21 @@
2
2
 
3
3
  /// Checks if a list contains a value(s).
4
4
  ///
5
- /// @access private
6
- ///
7
- /// @param {List} $list
5
+ /// @argument {list} $list
8
6
  /// The list to check against.
9
7
  ///
10
- /// @param {List} $values
8
+ /// @argument {list} $values
11
9
  /// A single value or list of values to check for.
12
10
  ///
13
- /// @example scss - Usage
14
- /// contains($list, $value)
11
+ /// @return {boolean}
15
12
  ///
16
- /// @return {Bool}
13
+ /// @access private
14
+
15
+ @function _contains(
16
+ $list,
17
+ $values...
18
+ ) {
17
19
 
18
- @function contains($list, $values...) {
19
20
  @each $value in $values {
20
21
  @if type-of(index($list, $value)) != "number" {
21
22
  @return false;
@@ -0,0 +1,13 @@
1
+ @charset "UTF-8";
2
+
3
+ /// Checks for a valid CSS color.
4
+ ///
5
+ /// @argument {string} $color
6
+ ///
7
+ /// @return {boolean}
8
+ ///
9
+ /// @access private
10
+
11
+ @function _is-color($color) {
12
+ @return (type-of($color) == color) or ($color == "currentColor");
13
+ }
@@ -2,9 +2,13 @@
2
2
 
3
3
  /// Checks for a valid CSS length.
4
4
  ///
5
- /// @param {String} $value
5
+ /// @argument {string} $value
6
+ ///
7
+ /// @return {boolean}
8
+ ///
9
+ /// @access private
6
10
 
7
- @function is-length($value) {
11
+ @function _is-length($value) {
8
12
  @return type-of($value) != "null" and (str-slice($value + "", 1, 4) == "calc"
9
13
  or index(auto inherit initial 0, $value)
10
14
  or (type-of($value) == "number" and not(unitless($value))));
@@ -2,16 +2,18 @@
2
2
 
3
3
  /// Programatically determines whether a color is light or dark.
4
4
  ///
5
- /// @link http://robots.thoughtbot.com/closer-look-color-lightness
5
+ /// @link http://goo.gl/Dil4Y9
6
6
  ///
7
- /// @param {Color (Hex)} $color
7
+ /// @argument {color (hex)} $hex-color
8
8
  ///
9
- /// @example scss - Usage
9
+ /// @return {boolean}
10
+ ///
11
+ /// @example scss
10
12
  /// is-light($color)
11
13
  ///
12
- /// @return {Bool}
14
+ /// @access private
13
15
 
14
- @function is-light($hex-color) {
16
+ @function _is-light($hex-color) {
15
17
  $-local-red: red(rgba($hex-color, 1));
16
18
  $-local-green: green(rgba($hex-color, 1));
17
19
  $-local-blue: blue(rgba($hex-color, 1));
@@ -0,0 +1,15 @@
1
+ @charset "UTF-8";
2
+
3
+ /// Checks for a valid number.
4
+ ///
5
+ /// @argument {number} $value
6
+ ///
7
+ /// @require {function} _contains
8
+ ///
9
+ /// @return {boolean}
10
+ ///
11
+ /// @access private
12
+
13
+ @function _is-number($value) {
14
+ @return _contains("0" "1" "2" "3" "4" "5" "6" "7" "8" "9" 0 1 2 3 4 5 6 7 8 9, $value);
15
+ }
@@ -0,0 +1,18 @@
1
+ @charset "UTF-8";
2
+
3
+ /// Checks for a valid CSS size.
4
+ ///
5
+ /// @argument {string} $value
6
+ ///
7
+ /// @return {boolean}
8
+ ///
9
+ /// @require {function} _contains
10
+ ///
11
+ /// @require {function} _is-length
12
+ ///
13
+ /// @access private
14
+
15
+ @function _is-size($value) {
16
+ @return _is-length($value)
17
+ or _contains("fill" "fit-content" "min-content" "max-content", $value);
18
+ }
@@ -0,0 +1,8 @@
1
+ // Functions
2
+ @import "functions/private";
3
+ @import "functions/new-breakpoint";
4
+
5
+ // Settings
6
+ @import "settings/grid";
7
+ @import "settings/visual-grid";
8
+ @import "settings/disable-warnings";
@@ -0,0 +1,23 @@
1
+ // Neat 1.7.4
2
+ // http://neat.bourbon.io
3
+ // Copyright 2012-2015 thoughtbot, inc.
4
+ // MIT License
5
+
6
+ // Helpers
7
+ @import "neat-helpers";
8
+
9
+ // Grid
10
+ @import "grid/private";
11
+ @import "grid/box-sizing";
12
+ @import "grid/omega";
13
+ @import "grid/outer-container";
14
+ @import "grid/span-columns";
15
+ @import "grid/row";
16
+ @import "grid/shift";
17
+ @import "grid/pad";
18
+ @import "grid/fill-parent";
19
+ @import "grid/media";
20
+ @import "grid/to-deprecate";
21
+ @import "grid/visual-grid";
22
+ @import "grid/display-context";
23
+ @import "grid/direction-context";
@@ -0,0 +1,49 @@
1
+ @charset "UTF-8";
2
+
3
+ /// Returns a media context (media query / grid context) that can be stored in a variable and passed to `media()` as a single-keyword argument. Media contexts defined using `new-breakpoint` are used by the visual grid, as long as they are defined before importing Neat.
4
+ ///
5
+ /// @param {List} $query
6
+ /// A list of media query features and values. Each `$feature` should have a corresponding `$value`.
7
+ ///
8
+ /// If there is only a single `$value` in `$query`, `$default-feature` is going to be used.
9
+ ///
10
+ /// The number of total columns in the grid can be set by passing `$columns` at the end of the list (overrides `$total-columns`). For a list of valid values for `$feature`, click [here](http://www.w3.org/TR/css3-mediaqueries/#media1).
11
+ ///
12
+ /// @param {Number (unitless)} $total-columns [$grid-columns]
13
+ /// - Number of columns to use in the new grid context. Can be set as a shorthand in the first parameter.
14
+ ///
15
+ /// @example scss - Usage
16
+ /// $mobile: new-breakpoint(max-width 480px 4);
17
+ ///
18
+ /// .element {
19
+ /// @include media($mobile) {
20
+ /// @include span-columns(4);
21
+ /// }
22
+ /// }
23
+ ///
24
+ /// @example css - CSS Output
25
+ /// @media screen and (max-width: 480px) {
26
+ /// .element {
27
+ /// display: block;
28
+ /// float: left;
29
+ /// margin-right: 7.42297%;
30
+ /// width: 100%;
31
+ /// }
32
+ /// .element:last-child {
33
+ /// margin-right: 0;
34
+ /// }
35
+ /// }
36
+
37
+ @function new-breakpoint($query: $feature $value $columns, $total-columns: $grid-columns) {
38
+ @if length($query) == 1 {
39
+ $query: $default-feature nth($query, 1) $total-columns;
40
+ } @else if is-even(length($query)) {
41
+ $query: append($query, $total-columns);
42
+ }
43
+
44
+ @if is-not(belongs-to($query, $visual-grid-breakpoints)) {
45
+ $visual-grid-breakpoints: append($visual-grid-breakpoints, $query, comma) !global;
46
+ }
47
+
48
+ @return $query;
49
+ }
@@ -0,0 +1,114 @@
1
+ // Not function for Libsass compatibility
2
+ // https://github.com/sass/libsass/issues/368
3
+ @function is-not($value) {
4
+ @return if($value, false, true);
5
+ }
6
+
7
+ // Checks if a number is even
8
+ @function is-even($int) {
9
+ @return $int % 2 == 0;
10
+ }
11
+
12
+ // Checks if an element belongs to a list or not
13
+ @function belongs-to($tested-item, $list) {
14
+ @return is-not(not-belongs-to($tested-item, $list));
15
+ }
16
+
17
+ @function not-belongs-to($tested-item, $list) {
18
+ @return is-not(index($list, $tested-item));
19
+ }
20
+
21
+ // Contains display value
22
+ @function contains-display-value($query) {
23
+ @return belongs-to(table, $query)
24
+ or belongs-to(block, $query)
25
+ or belongs-to(inline-block, $query)
26
+ or belongs-to(inline, $query);
27
+ }
28
+
29
+ // Parses the first argument of span-columns()
30
+ @function container-span($span: $span) {
31
+ @if length($span) == 3 {
32
+ $container-columns: nth($span, 3);
33
+ @return $container-columns;
34
+ } @else if length($span) == 2 {
35
+ $container-columns: nth($span, 2);
36
+ @return $container-columns;
37
+ }
38
+
39
+ @return $grid-columns;
40
+ }
41
+
42
+ @function container-shift($shift: $shift) {
43
+ $parent-columns: $grid-columns !default !global;
44
+
45
+ @if length($shift) == 3 {
46
+ $container-columns: nth($shift, 3);
47
+ @return $container-columns;
48
+ } @else if length($shift) == 2 {
49
+ $container-columns: nth($shift, 2);
50
+ @return $container-columns;
51
+ }
52
+
53
+ @return $parent-columns;
54
+ }
55
+
56
+ // Generates a striped background
57
+ @function gradient-stops($grid-columns, $color: $visual-grid-color) {
58
+ $transparent: transparent;
59
+
60
+ $column-width: flex-grid(1, $grid-columns);
61
+ $gutter-width: flex-gutter($grid-columns);
62
+ $column-offset: $column-width;
63
+
64
+ $values: ($transparent 0, $color 0);
65
+
66
+ @for $i from 1 to $grid-columns*2 {
67
+ @if is-even($i) {
68
+ $values: append($values, $transparent $column-offset, comma);
69
+ $values: append($values, $color $column-offset, comma);
70
+ $column-offset: $column-offset + $column-width;
71
+ } @else {
72
+ $values: append($values, $color $column-offset, comma);
73
+ $values: append($values, $transparent $column-offset, comma);
74
+ $column-offset: $column-offset + $gutter-width;
75
+ }
76
+ }
77
+
78
+ @return $values;
79
+ }
80
+
81
+ // Layout direction
82
+ @function get-direction($layout, $default) {
83
+ $direction: null;
84
+
85
+ @if to-upper-case($layout) == "LTR" or to-upper-case($layout) == "RTL" {
86
+ $direction: direction-from-layout($layout);
87
+ } @else {
88
+ $direction: direction-from-layout($default);
89
+ }
90
+
91
+ @return $direction;
92
+ }
93
+
94
+ @function direction-from-layout($layout) {
95
+ $direction: null;
96
+
97
+ @if to-upper-case($layout) == "LTR" {
98
+ $direction: right;
99
+ } @else {
100
+ $direction: left;
101
+ }
102
+
103
+ @return $direction;
104
+ }
105
+
106
+ @function get-opposite-direction($direction) {
107
+ $opposite-direction: left;
108
+
109
+ @if $direction == "left" {
110
+ $opposite-direction: right;
111
+ }
112
+
113
+ @return $opposite-direction;
114
+ }
@@ -0,0 +1,15 @@
1
+ @charset "UTF-8";
2
+
3
+ @if $border-box-sizing == true {
4
+ html { // http://bit.ly/1qk2tVR
5
+ box-sizing: border-box;
6
+ }
7
+
8
+ * {
9
+ &,
10
+ &::after,
11
+ &::before {
12
+ box-sizing: inherit;
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,33 @@
1
+ @charset "UTF-8";
2
+
3
+ /// Changes the direction property used by other mixins called in the code block argument.
4
+ ///
5
+ /// @param {String} $direction [left-to-right]
6
+ /// Layout direction to be used within the block. Can be `left-to-right` or `right-to-left`.
7
+ ///
8
+ /// @example scss - Usage
9
+ /// @include direction-context(right-to-left) {
10
+ /// .right-to-left-block {
11
+ /// @include span-columns(6);
12
+ /// }
13
+ /// }
14
+ ///
15
+ /// @example css - CSS Output
16
+ /// .right-to-left-block {
17
+ /// float: right;
18
+ /// ...
19
+ /// }
20
+
21
+ @mixin direction-context($direction: left-to-right) {
22
+ $scope-direction: $layout-direction;
23
+
24
+ @if to-lower-case($direction) == "left-to-right" {
25
+ $layout-direction: LTR !global;
26
+ } @else if to-lower-case($direction) == "right-to-left" {
27
+ $layout-direction: RTL !global;
28
+ }
29
+
30
+ @content;
31
+
32
+ $layout-direction: $scope-direction !global;
33
+ }
@@ -0,0 +1,28 @@
1
+ @charset "UTF-8";
2
+
3
+ /// Changes the display property used by other mixins called in the code block argument.
4
+ ///
5
+ /// @param {String} $display [block]
6
+ /// Display value to be used within the block. Can be `table` or `block`.
7
+ ///
8
+ /// @example scss
9
+ /// @include display-context(table) {
10
+ /// .display-table {
11
+ /// @include span-columns(6);
12
+ /// }
13
+ /// }
14
+ ///
15
+ /// @example css
16
+ /// .display-table {
17
+ /// display: table-cell;
18
+ /// ...
19
+ /// }
20
+
21
+ @mixin display-context($display: block) {
22
+ $scope-display: $container-display-table;
23
+ $container-display-table: $display == table !global;
24
+
25
+ @content;
26
+
27
+ $container-display-table: $scope-display !global;
28
+ }
@@ -0,0 +1,22 @@
1
+ @charset "UTF-8";
2
+
3
+ /// Forces the element to fill its parent container.
4
+ ///
5
+ /// @example scss - Usage
6
+ /// .element {
7
+ /// @include fill-parent;
8
+ /// }
9
+ ///
10
+ /// @example css - CSS Output
11
+ /// .element {
12
+ /// width: 100%;
13
+ /// box-sizing: border-box;
14
+ /// }
15
+
16
+ @mixin fill-parent() {
17
+ width: 100%;
18
+
19
+ @if $border-box-sizing == false {
20
+ box-sizing: border-box;
21
+ }
22
+ }
@@ -0,0 +1,92 @@
1
+ @charset "UTF-8";
2
+
3
+ /// Outputs a media-query block with an optional grid context (the total number of columns used in the grid).
4
+ ///
5
+ /// @param {List} $query
6
+ /// A list of media query features and values, where each `$feature` should have a corresponding `$value`.
7
+ /// For a list of valid values for `$feature`, click [here](http://www.w3.org/TR/css3-mediaqueries/#media1).
8
+ ///
9
+ /// If there is only a single `$value` in `$query`, `$default-feature` is going to be used.
10
+ ///
11
+ /// The number of total columns in the grid can be set by passing `$columns` at the end of the list (overrides `$total-columns`).
12
+ ///
13
+ ///
14
+ /// @param {Number (unitless)} $total-columns [$grid-columns]
15
+ /// - Number of columns to use in the new grid context. Can be set as a shorthand in the first parameter.
16
+ ///
17
+ /// @example scss - Usage
18
+ /// .responsive-element {
19
+ /// @include media(769px) {
20
+ /// @include span-columns(6);
21
+ /// }
22
+ /// }
23
+ ///
24
+ /// .new-context-element {
25
+ /// @include media(min-width 320px max-width 480px, 6) {
26
+ /// @include span-columns(6);
27
+ /// }
28
+ /// }
29
+ ///
30
+ /// @example css - CSS Output
31
+ /// @media screen and (min-width: 769px) {
32
+ /// .responsive-element {
33
+ /// display: block;
34
+ /// float: left;
35
+ /// margin-right: 2.35765%;
36
+ /// width: 48.82117%;
37
+ /// }
38
+ ///
39
+ /// .responsive-element:last-child {
40
+ /// margin-right: 0;
41
+ /// }
42
+ /// }
43
+ ///
44
+ /// @media screen and (min-width: 320px) and (max-width: 480px) {
45
+ /// .new-context-element {
46
+ /// display: block;
47
+ /// float: left;
48
+ /// margin-right: 4.82916%;
49
+ /// width: 100%;
50
+ /// }
51
+ ///
52
+ /// .new-context-element:last-child {
53
+ /// margin-right: 0;
54
+ /// }
55
+ /// }
56
+
57
+ @mixin media($query: $feature $value $columns, $total-columns: $grid-columns) {
58
+ @if length($query) == 1 {
59
+ @media screen and ($default-feature: nth($query, 1)) {
60
+ $default-grid-columns: $grid-columns;
61
+ $grid-columns: $total-columns !global;
62
+ @content;
63
+ $grid-columns: $default-grid-columns !global;
64
+ }
65
+ } @else {
66
+ $loop-to: length($query);
67
+ $media-query: "screen and ";
68
+ $default-grid-columns: $grid-columns;
69
+ $grid-columns: $total-columns !global;
70
+
71
+ @if is-not(is-even(length($query))) {
72
+ $grid-columns: nth($query, $loop-to) !global;
73
+ $loop-to: $loop-to - 1;
74
+ }
75
+
76
+ $i: 1;
77
+ @while $i <= $loop-to {
78
+ $media-query: $media-query + "(" + nth($query, $i) + ": " + nth($query, $i + 1) + ") ";
79
+
80
+ @if ($i + 1) != $loop-to {
81
+ $media-query: $media-query + "and ";
82
+ }
83
+
84
+ $i: $i + 2;
85
+ }
86
+
87
+ @media #{$media-query} {
88
+ @content;
89
+ $grid-columns: $default-grid-columns !global;
90
+ }
91
+ }
92
+ }