neat-compass 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -9,4 +9,12 @@
9
9
  @import "grid/global-variables";
10
10
  @import "grid/grid";
11
11
  @import "grid/omega";
12
+ @import "grid/outer-container";
13
+ @import "grid/span-columns";
14
+ @import "grid/row";
15
+ @import "grid/shift";
16
+ @import "grid/pad";
17
+ @import "grid/fill-parent";
18
+ @import "grid/media";
19
+ @import "grid/to-deprecate";
12
20
  @import "grid/visual-grid";
@@ -0,0 +1,7 @@
1
+ @mixin fill-parent() {
2
+ width: 100%;
3
+
4
+ @if $border-box-sizing == false {
5
+ @include box-sizing(border-box);
6
+ }
7
+ }
@@ -1 +1,5 @@
1
1
  $parent-columns: $grid-columns !default;
2
+ $fg-column: $column;
3
+ $fg-gutter: $gutter;
4
+ $fg-max-columns: $grid-columns;
5
+ $container-display-table: false !default;
@@ -3,208 +3,3 @@
3
3
  @include box-sizing(border-box);
4
4
  }
5
5
  }
6
-
7
- $fg-column: $column;
8
- $fg-gutter: $gutter;
9
- $fg-max-columns: $grid-columns;
10
- $fg-max-width: $max-width;
11
-
12
- // outer wrapper center container
13
- @mixin outer-container() {
14
- @include clearfix;
15
- max-width: $fg-max-width;
16
- margin: {
17
- left: auto;
18
- right: auto;
19
- }
20
- }
21
-
22
- // Grid span columns
23
- @mixin span-columns($span: $columns of $container-columns, $display: block) {
24
-
25
- $columns: nth($span, 1);
26
- $container-columns: container-span($span);
27
-
28
- @if $container-columns != $grid-columns {
29
- $parent-columns: $container-columns;
30
- }
31
-
32
- @else {
33
- $parent-columns: $grid-columns;
34
- }
35
-
36
- @if $display == table {
37
- display: table-cell;
38
- padding-right: flex-gutter($container-columns);
39
- width: flex-grid($columns, $container-columns) + flex-gutter($container-columns);
40
-
41
- &:last-child {
42
- width: flex-grid($columns, $container-columns);
43
- }
44
- }
45
-
46
- @else if $display == inline-block {
47
- @include inline-block;
48
- margin-right: flex-gutter($container-columns);
49
- width: flex-grid($columns, $container-columns);
50
-
51
- &:last-child {
52
- margin-right: 0;
53
- }
54
- }
55
-
56
- @else {
57
- display: block;
58
- float: left;
59
- margin-right: flex-gutter($container-columns);
60
- width: flex-grid($columns, $container-columns);
61
-
62
- &:last-child {
63
- margin-right: 0;
64
- }
65
- }
66
- }
67
-
68
- // Clearfix / row container
69
- @mixin row($display: block) {
70
- @include clearfix;
71
- @if $display == table {
72
- display: table;
73
- }
74
-
75
- @else {
76
- display: block;
77
- }
78
- }
79
-
80
- // Shift
81
- @mixin shift($n-columns: 1) {
82
- margin-left: $n-columns * flex-grid(1, $parent-columns) + $n-columns * flex-gutter($parent-columns);
83
- }
84
-
85
-
86
- // Pad
87
- @mixin pad($padding: flex-gutter()) {
88
- $padding-list: null;
89
- @each $value in $padding {
90
- $value: if($value == 'default', flex-gutter(), $value);
91
- $padding-list: join($padding-list, $value);
92
- }
93
- padding: $padding-list;
94
- }
95
-
96
- // Fill 100% of parent
97
- @mixin fill-parent() {
98
- width: 100%;
99
-
100
- @if $border-box-sizing == false {
101
- @include box-sizing(border-box);
102
- }
103
- }
104
-
105
- // Media Queries
106
- @mixin media($query:$feature $value $columns, $total-columns: $grid-columns) {
107
-
108
- @if length($query) == 1 {
109
- @media screen and ($default-feature: nth($query, 1)) {
110
- $default-grid-columns: $grid-columns;
111
- $grid-columns: $total-columns;
112
- @content;
113
- $grid-columns: $default-grid-columns;
114
- }
115
- }
116
-
117
- @else if length($query) == 2 {
118
- @media screen and (nth($query, 1): nth($query, 2)) {
119
- $default-grid-columns: $grid-columns;
120
- $grid-columns: $total-columns;
121
- @content;
122
- $grid-columns: $default-grid-columns;
123
- }
124
- }
125
-
126
- @else if length($query) == 3 {
127
- @media screen and (nth($query, 1): nth($query, 2)) {
128
- $default-grid-columns: $grid-columns;
129
- $grid-columns: nth($query, 3);
130
- @content;
131
- $grid-columns: $default-grid-columns;
132
- }
133
- }
134
-
135
- @else if length($query) == 4 {
136
- @media screen and (nth($query, 1): nth($query, 2)) and (nth($query, 3): nth($query, 4)) {
137
- $default-grid-columns: $grid-columns;
138
- $grid-columns: $total-columns;
139
- @content;
140
- $grid-columns: $default-grid-columns;
141
- }
142
- }
143
-
144
- @else if length($query) == 5 {
145
- @media screen and (nth($query, 1): nth($query, 2)) and (nth($query, 3): nth($query, 4)) {
146
- $default-grid-columns: $grid-columns;
147
- $grid-columns: nth($query, 5);
148
- @content;
149
- $grid-columns: $default-grid-columns;
150
- }
151
- }
152
-
153
- @else {
154
- @warn "Wrong number of arguments for breakpoint(). Read the documentation for more details.";
155
- }
156
- }
157
-
158
- // Legacy Mixins
159
- @mixin breakpoint($query:$feature $value $columns, $total-columns: $grid-columns) {
160
- @warn "The breakpoint() mixin was renamed to media() in Neat 1.0. Please update your project with the new syntax before the next version bump.";
161
-
162
- @if length($query) == 1 {
163
- @media screen and ($default-feature: nth($query, 1)) {
164
- $default-grid-columns: $grid-columns;
165
- $grid-columns: $total-columns;
166
- @content;
167
- $grid-columns: $default-grid-columns;
168
- }
169
- }
170
-
171
- @else if length($query) == 2 {
172
- @media screen and (nth($query, 1): nth($query, 2)) {
173
- $default-grid-columns: $grid-columns;
174
- $grid-columns: $total-columns;
175
- @content;
176
- $grid-columns: $default-grid-columns;
177
- }
178
- }
179
-
180
- @else if length($query) == 3 {
181
- @media screen and (nth($query, 1): nth($query, 2)) {
182
- $default-grid-columns: $grid-columns;
183
- $grid-columns: nth($query, 3);
184
- @content;
185
- $grid-columns: $default-grid-columns;
186
- }
187
- }
188
-
189
- @else if length($query) == 4 {
190
- @media screen and (nth($query, 1): nth($query, 2)) and (nth($query, 3): nth($query, 4)) {
191
- $default-grid-columns: $grid-columns;
192
- $grid-columns: $total-columns;
193
- @content;
194
- $grid-columns: $default-grid-columns;
195
- }
196
- }
197
-
198
- @else if length($query) == 5 {
199
- @media screen and (nth($query, 1): nth($query, 2)) and (nth($query, 3): nth($query, 4)) {
200
- $default-grid-columns: $grid-columns;
201
- $grid-columns: nth($query, 5);
202
- @content;
203
- $grid-columns: $default-grid-columns;
204
- }
205
- }
206
-
207
- @else {
208
- @warn "Wrong number of arguments for breakpoint(). Read the documentation for more details.";
209
- }
210
- }
@@ -0,0 +1,51 @@
1
+ @mixin media($query:$feature $value $columns, $total-columns: $grid-columns) {
2
+
3
+ @if length($query) == 1 {
4
+ @media screen and ($default-feature: nth($query, 1)) {
5
+ $default-grid-columns: $grid-columns;
6
+ $grid-columns: $total-columns;
7
+ @content;
8
+ $grid-columns: $default-grid-columns;
9
+ }
10
+ }
11
+
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
+ }
20
+
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;
27
+ }
28
+ }
29
+
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;
36
+ }
37
+ }
38
+
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);
43
+ @content;
44
+ $grid-columns: $default-grid-columns;
45
+ }
46
+ }
47
+
48
+ @else {
49
+ @warn "Wrong number of arguments for breakpoint(). Read the documentation for more details.";
50
+ }
51
+ }
@@ -0,0 +1,8 @@
1
+ @mixin outer-container {
2
+ @include clearfix;
3
+ max-width: $max-width;
4
+ margin: {
5
+ left: auto;
6
+ right: auto;
7
+ }
8
+ }
@@ -0,0 +1,8 @@
1
+ @mixin pad($padding: flex-gutter()) {
2
+ $padding-list: null;
3
+ @each $value in $padding {
4
+ $value: if($value == 'default', flex-gutter(), $value);
5
+ $padding-list: join($padding-list, $value);
6
+ }
7
+ padding: $padding-list;
8
+ }
@@ -0,0 +1,16 @@
1
+ @mixin row($display: block) {
2
+ @include clearfix;
3
+ @if $display == table {
4
+ display: table;
5
+ $container-display-table: true;
6
+ }
7
+
8
+ @else {
9
+ display: block;
10
+ $container-display-table: false;
11
+ }
12
+ }
13
+
14
+ @mixin reset-display {
15
+ $container-display-table: false;
16
+ }
@@ -0,0 +1,6 @@
1
+ @mixin shift($n-columns: 1) {
2
+ margin-left: $n-columns * flex-grid(1, $parent-columns) + $n-columns * flex-gutter($parent-columns);
3
+
4
+ // Reset nesting context
5
+ $parent-columns: $grid-columns;
6
+ }
@@ -0,0 +1,58 @@
1
+ @mixin span-columns($span: $columns of $container-columns, $display: block) {
2
+
3
+ $columns: nth($span, 1);
4
+ $container-columns: container-span($span);
5
+ $display-table: false;
6
+
7
+ @if $container-columns != $grid-columns {
8
+ $parent-columns: $container-columns;
9
+ }
10
+
11
+ @else {
12
+ $parent-columns: $grid-columns;
13
+ }
14
+
15
+ @if $container-display-table == true {
16
+ $display-table: true;
17
+ }
18
+
19
+ @else if $display == table {
20
+ $display-table: true;
21
+ }
22
+
23
+ @else {
24
+ $display-table: false;
25
+ }
26
+
27
+ @if $display-table {
28
+ display: table-cell;
29
+ padding-right: flex-gutter($container-columns);
30
+ width: flex-grid($columns, $container-columns) + flex-gutter($container-columns);
31
+
32
+ &:last-child {
33
+ width: flex-grid($columns, $container-columns);
34
+ padding-right: 0;
35
+ }
36
+ }
37
+
38
+ @else if $display == inline-block {
39
+ @include inline-block;
40
+ margin-right: flex-gutter($container-columns);
41
+ width: flex-grid($columns, $container-columns);
42
+
43
+ &:last-child {
44
+ margin-right: 0;
45
+ }
46
+ }
47
+
48
+ @else {
49
+ display: block;
50
+ float: left;
51
+ margin-right: flex-gutter($container-columns);
52
+ width: flex-grid($columns, $container-columns);
53
+
54
+ &:last-child {
55
+ margin-right: 0;
56
+ }
57
+ }
58
+ }
@@ -0,0 +1,52 @@
1
+ @mixin breakpoint($query:$feature $value $columns, $total-columns: $grid-columns) {
2
+ @warn "The breakpoint() mixin was renamed to media() in Neat 1.0. Please update your project with the new syntax before the next version bump.";
3
+
4
+ @if length($query) == 1 {
5
+ @media screen and ($default-feature: nth($query, 1)) {
6
+ $default-grid-columns: $grid-columns;
7
+ $grid-columns: $total-columns;
8
+ @content;
9
+ $grid-columns: $default-grid-columns;
10
+ }
11
+ }
12
+
13
+ @else if length($query) == 2 {
14
+ @media screen and (nth($query, 1): nth($query, 2)) {
15
+ $default-grid-columns: $grid-columns;
16
+ $grid-columns: $total-columns;
17
+ @content;
18
+ $grid-columns: $default-grid-columns;
19
+ }
20
+ }
21
+
22
+ @else if length($query) == 3 {
23
+ @media screen and (nth($query, 1): nth($query, 2)) {
24
+ $default-grid-columns: $grid-columns;
25
+ $grid-columns: nth($query, 3);
26
+ @content;
27
+ $grid-columns: $default-grid-columns;
28
+ }
29
+ }
30
+
31
+ @else if length($query) == 4 {
32
+ @media screen and (nth($query, 1): nth($query, 2)) and (nth($query, 3): nth($query, 4)) {
33
+ $default-grid-columns: $grid-columns;
34
+ $grid-columns: $total-columns;
35
+ @content;
36
+ $grid-columns: $default-grid-columns;
37
+ }
38
+ }
39
+
40
+ @else if length($query) == 5 {
41
+ @media screen and (nth($query, 1): nth($query, 2)) and (nth($query, 3): nth($query, 4)) {
42
+ $default-grid-columns: $grid-columns;
43
+ $grid-columns: nth($query, 5);
44
+ @content;
45
+ $grid-columns: $default-grid-columns;
46
+ }
47
+ }
48
+
49
+ @else {
50
+ @warn "Wrong number of arguments for breakpoint(). Read the documentation for more details.";
51
+ }
52
+ }
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.1.0
4
+ version: 1.2.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-01-09 00:00:00.000000000 Z
12
+ date: 2013-02-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: compass
@@ -71,9 +71,17 @@ files:
71
71
  - stylesheets/neat/functions/_new-breakpoint.scss
72
72
  - stylesheets/neat/functions/_private.scss
73
73
  - stylesheets/neat/functions/_px-to-em.scss
74
+ - stylesheets/neat/grid/_fill-parent.scss
74
75
  - stylesheets/neat/grid/_global-variables.scss
75
76
  - stylesheets/neat/grid/_grid.scss
77
+ - stylesheets/neat/grid/_media.scss
76
78
  - stylesheets/neat/grid/_omega.scss
79
+ - stylesheets/neat/grid/_outer-container.scss
80
+ - stylesheets/neat/grid/_pad.scss
81
+ - stylesheets/neat/grid/_row.scss
82
+ - stylesheets/neat/grid/_shift.scss
83
+ - stylesheets/neat/grid/_span-columns.scss
84
+ - stylesheets/neat/grid/_to-deprecate.scss
77
85
  - stylesheets/neat/grid/_visual-grid.scss
78
86
  - stylesheets/neat/settings/_grid.scss
79
87
  - stylesheets/neat/settings/_visual-grid.scss