gridle 1.3.1 → 1.3.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0a15e857e053fa9f12b4746ffd22295290cfd783
4
- data.tar.gz: 0b9032f8bdcad96690648f5c0b6e87999825be73
3
+ metadata.gz: 89965d5de0df0540dc4eb00f51534ccac70bd6de
4
+ data.tar.gz: 47dd01c3742b0e03d6dc727719e4862326e76521
5
5
  SHA512:
6
- metadata.gz: ec75f8137a7bae3ecd35045a3ff8939c909dff716573ca63332e9d90f1f2c5fbffa1615875a7fc80a42b1702979c96b51711370977f99d0a89b56029245757d5
7
- data.tar.gz: a052ae5e8d7bdf3702f269e48488a78d9dfa6d597290a19b2424225093f4e4d9989ef7f8775e222be13e04ad98cec0c565654aa9c37a123f087f6235cc817312
6
+ metadata.gz: 21d483f133c01e9d1fa267856a4d2101f9cbccf46c289c9db46240aaae48ccc4fc0ee63716ff8a6403b926d235c8af36ee00e3e95d073bc996e2a7917eaaef81
7
+ data.tar.gz: f27d30d53b4afb407744243ebf20ebb5473afc9ec11ac538979482d2b660b0dd03faf2855c4573e6d5db10cd3fd8b323caf93ecc96c9f5f95ddbbd67d502e261
@@ -16,8 +16,8 @@
16
16
  # a prerelease version
17
17
  # Date is in the form of YYYY-MM-DD
18
18
  module Extension
19
- VERSION = "1.3.1"
20
- DATE = "2014-05-15"
19
+ VERSION = "1.3.2"
20
+ DATE = "2014-05-22"
21
21
  end
22
22
 
23
23
  # This is where any custom SassScript should be placed. The functions will be
@@ -37,7 +37,8 @@
37
37
  direction:ltr;
38
38
  }
39
39
 
40
- padding:0 $gutter-width/2;
40
+ padding-left$gutter-width/2;
41
+ padding-right:$gutter-width/2;
41
42
  }
42
43
 
43
44
  @if $debug == true {
@@ -44,7 +44,7 @@
44
44
  $stateMap-or-stateName
45
45
  ) {
46
46
  // check if has a state named like this :
47
- @if (map-has-key($_gridle_states, $stateMap-or-stateName))
47
+ @if (map-has-key($_gridle_states, unquote($stateMap-or-stateName)))
48
48
  {
49
49
  @return map-get($_gridle_states, unquote($stateMap-or-stateName));
50
50
  }
@@ -228,22 +228,34 @@
228
228
  @if $var == '%count' and $count {
229
229
  $sel : "#{$sel}#{$count}";
230
230
  }
231
- @if $var != '%state' and $var != '%count' and $var != '%-' and $var != '%prefix' {
231
+ @if $var != '%state' and $var != '%count' and $var != '%-' and $var != '-' and $var != '--' and $var != '_' and $var != '__' and $var != '%prefix' {
232
232
  $sel : "#{$sel}#{$var}";
233
233
  }
234
234
 
235
235
  // handle separators :
236
- @if $var == '%-' and $i < length($pattern) {
236
+ @if ($var == '%-' or $var == '-' or $var == '--' or $var == '_' or $var == '__') and $i < length($pattern) {
237
237
  $index : $i + 1;
238
238
  $value : nth($pattern, $index);
239
- @if $value != '%state' and $value != '%count' and $value != '%-' and $value != '%prefix' {
240
- $sel : "#{$sel}#{$gridle-class-separator}";
239
+ @if $value != '%state' and $value != '%count' and $value != '%-' and $value != '-' and $value != '--' and $value != '_' and $value != '__' and $value != '%prefix' {
240
+ @if $var == '%-' {
241
+ $sel : "#{$sel}#{$gridle-class-separator}";
242
+ } @else {
243
+ $sel : "#{$sel}#{$var}";
244
+ }
241
245
  }
242
246
  @if $value == '%state' and $state {
243
- $sel : "#{$sel}#{$gridle-class-separator}";
247
+ @if $var == '%-' {
248
+ $sel : "#{$sel}#{$gridle-class-separator}";
249
+ } @else {
250
+ $sel : "#{$sel}#{$var}";
251
+ }
244
252
  }
245
253
  @if $value == '%count' and $count {
246
- $sel : "#{$sel}#{$gridle-class-separator}";
254
+ @if $var == '%-' {
255
+ $sel : "#{$sel}#{$gridle-class-separator}";
256
+ } @else {
257
+ $sel : "#{$sel}#{$var}";
258
+ }
247
259
  }
248
260
  }
249
261
 
@@ -4,111 +4,188 @@
4
4
  // |------------------------------------------------------
5
5
  // |------------------------------------------------------
6
6
 
7
+
8
+ /**
9
+ * Generate a custom class for all the states
10
+ *
11
+ * @param list $pattern The name pattern of the class
12
+ * @param list $statesNames The states names to generate
13
+ */
14
+ @mixin gridle_generate_custom_class(
15
+ $pattern,
16
+ $statesNames : null
17
+ ) {
18
+ // manage states to generate :
19
+ $states : ();
20
+ @if $statesNames == null {
21
+ // loop on each states to generate names list :
22
+ @each $stateName, $state in $_gridle_states {
23
+ $states : append($states, $stateName);
24
+ }
25
+ } @else {
26
+ $states : $statesNames;
27
+ }
28
+
29
+ // loop on each states :
30
+ @each $stateName in $states
31
+ {
32
+ // manage statename :
33
+ @if type-of($stateName) != string {
34
+ $stateName : map-get($stateName, name);
35
+ }
36
+
37
+ // genrate the classname :
38
+ @include gridle_state($stateName, false) {
39
+ #{_gridle_classname($pattern, $stateName)} {
40
+ @content;
41
+ }
42
+ }
43
+ }
44
+ }
45
+
7
46
  // Generate all helpers classes
8
47
  // All the classes generated are not wrapper in gridle_state
9
48
  // in this mixin... Just the names are generated accordingly to the
10
49
  // requested state
11
50
  @mixin _gridle_generate_helper_classes (
12
- $state : null
51
+ $state : null,
52
+ $what : null
13
53
  ) {
14
54
  // helpers :
15
- #{_gridle_classname($gridle-hide-name-pattern, $state)} {
16
- @include gridle_hide(null);
17
- }
18
- #{_gridle_classname($gridle-not-visible-name-pattern, $state)} {
19
- @include gridle_not_visible(null);
20
- }
21
- #{_gridle_classname($gridle-show-name-pattern, $state)} {
22
- @include gridle_show(null);
23
- }
24
- #{_gridle_classname($gridle-visible-name-pattern, $state)} {
25
- @include gridle_visible(null);
26
- }
27
- #{_gridle_classname($gridle-float-left-name-pattern, $state)} {
28
- @include gridle_float(left);
29
- }
30
- #{_gridle_classname($gridle-float-right-name-pattern, $state)} {
31
- @include gridle_float(right);
32
- }
33
- #{_gridle_classname($gridle-clear-name-pattern, $state)} {
34
- @include gridle_clear(both);
35
- }
36
- #{_gridle_classname($gridle-clear-left-name-pattern, $state)} {
37
- @include gridle_clear(left);
38
- }
39
- #{_gridle_classname($gridle-clear-right-name-pattern, $state)} {
40
- @include gridle_clear(right);
41
- }
42
- #{_gridle_classname($gridle-no-gutter-name-pattern, $state)},
43
- #{_gridle_classname($gridle-no-margin-name-pattern, $state)} {
44
- @include gridle_no_margin();
45
- }
46
- #{_gridle_classname($gridle-no-gutter-left-name-pattern, $state)},
47
- #{_gridle_classname($gridle-no-margin-left-name-pattern, $state)} {
48
- @include gridle_no_margin(left);
49
- }
50
- #{_gridle_classname($gridle-no-gutter-right-name-pattern, $state)},
51
- #{_gridle_classname($gridle-no-margin-right-name-pattern, $state)} {
52
- @include gridle_no_margin(right);
53
- }
54
- #{_gridle_classname($gridle-no-gutter-top-name-pattern, $state)},
55
- #{_gridle_classname($gridle-no-margin-top-name-pattern, $state)} {
56
- @include gridle_no_margin(top);
57
- }
58
- #{_gridle_classname($gridle-no-gutter-bottom-name-pattern, $state)},
59
- #{_gridle_classname($gridle-no-margin-bottom-name-pattern, $state)} {
60
- @include gridle_no_margin(bottom);
55
+ @if $what == null or index($what, hide) or index($what, helpers) {
56
+ #{_gridle_classname($gridle-hide-name-pattern, $state)} {
57
+ @include gridle_hide(null);
58
+ }
61
59
  }
62
- #{_gridle_classname($gridle-gutter-name-pattern, $state)},
63
- #{_gridle_classname($gridle-margin-name-pattern, $state)} {
64
- @include gridle_margin(left right);
60
+
61
+ @if $what == null or index($what, not_visible) or index($what, helpers) {
62
+ #{_gridle_classname($gridle-not-visible-name-pattern, $state)} {
63
+ @include gridle_not_visible(null);
64
+ }
65
65
  }
66
- #{_gridle_classname($gridle-gutter-left-name-pattern, $state)},
67
- #{_gridle_classname($gridle-margin-left-name-pattern, $state)} {
68
- @include gridle_margin(left);
66
+
67
+ @if $what == null or index($what, show) or index($what, helpers) {
68
+ #{_gridle_classname($gridle-show-name-pattern, $state)} {
69
+ @include gridle_show(null);
70
+ }
69
71
  }
70
- #{_gridle_classname($gridle-gutter-right-name-pattern, $state)},
71
- #{_gridle_classname($gridle-margin-right-name-pattern, $state)} {
72
- @include gridle_margin(right);
72
+
73
+ @if $what == null or index($what, visible) or index($what, helpers) {
74
+ #{_gridle_classname($gridle-visible-name-pattern, $state)} {
75
+ @include gridle_visible(null);
76
+ }
73
77
  }
74
- #{_gridle_classname($gridle-gutter-top-name-pattern, $state)},
75
- #{_gridle_classname($gridle-margin-top-name-pattern, $state)} {
76
- @include gridle_margin(top);
78
+
79
+ @if $what == null or index($what, float) or index($what, helpers) {
80
+ #{_gridle_classname($gridle-float-left-name-pattern, $state)} {
81
+ @include gridle_float(left);
82
+ }
83
+ #{_gridle_classname($gridle-float-right-name-pattern, $state)} {
84
+ @include gridle_float(right);
85
+ }
77
86
  }
78
- #{_gridle_classname($gridle-gutter-bottom-name-pattern, $state)},
79
- #{_gridle_classname($gridle-margin-bottom-name-pattern, $state)} {
80
- @include gridle_margin(bottom);
87
+
88
+ @if $what == null or index($what, clear) or index($what, helpers) {
89
+ #{_gridle_classname($gridle-clear-name-pattern, $state)} {
90
+ @include gridle_clear(both);
91
+ }
92
+ #{_gridle_classname($gridle-clear-left-name-pattern, $state)} {
93
+ @include gridle_clear(left);
94
+ }
95
+ #{_gridle_classname($gridle-clear-right-name-pattern, $state)} {
96
+ @include gridle_clear(right);
97
+ }
81
98
  }
82
- #{_gridle_classname($gridle-auto-height-name-pattern, $state)} {
83
- height:inherit;
99
+
100
+ @if $what == null or index($what, no_gutter) or index($what, no_margin) or index($what, helpers) {
101
+ #{_gridle_classname($gridle-no-gutter-name-pattern, $state)},
102
+ #{_gridle_classname($gridle-no-margin-name-pattern, $state)} {
103
+ @include gridle_no_margin();
104
+ }
105
+ #{_gridle_classname($gridle-no-gutter-left-name-pattern, $state)},
106
+ #{_gridle_classname($gridle-no-margin-left-name-pattern, $state)} {
107
+ @include gridle_no_margin(left);
108
+ }
109
+ #{_gridle_classname($gridle-no-gutter-right-name-pattern, $state)},
110
+ #{_gridle_classname($gridle-no-margin-right-name-pattern, $state)} {
111
+ @include gridle_no_margin(right);
112
+ }
113
+ #{_gridle_classname($gridle-no-gutter-top-name-pattern, $state)},
114
+ #{_gridle_classname($gridle-no-margin-top-name-pattern, $state)} {
115
+ @include gridle_no_margin(top);
116
+ }
117
+ #{_gridle_classname($gridle-no-gutter-bottom-name-pattern, $state)},
118
+ #{_gridle_classname($gridle-no-margin-bottom-name-pattern, $state)} {
119
+ @include gridle_no_margin(bottom);
120
+ }
84
121
  }
85
- #{_gridle_classname($gridle-centered-name-pattern, $state)} {
86
- @include gridle_centered(null);
122
+
123
+ @if $what == null or index($what, gutter) or index($what, margin) or index($what, helpers) {
124
+ #{_gridle_classname($gridle-gutter-name-pattern, $state)},
125
+ #{_gridle_classname($gridle-margin-name-pattern, $state)} {
126
+ @include gridle_margin(left right);
127
+ }
128
+ #{_gridle_classname($gridle-gutter-left-name-pattern, $state)},
129
+ #{_gridle_classname($gridle-margin-left-name-pattern, $state)} {
130
+ @include gridle_margin(left);
131
+ }
132
+ #{_gridle_classname($gridle-gutter-right-name-pattern, $state)},
133
+ #{_gridle_classname($gridle-margin-right-name-pattern, $state)} {
134
+ @include gridle_margin(right);
135
+ }
136
+ #{_gridle_classname($gridle-gutter-top-name-pattern, $state)},
137
+ #{_gridle_classname($gridle-margin-top-name-pattern, $state)} {
138
+ @include gridle_margin(top);
139
+ }
140
+ #{_gridle_classname($gridle-gutter-bottom-name-pattern, $state)},
141
+ #{_gridle_classname($gridle-margin-bottom-name-pattern, $state)} {
142
+ @include gridle_margin(bottom);
143
+ }
87
144
  }
88
- #{_gridle_classname($gridle-parent-name-pattern, $state)} {
89
- @include _gridle_parent();
145
+
146
+ @if $what == null or index($what, auto_height) or index($what, helpers) {
147
+ #{_gridle_classname($gridle-auto-height-name-pattern, $state)} {
148
+ height:inherit;
149
+ }
90
150
  }
91
- #{_gridle_classname($gridle-vertical-align-middle-name-pattern, $state)} {
92
- @include _gridle_vertical_align();
151
+
152
+ @if $what == null or index($what, centered) or index($what, helpers) {
153
+ #{_gridle_classname($gridle-centered-name-pattern, $state)} {
154
+ @include gridle_centered(null);
155
+ }
93
156
  }
94
- #{_gridle_classname($gridle-vertical-align-top-name-pattern, $state)} {
95
- @include _gridle_vertical_align(top);
157
+
158
+ @if $what == null or index($what, parent) or index($what, helpers) {
159
+ #{_gridle_classname($gridle-parent-name-pattern, $state)} {
160
+ @include _gridle_parent();
161
+ }
96
162
  }
97
- #{_gridle_classname($gridle-vertical-align-bottom-name-pattern, $state)} {
98
- @include _gridle_vertical_align(bottom);
163
+
164
+ @if $what == null or index($what, vertical_align) or index($what, helpers) {
165
+ #{_gridle_classname($gridle-vertical-align-middle-name-pattern, $state)} {
166
+ @include _gridle_vertical_align();
167
+ }
168
+ #{_gridle_classname($gridle-vertical-align-top-name-pattern, $state)} {
169
+ @include _gridle_vertical_align(top);
170
+ }
171
+ #{_gridle_classname($gridle-vertical-align-bottom-name-pattern, $state)} {
172
+ @include _gridle_vertical_align(bottom);
173
+ }
99
174
  }
100
175
 
101
176
  /**
102
177
  * Clear each class :
103
178
  */
104
- @each $clearName, $clearMap in $_gridle_clear_classes {
105
- // get count :
106
- $clearCount : map-get($clearMap, clearEach);
107
- // what to clear :
108
- $clearWhat : map-get($clearMap, clearWhat);
109
- // generate the class :
110
- #{_gridle_classname($gridle-clear-each-pattern, $state, $clearCount)} {
111
- @include _gridle_clear_each($clearCount, $clearWhat, $state);
179
+ @if $what == null or index($what, clear_each) or index($what, helpers) {
180
+ @each $clearName, $clearMap in $_gridle_clear_classes {
181
+ // get count :
182
+ $clearCount : map-get($clearMap, clearEach);
183
+ // what to clear :
184
+ $clearWhat : map-get($clearMap, clearWhat);
185
+ // generate the class :
186
+ #{_gridle_classname($gridle-clear-each-pattern, $state, $clearCount)} {
187
+ @include _gridle_clear_each($clearCount, $clearWhat, $state);
188
+ }
112
189
  }
113
190
  }
114
191
 
@@ -151,14 +228,14 @@
151
228
 
152
229
 
153
230
  // generate settings json :
154
- @mixin gridle_generate_json_settings(
155
- $scope : default
156
- ) {
231
+ @mixin gridle_generate_json_settings() {
157
232
 
158
233
  // settings content :
159
234
  $gridle-settings-states : "{";
160
235
 
161
236
  // generate all classes for differents media queries :
237
+ $statesCount : length($_gridle_states);
238
+ $i : 0;
162
239
  @each $stateName, $state in $_gridle_states {
163
240
 
164
241
  $name : $stateName;
@@ -169,22 +246,30 @@
169
246
 
170
247
  $value : null;
171
248
  @if $varName == "query" {
172
- $value : _gridle_get_media_query_for_state($stateName);
249
+ $value : _gridle_get_media_query($stateName);
173
250
  } @else {
174
251
  $value : map-get($state,$varName);
175
- // $value : _gridle_get_state_var($i,$var);
176
252
  }
177
253
 
178
254
  @if $value == null {
179
255
  $gridle-settings-states : "#{$gridle-settings-states} \"#{$varName}\" : null,";
180
- } @elseif $var == 'context' or $var == 'classes' {
256
+ } @elseif type-of($value) == bool {
181
257
  $gridle-settings-states : "#{$gridle-settings-states} \"#{$varName}\" : #{$value},";
182
258
  } @else {
183
259
  $gridle-settings-states : "#{$gridle-settings-states} \"#{$varName}\" : \"#{$value}\",";
184
260
  }
185
261
  }
186
262
 
187
- $gridle-settings-states : "#{$gridle-settings-states} },";
263
+ $gridle-settings-states : "#{$gridle-settings-states} \"_gridle\" : true";
264
+
265
+ @if $i >= $statesCount - 1 {
266
+ $gridle-settings-states : "#{$gridle-settings-states} }";
267
+ } @else {
268
+ $gridle-settings-states : "#{$gridle-settings-states} },";
269
+ }
270
+
271
+ // update i :
272
+ $i : $i + 1;
188
273
 
189
274
  }
190
275
 
@@ -201,25 +286,12 @@
201
286
  @if length($_gridle_states_debug_devices) <= 0 {
202
287
  $debug_devices : null;
203
288
  }
204
- $gridle-settings : "#{$gridle-settings}, \"debugDevices\" : { #{$debug_devices} }";
289
+ // $gridle-settings : "#{$gridle-settings}, \"debugDevices\" : { #{$debug_devices} }";
205
290
 
206
291
  // settings :
207
- $gridle-settings : "#{$gridle-settings}, \"columnsCount\" : #{$gridle-columns-count}";
208
- $gridle-settings : "#{$gridle-settings}, \"gutterWidth\" : \"#{$gridle-gutter-width}\"";
209
- $gridle-settings : "#{$gridle-settings}, \"nameMultiplicator\" : #{$gridle-name-multiplicator}";
210
- $gridle-settings : "#{$gridle-settings}, \"direction\" : \"#{$gridle-direction}\"";
211
- $gridle-settings : "#{$gridle-settings}, \"ie7Support\" : #{$gridle-ie7-support}";
212
- $gridle-settings : "#{$gridle-settings}, \"debug\" : #{$gridle-debug}";
213
- $gridle-settings : "#{$gridle-settings}, \"debugShowClassNames\" : #{$gridle-debug-show-class-names}";
214
- $gridle-settings : "#{$gridle-settings}, \"htmlStatesClasses\" : #{$gridle-html-states-classes}";
215
- $gridle-settings : "#{$gridle-settings}, \"generateHelpersClasses\" : #{$gridle-generate-helpers-classes}";
216
- $gridle-settings : "#{$gridle-settings}, \"generatePushClasses\" : #{$gridle-generate-push-classes}";
217
- $gridle-settings : "#{$gridle-settings}, \"generatePullClasses\" : #{$gridle-generate-pull-classes}";
218
- $gridle-settings : "#{$gridle-settings}, \"generatePrefixClasses\" : #{$gridle-generate-prefix-classes}";
219
- $gridle-settings : "#{$gridle-settings}, \"generateSuffixClasses\" : #{$gridle-generate-suffix-classes}";
220
- $gridle-settings : "#{$gridle-settings}, \"classPrefix\" : \"#{$gridle-class-prefix}\"";
292
+ // $gridle-settings : "#{$gridle-settings}, \"classPrefix\" : \"#{$gridle-class-prefix}\"";
221
293
  $gridle-settings : "#{$gridle-settings} }";
222
- #gridle-settings-#{$scope} {
294
+ #gridle-settings {
223
295
  content : $gridle-settings;
224
296
  }
225
297
  }
@@ -228,62 +300,100 @@
228
300
  // gridle mixin :
229
301
  // Generate all the classes needed for a grid
230
302
  @mixin gridle_generate_classes(
303
+ $stateName : null,
304
+ $what : null,
231
305
  $scope : null
232
306
  ) {
233
307
  // check if a scope exist :
234
308
  @if $scope {
235
309
  // wrapp grid into scope :
236
310
  .#{$scope} {
237
- @include _gridle_generate_classes(true);
311
+ @include _gridle_generate_classes($stateName, $what, true);
238
312
  }
239
313
  } @else {
240
314
  // generate classes :
241
- @include _gridle_generate_classes(false);
315
+ @include _gridle_generate_classes($stateName, $what, false);
242
316
  }
243
317
  }
318
+ $_gridle_generateOnlyOnce : true; // keep track of generate once classes
244
319
  @mixin _gridle_generate_classes(
245
- $has-parent
320
+ $stateName : null,
321
+ $what : null,
322
+ $has-parent : false
246
323
  ) {
247
324
 
248
- // | ------------------------
249
- // | Windows 8 fix
250
- // | ------------------------
251
-
252
- // Windows 8 fix for snap mode :
253
- @media screen and (max-width: 400px) {
254
- @-ms-viewport { width: device-width; }
255
- }
325
+ // generate these classes only once :
326
+ @if $_gridle_generateOnlyOnce
327
+ {
256
328
 
329
+ // update status :
330
+ $_gridle_generateOnlyOnce : false;
331
+
332
+ // | ------------------------
333
+ // | Windows 8 fix
334
+ // | ------------------------
335
+
336
+ // Windows 8 fix for snap mode :
337
+ @media screen and (max-width: 400px) {
338
+ @-ms-viewport { width: device-width; }
339
+ }
340
+
341
+
342
+ // | ------------------------
343
+ // | Container
344
+ // | ------------------------
345
+
346
+ // generate container class :
347
+ @if $what == null or index($what, container)
348
+ {
349
+ $container-selector : ();
350
+ $container-selector : append( $container-selector, unquote(_gridle_classname($gridle-container-name-pattern)), comma);
351
+ #{$container-selector} {
352
+ @include gridle_container();
353
+ }
354
+ }
355
+
356
+
357
+ // | ------------------------
358
+ // | Parent selector
359
+ // | ------------------------
360
+
361
+ // parent common css :
362
+ @if $what == null or index($what, parent)
363
+ {
364
+ $parentSelector : _gridle_classname($gridle-parent-name-pattern,null,null);
365
+ #{$parentSelector} {
366
+ @extend %gridle-clearfix;
367
+ @extend %gridle-parent-common;
368
+ }
369
+ }
370
+
371
+
372
+ // // | ------------------------
373
+ // // | JSON Settings
374
+ // // | ------------------------
375
+
376
+ // // generate json settings :
377
+ @include gridle_generate_json_settings();
257
378
 
258
- // | ------------------------
259
- // | Container
260
- // | ------------------------
261
-
262
- // generate container class :
263
- $container-selector : ();
264
- $container-selector : append( $container-selector, unquote(_gridle_classname($gridle-container-name-pattern)), comma);
265
- #{$container-selector} {
266
- @include gridle_container();
267
379
  }
268
380
 
269
381
 
270
382
  // | ------------------------
271
- // | Parent selector
383
+ // | Set the list of states to generate
272
384
  // | ------------------------
273
-
274
- // parent common css :
275
- $parentSelector : _gridle_classname($gridle-parent-name-pattern,null,null);
276
- #{$parentSelector} {
277
- @extend %gridle-clearfix;
278
- @extend %gridle-parent-common;
385
+ $states : $_gridle_states;
386
+ @if $stateName and _gridle_has_state($stateName) {
387
+ $states : map-set((), $stateName, _gridle_get_state($stateName));
279
388
  }
280
389
 
390
+
281
391
  // | ------------------------
282
392
  // | Store all the generated common selectors
283
393
  // | ------------------------
284
394
 
285
395
  // generate all selector for extends :
286
- $common-selector : ();
396
+ $grid-common-selector : ();
287
397
  $push-common-selector : ();
288
398
  $pull-common-selector : ();
289
399
  $prefix-common-selector : ();
@@ -295,7 +405,7 @@
295
405
  // | ------------------------
296
406
 
297
407
  // generate all classes for media queries :
298
- @each $stateName, $state in $_gridle_states {
408
+ @each $stateName, $state in $states {
299
409
 
300
410
  // setup vars :
301
411
  $media : $stateName;
@@ -330,17 +440,19 @@
330
440
  @each $columnName, $column in $columnsMap {
331
441
 
332
442
  // add selector :
333
- $common-selector : append( $common-selector, unquote(_gridle_classname($gridle-grid-name-pattern, $media, $columnName)), comma );
334
- @if $generate-push-classes {
443
+ @if $what == null or index($what, grid) {
444
+ $grid-common-selector : append( $grid-common-selector, unquote(_gridle_classname($gridle-grid-name-pattern, $media, $columnName)), comma );
445
+ }
446
+ @if $generate-push-classes and ($what == null or index($what, push)) {
335
447
  $push-common-selector : append( $push-common-selector, unquote(_gridle_classname($gridle-push-name-pattern, $media, $columnName)), comma );
336
448
  }
337
- @if $generate-pull-classes {
449
+ @if $generate-pull-classes and ($what == null or index($what, pull)) {
338
450
  $pull-common-selector : append( $pull-common-selector, unquote(_gridle_classname($gridle-pull-name-pattern, $media, $columnName)), comma );
339
451
  }
340
- @if $generate-prefix-classes {
452
+ @if $generate-prefix-classes and ($what == null or index($what, prefix)) {
341
453
  $prefix-common-selector : append( $prefix-common-selector, unquote(_gridle_classname($gridle-prefix-name-pattern, $media, $columnName)), comma );
342
454
  }
343
- @if $generate-suffix-classes {
455
+ @if $generate-suffix-classes and ($what == null or index($what, suffix)) {
344
456
  $suffix-common-selector : append( $suffix-common-selector, unquote(_gridle_classname($gridle-suffix-name-pattern, $media, $columnName)), comma );
345
457
  }
346
458
  }
@@ -348,20 +460,30 @@
348
460
  }
349
461
 
350
462
  // common css :
351
- #{$push-common-selector} {
352
- @include _gridle_push_common();
463
+ @if $what == null or index($what, grid) {
464
+ #{$grid-common-selector} {
465
+ @include _gridle_grid_common();
466
+ }
353
467
  }
354
- #{$pull-common-selector} {
355
- @include _gridle_pull_common();
468
+ @if $what == null or index($what, push) {
469
+ #{$push-common-selector} {
470
+ @include _gridle_push_common();
471
+ }
356
472
  }
357
- #{$prefix-common-selector} {
358
- @include _gridle_prefix_common();
473
+ @if $what == null or index($what, pull) {
474
+ #{$pull-common-selector} {
475
+ @include _gridle_pull_common();
476
+ }
359
477
  }
360
- #{$suffix-common-selector} {
361
- @include _gridle_suffix_common();
478
+ @if $what == null or index($what, prefix) {
479
+ #{$prefix-common-selector} {
480
+ @include _gridle_prefix_common();
481
+ }
362
482
  }
363
- #{$common-selector} {
364
- @include _gridle_grid_common();
483
+ @if $what == null or index($what, suffix) {
484
+ #{$suffix-common-selector} {
485
+ @include _gridle_suffix_common();
486
+ }
365
487
  }
366
488
 
367
489
 
@@ -370,7 +492,7 @@
370
492
  // | ------------------------
371
493
 
372
494
  // generate all classes for differents media queries :
373
- @each $stateName, $state in $_gridle_states {
495
+ @each $stateName, $state in $states {
374
496
 
375
497
  // setup vars :
376
498
  $classes : _gridle_get_var_value(classes, $state);
@@ -424,25 +546,27 @@
424
546
  ));
425
547
 
426
548
  // classes :
427
- #{_gridle_classname($gridle-grid-name-pattern, $stateName, $columnName)} {
428
- @include _gridle($columnsCount, $extendedState);
549
+ @if $what == null or index($what, grid) {
550
+ #{_gridle_classname($gridle-grid-name-pattern, $stateName, $columnName)} {
551
+ @include _gridle($columnsCount, $extendedState);
552
+ }
429
553
  }
430
- @if $generate-push-classes == true {
554
+ @if $generate-push-classes == true and ($what == null or index($what, push)) {
431
555
  #{_gridle_classname($gridle-push-name-pattern, $stateName, $columnName)} {
432
556
  @include _gridle_push($columnsCount, $extendedState);
433
557
  }
434
558
  }
435
- @if $generate-pull-classes == true {
559
+ @if $generate-pull-classes == true and ($what == null or index($what, pull)) {
436
560
  #{_gridle_classname($gridle-pull-name-pattern, $stateName, $columnName)} {
437
561
  @include _gridle_pull($columnsCount, $extendedState);
438
562
  }
439
563
  }
440
- @if $generate-prefix-classes == true {
564
+ @if $generate-prefix-classes == true and ($what == null or index($what, prefix)) {
441
565
  #{_gridle_classname($gridle-prefix-name-pattern, $stateName, $columnName)} {
442
566
  @include _gridle_prefix($columnsCount, $extendedState);
443
567
  }
444
568
  }
445
- @if $generate-suffix-classes == true {
569
+ @if $generate-suffix-classes == true and ($what == null or index($what, suffix)) {
446
570
  #{_gridle_classname($gridle-suffix-name-pattern, $stateName, $columnName)} {
447
571
  @include _gridle_suffix($columnsCount, $extendedState);
448
572
  }
@@ -451,17 +575,9 @@
451
575
 
452
576
  // media queries helpers classes :
453
577
  @if $generate-helpers-classes == true {
454
- @include _gridle_generate_helper_classes($stateName);
578
+ @include _gridle_generate_helper_classes($stateName, $what);
455
579
  }
456
580
  }
457
581
  }
458
582
  }
459
-
460
-
461
- // // | ------------------------
462
- // // | JSON Settings
463
- // // | ------------------------
464
-
465
- // // generate json settings :
466
- // @include gridle_generate_json_settings();
467
583
  }
@@ -29,13 +29,13 @@
29
29
  // |------------------------------------------------------
30
30
  // |------------------------------------------------------
31
31
  // @created 25.03.13
32
- // @updated 15.05.14
32
+ // @updated 21.05.14
33
33
  // @author Olivier Bossel <olivier.bossel@gmail.com>
34
- // @version 1.3.1
34
+ // @version 1.3.2
35
35
  // |------------------------------------------------------
36
36
  // |------------------------------------------------------
37
37
 
38
- $_gridle-version : "1.3.1";
38
+ $_gridle-version : "1.3.2";
39
39
 
40
40
 
41
41
 
@@ -100,7 +100,7 @@
100
100
  $state : null
101
101
  ) {
102
102
  // common :
103
- @include _gridle_grid_common($state);
103
+ @include _gridle_grid_common();
104
104
  // check if need media query :
105
105
  @if $state {
106
106
  @include gridle_state($state) {
@@ -492,6 +492,7 @@
492
492
  $align : middle
493
493
  ) {
494
494
  font-size:0;
495
+ clear:both;
495
496
 
496
497
  > * {
497
498
  display:inline-block;
@@ -11,6 +11,7 @@
11
11
  $settings : ()
12
12
  ) {
13
13
  $_gridle-settings : map-merge((
14
+ name : default,
14
15
  min-width : null,
15
16
  max-width : 99999999px,
16
17
  query : null,
@@ -54,7 +55,7 @@
54
55
  /**
55
56
  * Register a clear each class
56
57
  */
57
- @mixin gridle_register_clear_each (
58
+ @mixin gridle_register_clear_each(
58
59
  $count,
59
60
  $clearWhat
60
61
  ) {
@@ -65,7 +65,6 @@
65
65
  -webkit-box-sizing: border-box;
66
66
  -moz-box-sizing: border-box;
67
67
  box-sizing: border-box;
68
- clear:both;
69
68
  }
70
69
  %gridle-container-debug-common {
71
70
  background-color:#f5f5f5;
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gridle
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Olivier Bossel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-15 00:00:00.000000000 Z
11
+ date: 2014-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sass