spice-rack 0.1.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.
Files changed (98) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/README.md +48 -0
  4. data/_includes/disqus_comments.html +20 -0
  5. data/_includes/head.html +16 -0
  6. data/_includes/header.html +14 -0
  7. data/_layouts/default.html +8 -0
  8. data/_layouts/page.html +5 -0
  9. data/_layouts/post.html +29 -0
  10. data/_sass/_articles.scss +19 -0
  11. data/_sass/_categories.scss +9 -0
  12. data/_sass/_code.scss +164 -0
  13. data/_sass/_dates.scss +4 -0
  14. data/_sass/_header.scss +18 -0
  15. data/_sass/_headings.scss +25 -0
  16. data/_sass/_home.scss +19 -0
  17. data/_sass/_paragraphs.scss +5 -0
  18. data/_sass/_typography.scss +3 -0
  19. data/_sass/base/_base.scss +14 -0
  20. data/_sass/base/_buttons.scss +36 -0
  21. data/_sass/base/_forms.scss +82 -0
  22. data/_sass/base/_layout.scss +14 -0
  23. data/_sass/base/_lists.scss +19 -0
  24. data/_sass/base/_media.scss +9 -0
  25. data/_sass/base/_tables.scss +24 -0
  26. data/_sass/base/_typography.scss +42 -0
  27. data/_sass/base/_variables.scss +49 -0
  28. data/_sass/bourbon/_bourbon.scss +54 -0
  29. data/_sass/bourbon/bourbon/helpers/_buttons-list.scss +14 -0
  30. data/_sass/bourbon/bourbon/helpers/_scales.scss +27 -0
  31. data/_sass/bourbon/bourbon/helpers/_text-inputs-list.scss +26 -0
  32. data/_sass/bourbon/bourbon/library/_border-color.scss +26 -0
  33. data/_sass/bourbon/bourbon/library/_border-radius.scss +85 -0
  34. data/_sass/bourbon/bourbon/library/_border-style.scss +25 -0
  35. data/_sass/bourbon/bourbon/library/_border-width.scss +25 -0
  36. data/_sass/bourbon/bourbon/library/_buttons.scss +84 -0
  37. data/_sass/bourbon/bourbon/library/_clearfix.scss +25 -0
  38. data/_sass/bourbon/bourbon/library/_contrast-switch.scss +82 -0
  39. data/_sass/bourbon/bourbon/library/_ellipsis.scss +37 -0
  40. data/_sass/bourbon/bourbon/library/_font-face.scss +66 -0
  41. data/_sass/bourbon/bourbon/library/_font-stacks.scss +249 -0
  42. data/_sass/bourbon/bourbon/library/_hide-text.scss +24 -0
  43. data/_sass/bourbon/bourbon/library/_hide-visually.scss +67 -0
  44. data/_sass/bourbon/bourbon/library/_margin.scss +37 -0
  45. data/_sass/bourbon/bourbon/library/_modular-scale.scss +121 -0
  46. data/_sass/bourbon/bourbon/library/_overflow-wrap.scss +24 -0
  47. data/_sass/bourbon/bourbon/library/_padding.scss +36 -0
  48. data/_sass/bourbon/bourbon/library/_position.scss +64 -0
  49. data/_sass/bourbon/bourbon/library/_prefixer.scss +38 -0
  50. data/_sass/bourbon/bourbon/library/_shade.scss +33 -0
  51. data/_sass/bourbon/bourbon/library/_size.scss +51 -0
  52. data/_sass/bourbon/bourbon/library/_strip-unit.scss +17 -0
  53. data/_sass/bourbon/bourbon/library/_text-inputs.scss +163 -0
  54. data/_sass/bourbon/bourbon/library/_timing-functions.scss +38 -0
  55. data/_sass/bourbon/bourbon/library/_tint.scss +33 -0
  56. data/_sass/bourbon/bourbon/library/_triangle.scss +82 -0
  57. data/_sass/bourbon/bourbon/library/_value-prefixer.scss +38 -0
  58. data/_sass/bourbon/bourbon/settings/_settings.scss +75 -0
  59. data/_sass/bourbon/bourbon/utilities/_assign-inputs.scss +29 -0
  60. data/_sass/bourbon/bourbon/utilities/_compact-shorthand.scss +39 -0
  61. data/_sass/bourbon/bourbon/utilities/_contrast-ratio.scss +31 -0
  62. data/_sass/bourbon/bourbon/utilities/_directional-property.scss +71 -0
  63. data/_sass/bourbon/bourbon/utilities/_font-source-declaration.scss +52 -0
  64. data/_sass/bourbon/bourbon/utilities/_gamma.scss +21 -0
  65. data/_sass/bourbon/bourbon/utilities/_lightness.scss +24 -0
  66. data/_sass/bourbon/bourbon/utilities/_retrieve-bourbon-setting.scss +16 -0
  67. data/_sass/bourbon/bourbon/utilities/_unpack-shorthand.scss +29 -0
  68. data/_sass/bourbon/bourbon/validators/_contains-falsy.scss +20 -0
  69. data/_sass/bourbon/bourbon/validators/_contains.scss +27 -0
  70. data/_sass/bourbon/bourbon/validators/_is-color.scss +13 -0
  71. data/_sass/bourbon/bourbon/validators/_is-length.scss +15 -0
  72. data/_sass/bourbon/bourbon/validators/_is-number.scss +15 -0
  73. data/_sass/bourbon/bourbon/validators/_is-size.scss +18 -0
  74. data/_sass/neat/_neat-helpers.scss +11 -0
  75. data/_sass/neat/_neat.scss +23 -0
  76. data/_sass/neat/functions/_new-breakpoint.scss +49 -0
  77. data/_sass/neat/functions/_private.scss +114 -0
  78. data/_sass/neat/grid/_box-sizing.scss +15 -0
  79. data/_sass/neat/grid/_direction-context.scss +33 -0
  80. data/_sass/neat/grid/_display-context.scss +28 -0
  81. data/_sass/neat/grid/_fill-parent.scss +22 -0
  82. data/_sass/neat/grid/_media.scss +92 -0
  83. data/_sass/neat/grid/_omega.scss +87 -0
  84. data/_sass/neat/grid/_outer-container.scss +34 -0
  85. data/_sass/neat/grid/_pad.scss +25 -0
  86. data/_sass/neat/grid/_private.scss +35 -0
  87. data/_sass/neat/grid/_row.scss +52 -0
  88. data/_sass/neat/grid/_shift.scss +50 -0
  89. data/_sass/neat/grid/_span-columns.scss +94 -0
  90. data/_sass/neat/grid/_to-deprecate.scss +97 -0
  91. data/_sass/neat/grid/_visual-grid.scss +42 -0
  92. data/_sass/neat/mixins/_clearfix.scss +25 -0
  93. data/_sass/neat/settings/_disable-warnings.scss +13 -0
  94. data/_sass/neat/settings/_grid.scss +51 -0
  95. data/_sass/neat/settings/_visual-grid.scss +27 -0
  96. data/_sass/spice-rack.scss +14 -0
  97. data/assets/main.scss +5 -0
  98. metadata +182 -0
@@ -0,0 +1,52 @@
1
+ @charset "UTF-8";
2
+
3
+ /// Builds the `src` list for an `@font-face` declaration.
4
+ ///
5
+ /// @link https://goo.gl/Ru1bKP
6
+ ///
7
+ /// @argument {string} $font-family
8
+ ///
9
+ /// @argument {string} $file-path
10
+ ///
11
+ /// @argument {boolean} $asset-pipeline
12
+ ///
13
+ /// @argument {list} $file-formats
14
+ ///
15
+ /// @return {list}
16
+ ///
17
+ /// @require {function} _contains
18
+ ///
19
+ /// @access private
20
+
21
+ @function _font-source-declaration(
22
+ $font-family,
23
+ $file-path,
24
+ $asset-pipeline,
25
+ $file-formats
26
+ ) {
27
+
28
+ $src: ();
29
+
30
+ $formats-map: (
31
+ eot: "#{$file-path}.eot?#iefix" format("embedded-opentype"),
32
+ woff2: "#{$file-path}.woff2" format("woff2"),
33
+ woff: "#{$file-path}.woff" format("woff"),
34
+ ttf: "#{$file-path}.ttf" format("truetype"),
35
+ svg: "#{$file-path}.svg##{$font-family}" format("svg"),
36
+ );
37
+
38
+ @each $key, $values in $formats-map {
39
+ @if _contains($file-formats, $key) {
40
+ $file-path: nth($values, 1);
41
+ $font-format: nth($values, 2);
42
+
43
+ @if $asset-pipeline == true {
44
+ $src: append($src, font-url($file-path) $font-format, comma);
45
+ } @else {
46
+ $src: append($src, url($file-path) $font-format, comma);
47
+ }
48
+ }
49
+ }
50
+
51
+ @return $src;
52
+ }
@@ -0,0 +1,21 @@
1
+ @charset "UTF-8";
2
+
3
+ /// Performs gamma correction on a single color channel.
4
+ ///
5
+ /// Note that Sass does not have a `pow()` function, so the calculation
6
+ /// is approximate.
7
+ ///
8
+ /// @argument {number (0-1)} $channel
9
+ ///
10
+ /// @return {number (0-1)}
11
+ ///
12
+ /// @access private
13
+
14
+ @function _gamma($channel) {
15
+ @if $channel < 0.03928 {
16
+ @return $channel / 12.92;
17
+ } @else {
18
+ $c: ($channel + 0.055) / 1.055;
19
+ @return (133 * $c * $c * $c + 155 * $c * $c) / 288;
20
+ }
21
+ }
@@ -0,0 +1,24 @@
1
+ @charset "UTF-8";
2
+
3
+ /// Programatically determines the lightness of a color.
4
+ ///
5
+ /// @argument {color (hex)} $hex-color
6
+ ///
7
+ /// @return {number (0-1)}
8
+ ///
9
+ /// @example scss
10
+ /// _lightness($color)
11
+ ///
12
+ /// @access private
13
+
14
+ @function _lightness($hex-color) {
15
+ $-local-red-raw: red(rgba($hex-color, 1));
16
+ $-local-green-raw: green(rgba($hex-color, 1));
17
+ $-local-blue-raw: blue(rgba($hex-color, 1));
18
+
19
+ $-local-red: _gamma($-local-red-raw / 255);
20
+ $-local-green: _gamma($-local-green-raw / 255);
21
+ $-local-blue: _gamma($-local-blue-raw / 255);
22
+
23
+ @return $-local-red * 0.2126 + $-local-green * 0.7152 + $-local-blue * 0.0722;
24
+ }
@@ -0,0 +1,16 @@
1
+ @charset "UTF-8";
2
+
3
+ /// Return a Bourbon setting.
4
+ ///
5
+ /// @argument {string} $setting
6
+ ///
7
+ /// @return {boolean | color | list | number | string}
8
+ ///
9
+ /// @example scss
10
+ /// _retrieve-bourbon-setting(rails-asset-pipeline)
11
+ ///
12
+ /// @access private
13
+
14
+ @function _retrieve-bourbon-setting($setting) {
15
+ @return map-get(map-merge($_bourbon-defaults, $bourbon), $setting);
16
+ }
@@ -0,0 +1,29 @@
1
+ @charset "UTF-8";
2
+
3
+ /// Transforms shorthand that can range from 1-to-4 values to be 4 values.
4
+ ///
5
+ /// @argument {list} $shorthand
6
+ ///
7
+ /// @example scss
8
+ /// .element {
9
+ /// margin: _unpack-shorthand(1em 2em);
10
+ /// }
11
+ ///
12
+ /// // CSS Output
13
+ /// .element {
14
+ /// margin: 1em 2em 1em 2em;
15
+ /// }
16
+ ///
17
+ /// @access private
18
+
19
+ @function _unpack-shorthand($shorthand) {
20
+ @if length($shorthand) == 1 {
21
+ @return nth($shorthand, 1) nth($shorthand, 1) nth($shorthand, 1) nth($shorthand, 1);
22
+ } @else if length($shorthand) == 2 {
23
+ @return nth($shorthand, 1) nth($shorthand, 2) nth($shorthand, 1) nth($shorthand, 2);
24
+ } @else if length($shorthand) == 3 {
25
+ @return nth($shorthand, 1) nth($shorthand, 2) nth($shorthand, 3) nth($shorthand, 2);
26
+ } @else {
27
+ @return $shorthand;
28
+ }
29
+ }
@@ -0,0 +1,20 @@
1
+ @charset "UTF-8";
2
+
3
+ /// Checks if a list does not contain any values.
4
+ ///
5
+ /// @argument {list} $list
6
+ /// The list to check against.
7
+ ///
8
+ /// @return {boolean}
9
+ ///
10
+ /// @access private
11
+
12
+ @function _contains-falsy($list) {
13
+ @each $item in $list {
14
+ @if not $item {
15
+ @return true;
16
+ }
17
+ }
18
+
19
+ @return false;
20
+ }
@@ -0,0 +1,27 @@
1
+ @charset "UTF-8";
2
+
3
+ /// Checks if a list contains a value(s).
4
+ ///
5
+ /// @argument {list} $list
6
+ /// The list to check against.
7
+ ///
8
+ /// @argument {list} $values
9
+ /// A single value or list of values to check for.
10
+ ///
11
+ /// @return {boolean}
12
+ ///
13
+ /// @access private
14
+
15
+ @function _contains(
16
+ $list,
17
+ $values...
18
+ ) {
19
+
20
+ @each $value in $values {
21
+ @if type-of(index($list, $value)) != "number" {
22
+ @return false;
23
+ }
24
+ }
25
+
26
+ @return true;
27
+ }
@@ -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
+ }
@@ -0,0 +1,15 @@
1
+ @charset "UTF-8";
2
+
3
+ /// Checks for a valid CSS length.
4
+ ///
5
+ /// @argument {string} $value
6
+ ///
7
+ /// @return {boolean}
8
+ ///
9
+ /// @access private
10
+
11
+ @function _is-length($value) {
12
+ @return type-of($value) != "null" and (str-slice($value + "", 1, 4) == "calc"
13
+ or index(auto inherit initial 0, $value)
14
+ or (type-of($value) == "number" and not(unitless($value))));
15
+ }
@@ -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,11 @@
1
+ // Mixins
2
+ @import "mixins/clearfix";
3
+
4
+ // Functions
5
+ @import "functions/private";
6
+ @import "functions/new-breakpoint";
7
+
8
+ // Settings
9
+ @import "settings/grid";
10
+ @import "settings/visual-grid";
11
+ @import "settings/disable-warnings";
@@ -0,0 +1,23 @@
1
+ // Neat 1.8.0
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
+ }