neat-compass 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -56,14 +56,14 @@
56
56
 
57
57
  @for $i from 1 to $grid-columns*2 {
58
58
  @if is-even($i) {
59
- $values: append($values, $transparent $column-offset);
60
- $values: append($values, $color $column-offset);
59
+ $values: append($values, $transparent $column-offset, comma);
60
+ $values: append($values, $color $column-offset, comma);
61
61
  $column-offset: $column-offset + $column-width;
62
62
  }
63
63
 
64
64
  @else {
65
- $values: append($values, $color $column-offset);
66
- $values: append($values, $transparent $column-offset);
65
+ $values: append($values, $color $column-offset, comma);
66
+ $values: append($values, $transparent $column-offset, comma);
67
67
  $column-offset: $column-offset + $gutter-width;
68
68
  }
69
69
  }
@@ -19,3 +19,32 @@ $layout-direction: nil !default;
19
19
  @function grid-width($n) {
20
20
  @return $n * $gw-column + ($n - 1) * $gw-gutter;
21
21
  }
22
+
23
+ @function get-parent-columns($columns) {
24
+ @if $columns != $grid-columns {
25
+ $parent-columns: $columns;
26
+ } @else {
27
+ $parent-columns: $grid-columns;
28
+ }
29
+
30
+ @return $parent-columns;
31
+ }
32
+
33
+ @function is-display-table($container-is-display-table, $display) {
34
+ $display-table: false;
35
+
36
+ @if $container-is-display-table == true {
37
+ $display-table: true;
38
+ } @else if $display == table {
39
+ $display-table: true;
40
+ }
41
+
42
+ @return $display-table;
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
+ }
@@ -1,5 +1,4 @@
1
1
  @mixin shift($n-columns: 1) {
2
-
3
2
  $direction: get-direction($layout-direction, $default-layout-direction);
4
3
  $opposite-direction: get-opposite-direction($direction);
5
4
 
@@ -1,45 +1,38 @@
1
1
  @mixin span-columns($span: $columns of $container-columns, $display: block) {
2
-
3
2
  $columns: nth($span, 1);
4
3
  $container-columns: container-span($span);
5
- $display-table: false;
4
+
5
+ // Set nesting context (used by shift())
6
+ $parent-columns: get-parent-columns($container-columns);
6
7
 
7
8
  $direction: get-direction($layout-direction, $default-layout-direction);
8
9
  $opposite-direction: get-opposite-direction($direction);
9
10
 
10
- @if $container-columns != $grid-columns {
11
- $parent-columns: $container-columns;
12
- } @else {
13
- $parent-columns: $grid-columns;
14
- }
15
-
16
- @if $container-display-table == true {
17
- $display-table: true;
18
- } @else if $display == table {
19
- $display-table: true;
20
- } @else {
21
- $display-table: false;
22
- }
11
+ $display-table: is-display-table($container-display-table, $display);
23
12
 
24
13
  @if $display-table {
14
+ $padding: get-padding-for-table-layout($columns, $container-columns);
25
15
  display: table-cell;
26
- padding-#{$direction}: flex-gutter($container-columns);
27
- width: flex-grid($columns, $container-columns) + flex-gutter($container-columns);
28
-
29
- &:last-child {
30
- width: flex-grid($columns, $container-columns);
31
- padding-#{$direction}: 0;
32
- }
33
- }
34
-
35
- @else {
16
+ padding-#{$direction}: $padding;
17
+ width: flex-grid($columns, $container-columns) + $padding;
18
+ } @else {
36
19
  display: block;
37
20
  float: #{$opposite-direction};
38
- margin-#{$direction}: flex-gutter($container-columns);
39
- width: flex-grid($columns, $container-columns);
40
21
 
41
- &:last-child {
42
- margin-#{$direction}: 0;
22
+ @if $display == collapse {
23
+ width: flex-grid($columns, $container-columns) + flex-gutter($container-columns);
24
+
25
+ &:last-child {
26
+ width: flex-grid($columns, $container-columns);
27
+ }
28
+
29
+ } @else {
30
+ margin-#{$direction}: flex-gutter($container-columns);
31
+ width: flex-grid($columns, $container-columns);
32
+
33
+ &:last-child {
34
+ margin-#{$direction}: 0;
35
+ }
43
36
  }
44
37
  }
45
38
  }
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.3.0
4
+ version: 1.4.0
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-05-08 00:00:00.000000000 Z
12
+ date: 2013-08-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: compass
@@ -86,7 +86,7 @@ files:
86
86
  - stylesheets/neat/grid/_visual-grid.scss
87
87
  - stylesheets/neat/settings/_grid.scss
88
88
  - stylesheets/neat/settings/_visual-grid.scss
89
- homepage: https://github.com/thoughtbot/neat
89
+ homepage: https://github.com/jedfoster/neat-compass
90
90
  licenses: []
91
91
  post_install_message:
92
92
  rdoc_options: []