neat-compass 1.5.0 → 1.5.1

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.
@@ -1,4 +1,4 @@
1
- // Bourbon Neat 1.5.0
1
+ // Bourbon Neat 1.5.1
2
2
  // MIT Licensed
3
3
  // Copyright (c) 2012-2013 thoughtbot, inc.
4
4
 
@@ -4,7 +4,7 @@
4
4
  $query: $default-feature nth($query, 1) $total-columns;
5
5
  }
6
6
 
7
- @else if length($query) == 2 or length($query) == 4 {
7
+ @else if length($query) % 2 == 0 {
8
8
  $query: append($query, $total-columns);
9
9
  }
10
10
 
@@ -45,7 +45,7 @@
45
45
  }
46
46
 
47
47
  @function container-shift($shift: $shift) {
48
- $parent-columns: $grid-columns !default;
48
+ $parent-columns: $grid-columns !default;
49
49
 
50
50
  @if length($shift) == 3 {
51
51
  $container-columns: nth($shift, 3);
@@ -1,5 +1,4 @@
1
1
  @mixin media($query:$feature $value $columns, $total-columns: $grid-columns) {
2
-
3
2
  @if length($query) == 1 {
4
3
  @media screen and ($default-feature: nth($query, 1)) {
5
4
  $default-grid-columns: $grid-columns;
@@ -9,43 +8,31 @@
9
8
  }
10
9
  }
11
10
 
12
- @else if length($query) == 2 {
13
- @media screen and (nth($query, 1): nth($query, 2)) {
14
- $default-grid-columns: $grid-columns;
15
- $grid-columns: $total-columns;
16
- @content;
17
- $grid-columns: $default-grid-columns;
18
- }
19
- }
11
+ @else {
12
+ $loopTo: length($query);
13
+ $mediaQuery: 'screen and ';
14
+ $default-grid-columns: $grid-columns;
15
+ $grid-columns: $total-columns;
20
16
 
21
- @else if length($query) == 3 {
22
- @media screen and (nth($query, 1): nth($query, 2)) {
23
- $default-grid-columns: $grid-columns;
24
- $grid-columns: nth($query, 3);
25
- @content;
26
- $grid-columns: $default-grid-columns;
17
+ @if length($query) % 2 != 0 {
18
+ $grid-columns: nth($query, $loopTo);
19
+ $loopTo: $loopTo - 1;
27
20
  }
28
- }
29
21
 
30
- @else if length($query) == 4 {
31
- @media screen and (nth($query, 1): nth($query, 2)) and (nth($query, 3): nth($query, 4)) {
32
- $default-grid-columns: $grid-columns;
33
- $grid-columns: $total-columns;
34
- @content;
35
- $grid-columns: $default-grid-columns;
22
+ $i: 1;
23
+ @while $i <= $loopTo {
24
+ $mediaQuery: $mediaQuery + '(' + nth($query, $i) + ': ' + nth($query, $i + 1) + ') ';
25
+
26
+ @if ($i + 1) != $loopTo {
27
+ $mediaQuery: $mediaQuery + 'and ';
28
+ }
29
+
30
+ $i: $i + 2;
36
31
  }
37
- }
38
32
 
39
- @else if length($query) == 5 {
40
- @media screen and (nth($query, 1): nth($query, 2)) and (nth($query, 3): nth($query, 4)) {
41
- $default-grid-columns: $grid-columns;
42
- $grid-columns: nth($query, 5);
33
+ @media #{$mediaQuery} {
43
34
  @content;
44
35
  $grid-columns: $default-grid-columns;
45
36
  }
46
37
  }
47
-
48
- @else {
49
- @warn "Wrong number of arguments for breakpoint(). Read the documentation for more details.";
50
- }
51
38
  }
@@ -9,6 +9,10 @@
9
9
  $direction: get-direction($layout-direction, $default-layout-direction);
10
10
  }
11
11
 
12
+ @if $table {
13
+ @warn "The omega mixin no longer removes padding in table layouts."
14
+ }
15
+
12
16
  @if length($query) == 1 {
13
17
  @if $auto {
14
18
  &:last-child {
@@ -16,14 +20,8 @@
16
20
  }
17
21
  }
18
22
 
19
- @else if contains-display-value($query) {
20
- @if $table {
21
- padding-#{$direction}: 0;
22
- }
23
-
24
- @else {
25
- margin-#{$direction}: 0;
26
- }
23
+ @else if contains-display-value($query) and $table == false {
24
+ margin-#{$direction}: 0;
27
25
  }
28
26
 
29
27
  @else {
@@ -32,30 +30,14 @@
32
30
  }
33
31
 
34
32
  @else if length($query) == 2 {
35
- @if $table {
36
- @if $auto {
37
- &:last-child {
38
- padding-#{$direction}: 0;
39
- }
40
- }
41
-
42
- @else {
43
- &:nth-child(#{nth($query, 1)}) {
44
- padding-#{$direction}: 0;
45
- }
33
+ @if $auto {
34
+ &:last-child {
35
+ margin-#{$direction}: 0;
46
36
  }
47
37
  }
48
38
 
49
39
  @else {
50
- @if $auto {
51
- &:last-child {
52
- margin-#{$direction}: 0;
53
- }
54
- }
55
-
56
- @else {
57
- @include nth-child(nth($query, 1), $direction);
58
- }
40
+ @include nth-child(nth($query, 1), $direction);
59
41
  }
60
42
  }
61
43
 
@@ -41,10 +41,3 @@ $layout-direction: nil !default;
41
41
 
42
42
  @return $display-table;
43
43
  }
44
-
45
- @function get-padding-for-table-layout($columns, $total-columns) {
46
- $total-padding: flex-gutter($total-columns) * ($columns - 1);
47
- $padding: $total-padding / $columns;
48
-
49
- @return $padding;
50
- }
@@ -11,10 +11,8 @@
11
11
  $display-table: is-display-table($container-display-table, $display);
12
12
 
13
13
  @if $display-table {
14
- $padding: get-padding-for-table-layout($columns, $container-columns);
15
14
  display: table-cell;
16
- padding-#{$direction}: $padding;
17
- width: flex-grid($columns, $container-columns) + $padding;
15
+ width: percentage($columns / $container-columns);
18
16
  } @else {
19
17
  float: #{$opposite-direction};
20
18
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neat-compass
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-22 00:00:00.000000000 Z
12
+ date: 2014-04-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: compass