webtask 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +11 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +5 -0
  5. data/CODE_OF_CONDUCT.md +49 -0
  6. data/CONTRIBUTING.md +5 -0
  7. data/Gemfile +4 -0
  8. data/LICENSE +21 -0
  9. data/README.md +39 -0
  10. data/Rakefile +6 -0
  11. data/bin/console +14 -0
  12. data/bin/setup +8 -0
  13. data/example/Rakefile +62 -0
  14. data/example/test.log +21 -0
  15. data/exe/webtask +5 -0
  16. data/lib/webtask.rb +18 -0
  17. data/lib/webtask/application.rb +23 -0
  18. data/lib/webtask/public/javascripts/application.js +25 -0
  19. data/lib/webtask/public/stylesheets/application.css +277 -0
  20. data/lib/webtask/public/stylesheets/application.css.map +7 -0
  21. data/lib/webtask/public/stylesheets/sass/application.scss +106 -0
  22. data/lib/webtask/public/stylesheets/sass/base/_base.scss +15 -0
  23. data/lib/webtask/public/stylesheets/sass/base/_buttons.scss +35 -0
  24. data/lib/webtask/public/stylesheets/sass/base/_forms.scss +84 -0
  25. data/lib/webtask/public/stylesheets/sass/base/_grid-settings.scss +14 -0
  26. data/lib/webtask/public/stylesheets/sass/base/_lists.scss +19 -0
  27. data/lib/webtask/public/stylesheets/sass/base/_tables.scss +24 -0
  28. data/lib/webtask/public/stylesheets/sass/base/_typography.scss +48 -0
  29. data/lib/webtask/public/stylesheets/sass/base/_variables.scss +44 -0
  30. data/lib/webtask/public/stylesheets/sass/bourbon/_bourbon-deprecated-upcoming.scss +411 -0
  31. data/lib/webtask/public/stylesheets/sass/bourbon/_bourbon.scss +87 -0
  32. data/lib/webtask/public/stylesheets/sass/bourbon/addons/_border-color.scss +26 -0
  33. data/lib/webtask/public/stylesheets/sass/bourbon/addons/_border-radius.scss +48 -0
  34. data/lib/webtask/public/stylesheets/sass/bourbon/addons/_border-style.scss +25 -0
  35. data/lib/webtask/public/stylesheets/sass/bourbon/addons/_border-width.scss +25 -0
  36. data/lib/webtask/public/stylesheets/sass/bourbon/addons/_buttons.scss +64 -0
  37. data/lib/webtask/public/stylesheets/sass/bourbon/addons/_clearfix.scss +25 -0
  38. data/lib/webtask/public/stylesheets/sass/bourbon/addons/_ellipsis.scss +30 -0
  39. data/lib/webtask/public/stylesheets/sass/bourbon/addons/_font-stacks.scss +31 -0
  40. data/lib/webtask/public/stylesheets/sass/bourbon/addons/_hide-text.scss +27 -0
  41. data/lib/webtask/public/stylesheets/sass/bourbon/addons/_margin.scss +26 -0
  42. data/lib/webtask/public/stylesheets/sass/bourbon/addons/_padding.scss +26 -0
  43. data/lib/webtask/public/stylesheets/sass/bourbon/addons/_position.scss +48 -0
  44. data/lib/webtask/public/stylesheets/sass/bourbon/addons/_prefixer.scss +66 -0
  45. data/lib/webtask/public/stylesheets/sass/bourbon/addons/_retina-image.scss +25 -0
  46. data/lib/webtask/public/stylesheets/sass/bourbon/addons/_size.scss +51 -0
  47. data/lib/webtask/public/stylesheets/sass/bourbon/addons/_text-inputs.scss +113 -0
  48. data/lib/webtask/public/stylesheets/sass/bourbon/addons/_timing-functions.scss +34 -0
  49. data/lib/webtask/public/stylesheets/sass/bourbon/addons/_triangle.scss +63 -0
  50. data/lib/webtask/public/stylesheets/sass/bourbon/addons/_word-wrap.scss +29 -0
  51. data/lib/webtask/public/stylesheets/sass/bourbon/css3/_animation.scss +43 -0
  52. data/lib/webtask/public/stylesheets/sass/bourbon/css3/_appearance.scss +3 -0
  53. data/lib/webtask/public/stylesheets/sass/bourbon/css3/_backface-visibility.scss +3 -0
  54. data/lib/webtask/public/stylesheets/sass/bourbon/css3/_background-image.scss +42 -0
  55. data/lib/webtask/public/stylesheets/sass/bourbon/css3/_background.scss +55 -0
  56. data/lib/webtask/public/stylesheets/sass/bourbon/css3/_border-image.scss +59 -0
  57. data/lib/webtask/public/stylesheets/sass/bourbon/css3/_calc.scss +4 -0
  58. data/lib/webtask/public/stylesheets/sass/bourbon/css3/_columns.scss +47 -0
  59. data/lib/webtask/public/stylesheets/sass/bourbon/css3/_filter.scss +4 -0
  60. data/lib/webtask/public/stylesheets/sass/bourbon/css3/_flex-box.scss +287 -0
  61. data/lib/webtask/public/stylesheets/sass/bourbon/css3/_font-face.scss +24 -0
  62. data/lib/webtask/public/stylesheets/sass/bourbon/css3/_font-feature-settings.scss +4 -0
  63. data/lib/webtask/public/stylesheets/sass/bourbon/css3/_hidpi-media-query.scss +10 -0
  64. data/lib/webtask/public/stylesheets/sass/bourbon/css3/_hyphens.scss +4 -0
  65. data/lib/webtask/public/stylesheets/sass/bourbon/css3/_image-rendering.scss +14 -0
  66. data/lib/webtask/public/stylesheets/sass/bourbon/css3/_keyframes.scss +36 -0
  67. data/lib/webtask/public/stylesheets/sass/bourbon/css3/_linear-gradient.scss +38 -0
  68. data/lib/webtask/public/stylesheets/sass/bourbon/css3/_perspective.scss +8 -0
  69. data/lib/webtask/public/stylesheets/sass/bourbon/css3/_placeholder.scss +8 -0
  70. data/lib/webtask/public/stylesheets/sass/bourbon/css3/_radial-gradient.scss +39 -0
  71. data/lib/webtask/public/stylesheets/sass/bourbon/css3/_selection.scss +42 -0
  72. data/lib/webtask/public/stylesheets/sass/bourbon/css3/_text-decoration.scss +19 -0
  73. data/lib/webtask/public/stylesheets/sass/bourbon/css3/_transform.scss +15 -0
  74. data/lib/webtask/public/stylesheets/sass/bourbon/css3/_transition.scss +71 -0
  75. data/lib/webtask/public/stylesheets/sass/bourbon/css3/_user-select.scss +3 -0
  76. data/lib/webtask/public/stylesheets/sass/bourbon/functions/_assign-inputs.scss +11 -0
  77. data/lib/webtask/public/stylesheets/sass/bourbon/functions/_contains-falsy.scss +20 -0
  78. data/lib/webtask/public/stylesheets/sass/bourbon/functions/_contains.scss +26 -0
  79. data/lib/webtask/public/stylesheets/sass/bourbon/functions/_is-length.scss +11 -0
  80. data/lib/webtask/public/stylesheets/sass/bourbon/functions/_is-light.scss +21 -0
  81. data/lib/webtask/public/stylesheets/sass/bourbon/functions/_is-number.scss +11 -0
  82. data/lib/webtask/public/stylesheets/sass/bourbon/functions/_is-size.scss +13 -0
  83. data/lib/webtask/public/stylesheets/sass/bourbon/functions/_modular-scale.scss +69 -0
  84. data/lib/webtask/public/stylesheets/sass/bourbon/functions/_px-to-em.scss +13 -0
  85. data/lib/webtask/public/stylesheets/sass/bourbon/functions/_px-to-rem.scss +15 -0
  86. data/lib/webtask/public/stylesheets/sass/bourbon/functions/_shade.scss +24 -0
  87. data/lib/webtask/public/stylesheets/sass/bourbon/functions/_strip-units.scss +17 -0
  88. data/lib/webtask/public/stylesheets/sass/bourbon/functions/_tint.scss +24 -0
  89. data/lib/webtask/public/stylesheets/sass/bourbon/functions/_transition-property-name.scss +22 -0
  90. data/lib/webtask/public/stylesheets/sass/bourbon/functions/_unpack.scss +27 -0
  91. data/lib/webtask/public/stylesheets/sass/bourbon/helpers/_convert-units.scss +21 -0
  92. data/lib/webtask/public/stylesheets/sass/bourbon/helpers/_directional-values.scss +96 -0
  93. data/lib/webtask/public/stylesheets/sass/bourbon/helpers/_font-source-declaration.scss +43 -0
  94. data/lib/webtask/public/stylesheets/sass/bourbon/helpers/_gradient-positions-parser.scss +13 -0
  95. data/lib/webtask/public/stylesheets/sass/bourbon/helpers/_linear-angle-parser.scss +25 -0
  96. data/lib/webtask/public/stylesheets/sass/bourbon/helpers/_linear-gradient-parser.scss +41 -0
  97. data/lib/webtask/public/stylesheets/sass/bourbon/helpers/_linear-positions-parser.scss +61 -0
  98. data/lib/webtask/public/stylesheets/sass/bourbon/helpers/_linear-side-corner-parser.scss +31 -0
  99. data/lib/webtask/public/stylesheets/sass/bourbon/helpers/_radial-arg-parser.scss +69 -0
  100. data/lib/webtask/public/stylesheets/sass/bourbon/helpers/_radial-gradient-parser.scss +50 -0
  101. data/lib/webtask/public/stylesheets/sass/bourbon/helpers/_radial-positions-parser.scss +18 -0
  102. data/lib/webtask/public/stylesheets/sass/bourbon/helpers/_render-gradients.scss +26 -0
  103. data/lib/webtask/public/stylesheets/sass/bourbon/helpers/_shape-size-stripper.scss +10 -0
  104. data/lib/webtask/public/stylesheets/sass/bourbon/helpers/_str-to-num.scss +50 -0
  105. data/lib/webtask/public/stylesheets/sass/bourbon/settings/_asset-pipeline.scss +7 -0
  106. data/lib/webtask/public/stylesheets/sass/bourbon/settings/_prefixer.scss +9 -0
  107. data/lib/webtask/public/stylesheets/sass/bourbon/settings/_px-to-em.scss +1 -0
  108. data/lib/webtask/public/stylesheets/sass/neat/_neat-helpers.scss +11 -0
  109. data/lib/webtask/public/stylesheets/sass/neat/_neat.scss +23 -0
  110. data/lib/webtask/public/stylesheets/sass/neat/functions/_new-breakpoint.scss +49 -0
  111. data/lib/webtask/public/stylesheets/sass/neat/functions/_private.scss +114 -0
  112. data/lib/webtask/public/stylesheets/sass/neat/grid/_box-sizing.scss +15 -0
  113. data/lib/webtask/public/stylesheets/sass/neat/grid/_direction-context.scss +33 -0
  114. data/lib/webtask/public/stylesheets/sass/neat/grid/_display-context.scss +28 -0
  115. data/lib/webtask/public/stylesheets/sass/neat/grid/_fill-parent.scss +22 -0
  116. data/lib/webtask/public/stylesheets/sass/neat/grid/_media.scss +92 -0
  117. data/lib/webtask/public/stylesheets/sass/neat/grid/_omega.scss +87 -0
  118. data/lib/webtask/public/stylesheets/sass/neat/grid/_outer-container.scss +34 -0
  119. data/lib/webtask/public/stylesheets/sass/neat/grid/_pad.scss +25 -0
  120. data/lib/webtask/public/stylesheets/sass/neat/grid/_private.scss +35 -0
  121. data/lib/webtask/public/stylesheets/sass/neat/grid/_row.scss +52 -0
  122. data/lib/webtask/public/stylesheets/sass/neat/grid/_shift.scss +50 -0
  123. data/lib/webtask/public/stylesheets/sass/neat/grid/_span-columns.scss +94 -0
  124. data/lib/webtask/public/stylesheets/sass/neat/grid/_to-deprecate.scss +97 -0
  125. data/lib/webtask/public/stylesheets/sass/neat/grid/_visual-grid.scss +42 -0
  126. data/lib/webtask/public/stylesheets/sass/neat/mixins/_clearfix.scss +25 -0
  127. data/lib/webtask/public/stylesheets/sass/neat/settings/_disable-warnings.scss +13 -0
  128. data/lib/webtask/public/stylesheets/sass/neat/settings/_grid.scss +51 -0
  129. data/lib/webtask/public/stylesheets/sass/neat/settings/_visual-grid.scss +27 -0
  130. data/lib/webtask/rake_application.rb +40 -0
  131. data/lib/webtask/stream_error.rb +18 -0
  132. data/lib/webtask/stream_out.rb +12 -0
  133. data/lib/webtask/task_runner.rb +63 -0
  134. data/lib/webtask/task_wrapper.rb +25 -0
  135. data/lib/webtask/version.rb +3 -0
  136. data/lib/webtask/views/index.haml +57 -0
  137. data/lib/webtask/views/result.haml +30 -0
  138. data/webtask.gemspec +34 -0
  139. metadata +339 -0
@@ -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
+ }
@@ -0,0 +1,87 @@
1
+ @charset "UTF-8";
2
+
3
+ /// Removes the element's gutter margin, regardless of its position in the grid hierarchy or display property. It can target a specific element, or every `nth-child` occurrence. Works only with `block` layouts.
4
+ ///
5
+ /// @param {List} $query [block]
6
+ /// List of arguments. Supported arguments are `nth-child` selectors (targets a specific pseudo element) and `auto` (targets `last-child`).
7
+ ///
8
+ /// When passed an `nth-child` argument of type `*n` with `block` display, the omega mixin automatically adds a clear to the `*n+1` th element. Note that composite arguments such as `2n+1` do not support this feature.
9
+ ///
10
+ /// **Deprecation warning**: The omega mixin will no longer take a `$direction` argument. To change the layout direction, use `row($direction)` or set `$default-layout-direction` instead.
11
+ ///
12
+ /// @example scss - Usage
13
+ /// .element {
14
+ /// @include omega;
15
+ /// }
16
+ ///
17
+ /// .nth-element {
18
+ /// @include omega(4n);
19
+ /// }
20
+ ///
21
+ /// @example css - CSS Output
22
+ /// .element {
23
+ /// margin-right: 0;
24
+ /// }
25
+ ///
26
+ /// .nth-element:nth-child(4n) {
27
+ /// margin-right: 0;
28
+ /// }
29
+ ///
30
+ /// .nth-element:nth-child(4n+1) {
31
+ /// clear: left;
32
+ /// }
33
+
34
+ @mixin omega($query: block, $direction: default) {
35
+ $table: belongs-to(table, $query);
36
+ $auto: belongs-to(auto, $query);
37
+
38
+ @if $direction != default {
39
+ @include -neat-warn("The omega mixin will no longer take a $direction argument. To change the layout direction, use the direction(){...} mixin.");
40
+ } @else {
41
+ $direction: get-direction($layout-direction, $default-layout-direction);
42
+ }
43
+
44
+ @if $table {
45
+ @include -neat-warn("The omega mixin no longer removes padding in table layouts.");
46
+ }
47
+
48
+ @if length($query) == 1 {
49
+ @if $auto {
50
+ &:last-child {
51
+ margin-#{$direction}: 0;
52
+ }
53
+ }
54
+
55
+ @else if contains-display-value($query) and $table == false {
56
+ margin-#{$direction}: 0;
57
+ }
58
+
59
+ @else {
60
+ @include nth-child($query, $direction);
61
+ }
62
+ } @else if length($query) == 2 {
63
+ @if $auto {
64
+ &:last-child {
65
+ margin-#{$direction}: 0;
66
+ }
67
+ } @else {
68
+ @include nth-child(nth($query, 1), $direction);
69
+ }
70
+ } @else {
71
+ @include -neat-warn("Too many arguments passed to the omega() mixin.");
72
+ }
73
+ }
74
+
75
+ @mixin nth-child($query, $direction) {
76
+ $opposite-direction: get-opposite-direction($direction);
77
+
78
+ &:nth-child(#{$query}) {
79
+ margin-#{$direction}: 0;
80
+ }
81
+
82
+ @if type-of($query) == number and unit($query) == "n" {
83
+ &:nth-child(#{$query}+1) {
84
+ clear: $opposite-direction;
85
+ }
86
+ }
87
+ }
@@ -0,0 +1,34 @@
1
+ @charset "UTF-8";
2
+
3
+ /// Makes an element a outer container by centering it in the viewport, clearing its floats, and setting its `max-width`.
4
+ /// Although optional, using `outer-container` is recommended. The mixin can be called on more than one element per page, as long as they are not nested.
5
+ ///
6
+ /// @param {Number [unit]} $local-max-width [$max-width]
7
+ /// Max width to be applied to the element. Can be a percentage or a measure.
8
+ ///
9
+ /// @example scss - Usage
10
+ /// .element {
11
+ /// @include outer-container(100%);
12
+ /// }
13
+ ///
14
+ /// @example css - CSS Output
15
+ /// .element {
16
+ /// max-width: 100%;
17
+ /// margin-left: auto;
18
+ /// margin-right: auto;
19
+ /// }
20
+ ///
21
+ /// .element::after {
22
+ /// clear: both;
23
+ /// content: "";
24
+ /// display: table;
25
+ /// }
26
+
27
+ @mixin outer-container($local-max-width: $max-width) {
28
+ @include clearfix;
29
+ max-width: $local-max-width;
30
+ margin: {
31
+ left: auto;
32
+ right: auto;
33
+ }
34
+ }
@@ -0,0 +1,25 @@
1
+ @charset "UTF-8";
2
+
3
+ /// Adds padding to the element.
4
+ ///
5
+ /// @param {List} $padding [flex-gutter()]
6
+ /// A list of padding value(s) to use. Passing `default` in the list will result in using the gutter width as a padding value.
7
+ ///
8
+ /// @example scss - Usage
9
+ /// .element {
10
+ /// @include pad(30px -20px 10px default);
11
+ /// }
12
+ ///
13
+ /// @example css - CSS Output
14
+ /// .element {
15
+ /// padding: 30px -20px 10px 2.35765%;
16
+ /// }
17
+
18
+ @mixin pad($padding: flex-gutter()) {
19
+ $padding-list: null;
20
+ @each $value in $padding {
21
+ $value: if($value == 'default', flex-gutter(), $value);
22
+ $padding-list: join($padding-list, $value);
23
+ }
24
+ padding: $padding-list;
25
+ }