gridle 1.3.36 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5d68396f1c693b71b910522dea610bc26bdd919a
4
- data.tar.gz: 16a62efe88e3ec35a7608a159ea4e4c165a219bf
3
+ metadata.gz: 7eaa83dc5a7a8314977a53984909df786d76f29a
4
+ data.tar.gz: 71fc1db2d7ef0317f5d37068ed26a88baa192461
5
5
  SHA512:
6
- metadata.gz: 5a7beb95cc5f34ccc8c14f8102bb85dabfc6190ea9356416ef25464592ca8987d91c2d1d5be5df226144b71d57417a9c95aa30256a5d6f24f80b57652e33df26
7
- data.tar.gz: f8e1a705ab5a2b1fd4406dc14348e1e3719e7598032c625fb40da391d74366c9ebb80db5d2d619bb9e14f864e0a7df40719564b2a5b560192a8c27852ed55314
6
+ metadata.gz: cd5a25dd3a06ec5596acb9cbccd70527b99df2e05a59b346b91b71f54e22d041b96f9740b389aa8e1d94ae044ca9fb8ae320322b8224021f7d04965a320bd831
7
+ data.tar.gz: 24b1b2b9b416ed358637d4e3991751c6cff3aeebfc05ca0036feb53c1f35c66a4affbdb0f1a0d248a57a1dac406a007d5c89e3fe0d993203b95da4feae5d9730
data/lib/gridle.rb CHANGED
@@ -17,8 +17,8 @@ Compass::Frameworks.register('gridle', :path => extension_path)
17
17
  # a prerelease version
18
18
  # Date is in the form of YYYY-MM-DD
19
19
  module Extension
20
- VERSION = "1.3.36"
21
- DATE = "2015-01-29"
20
+ VERSION = "2.0.0"
21
+ DATE = "2015-10-05"
22
22
  end
23
23
 
24
24
  # This is where any custom SassScript should be placed. The functions will be
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Imports :
3
+ */
4
+ @import 'gridle/gridle-flex';
@@ -0,0 +1,508 @@
1
+ //
2
+ // Gridle state
3
+ //
4
+ // @param string|map|list $states A list of states, a state name or a state map
5
+ // @param boolean $has-parent Mostly always true, mean that the mixin is used in a css selector and not in css root level
6
+ //
7
+ @mixin gridle_state(
8
+ $states,
9
+ $has-parent : true
10
+ ) {
11
+
12
+ // check if is a min-max witdh query (compatibility layer)
13
+ @if type-of($states) == number and type-of($has-parent) == number {
14
+
15
+ // get a new state from settings passed
16
+ $state : gridle_get_state((
17
+ min-width : $states,
18
+ max-width : $has-parent
19
+ ));
20
+
21
+ // make a query
22
+ @include gridle_state($state) {
23
+ @content;
24
+ }
25
+
26
+ } @elseif type-of($states) == list
27
+ or type-of($states) == string {
28
+
29
+ // loop on each states :
30
+ @each $state in $states
31
+ {
32
+ // make sure we have the state object
33
+ $state : gridle_get_state($state);
34
+
35
+ // make gridle state
36
+ @include _gridle_state($state, $has-parent, true) {
37
+ @content;
38
+ }
39
+ }
40
+
41
+ } @elseif type-of($states) == map {
42
+
43
+ // get a state from the passed one
44
+ $state : gridle_get_state($states);
45
+
46
+ // make gridle state
47
+ @include _gridle_state($state, $has-parent, true) {
48
+ @content;
49
+ }
50
+ }
51
+ }
52
+
53
+
54
+ //
55
+ // Gridle use state
56
+ // This mixin will only set the current state to use and NOT print out any media query
57
+ //
58
+ @mixin gridle_use_state(
59
+ $state
60
+ ) {
61
+ // get the state
62
+ $state : gridle_get_state($state);
63
+ $stateName : gridle_get_state_var(name, $state);
64
+
65
+ // save the current state
66
+ $savedState : $_gridle_current_state;
67
+ $savedStateName : $_gridle_current_stateName;
68
+
69
+ // set the current state
70
+ $_gridle_current_state : $state !global;
71
+ $_gridle_current_stateName : $stateName !global;
72
+
73
+ // generate content
74
+ @content;
75
+
76
+ // reset the state
77
+ $_gridle_current_state : $savedState !global;
78
+ $_gridle_current_stateName : $savedStateName !global;
79
+ }
80
+
81
+
82
+ //
83
+ // Gridle selector
84
+ //
85
+ @mixin gridle_selector(
86
+ $for,
87
+ $states : null
88
+ ) {
89
+ #{gridle_selector($for, $states)} {
90
+ @content;
91
+ }
92
+ }
93
+
94
+
95
+ //
96
+ // Helper to apply multiple config for a certain state with one mixin
97
+ //
98
+ @mixin gridle_set(
99
+ $settings,
100
+ $state : default
101
+ ) {
102
+ // init if needed
103
+ @include gridle_init();
104
+ // wrap in media query
105
+ @include gridle_state($state) {
106
+ @include _gridle_set($settings);
107
+ }
108
+ }
109
+ @mixin _gridle_set(
110
+ $settings
111
+ ) {
112
+ // loop on each settings
113
+ @each $settingName, $settingValue in $settings
114
+ {
115
+ $sn : unquote("#{$settingName}");
116
+ $sv : $settingValue;
117
+
118
+ // check if setting name is a state :
119
+ @if gridle_has_state($sn) {
120
+ // process the state
121
+ @include gridle_set($sv, $sn);
122
+ } @else {
123
+ @if $sn == container {
124
+ @if $sv == true {
125
+ @include gridle_container();
126
+ }
127
+ } @else if $sn == grid {
128
+ @if length($sv) == 2 {
129
+ @include gridle(nth($sv,1), nth($sv,2));
130
+ } @else {
131
+ @include gridle($sv);
132
+ }
133
+ } @else if $sn == grid-grow {
134
+ @if $sv == true {
135
+ @include gridle_grid_grow();
136
+ }
137
+ } @else if $sn == grid-adapt {
138
+ @if $sv == true {
139
+ @include gridle_grid_adapt();
140
+ }
141
+ } @else if $sn == grid-table {
142
+ @if $sv == true {
143
+ @include gridle_grid_table();
144
+ }
145
+ } @else if $sn == push {
146
+ @if length($sv) == 2 {
147
+ @include gridle_push(nth($sv,1), nth($sv,2));
148
+ } @else {
149
+ @include gridle_push($sv);
150
+ }
151
+ } @else if $sn == pull {
152
+ @if length($sv) == 2 {
153
+ @include gridle_pull(nth($sv,1), nth($sv,2));
154
+ } @else {
155
+ @include gridle_pull($sv);
156
+ }
157
+ } @else if $sn == prefix {
158
+ @if length($sv) == 2 {
159
+ @include gridle_prefix(nth($sv,1), nth($sv,2));
160
+ } @else {
161
+ @include gridle_prefix($sv);
162
+ }
163
+ } @else if $sn == suffix {
164
+ @if length($sv) == 2 {
165
+ @include gridle_suffix(nth($sv,1), nth($sv,2));
166
+ } @else {
167
+ @include gridle_suffix($sv);
168
+ }
169
+ } @else if $sn == clear-each {
170
+ @include gridle_clear_each(nth($sv,1), nth($sv,2));
171
+ } @else if $sn == grid-centered and $sv == true {
172
+ @include gridle_grid_centered();
173
+ } @else if $sn == row and $sv == true {
174
+ @include gridle_row();
175
+ } @else if $sn == row-full and $sv == true {
176
+ @include gridle_row_full();
177
+ } @else if $sn == col and $sv == true {
178
+ @include gridle_col();
179
+ } @else if $sn == row-align {
180
+ @include gridle_row_align($sv);
181
+ } @else if $sn == nowrap {
182
+ @if $sv == true {
183
+ @include gridle_nowrap();
184
+ } @else {
185
+ @include gridle_wrap();
186
+ }
187
+ } @else if $sn == wrap {
188
+ @if $sv == true {
189
+ @include gridle_wrap();
190
+ } @else {
191
+ @include gridle_nowrap();
192
+ }
193
+ } @else if $sn == order {
194
+ @include gridle_order($sv);
195
+ } @else if $sn == hide {
196
+ @if $sv == true {
197
+ @include gridle_hide();
198
+ } @else {
199
+ @include gridle_show();
200
+ }
201
+ } @else if $sn == show {
202
+ @if $sv == true {
203
+ @include gridle_show();
204
+ } @else {
205
+ @include gridle_hide();
206
+ }
207
+ } @else if $sn == visible {
208
+ @if $sv == true {
209
+ @include gridle_visible();
210
+ } @else {
211
+ @include gridle_not_visible();
212
+ }
213
+ } @else if $sn == not-visible {
214
+ @if $sv == true {
215
+ @include gridle_not_visible();
216
+ } @else {
217
+ @include gridle_visible();
218
+ }
219
+ } @else if $sn == show-inline {
220
+ @if $sv == true {
221
+ @include gridle_show_inline();
222
+ } @else {
223
+ @include gridle_hide();
224
+ }
225
+ } @else if $sn == float {
226
+ @include gridle_float($sv);
227
+ } @else if $sn == clear {
228
+ @include gridle_clear($sv);
229
+ } @else if $sn == no-gutter {
230
+ @include gridle_no_gutter($sv);
231
+ } @else if $sn == gutter or $sn == gutter-width {
232
+ @include gridle_gutter($sv);
233
+ } @else {
234
+ // we do nothing
235
+ }
236
+ }
237
+ }
238
+ }
239
+
240
+
241
+ //
242
+ // Row debug
243
+ //
244
+ @mixin _gridle_common_row_debug(
245
+ $state : default
246
+ ) {
247
+ }
248
+ @mixin gridle_row_debug(
249
+ $states : null
250
+ ) {
251
+ @include _gridle_call(row-debug) {
252
+ // variables :
253
+ $context : gridle_get_state_var(context);
254
+
255
+ position:relative;
256
+ z-index:99999;
257
+ overflow:hidden;
258
+
259
+ &:before {
260
+ pointer-events: none;
261
+ content:'';
262
+ position:absolute;
263
+ top:0; left:0;
264
+ width:100%; height:99999px;
265
+ // vars :
266
+ $width : percentage(1 / $context);
267
+ background: linear-gradient(to right, rgba(0,0,0,0) 50% , rgba(0,0,0,.02) 50%); // Standard syntax
268
+ background-size:($width*2) 100%;
269
+ z-index:99999;
270
+ }
271
+ }
272
+ }
273
+
274
+
275
+ //
276
+ // Debug
277
+ //
278
+ @mixin gridle_debug(
279
+ $what,
280
+ $output : shell
281
+ ) {
282
+ @if $gridle-debug {
283
+ @if $output == shell {
284
+ @debug(inspect($what));
285
+ } @else {
286
+ @if type-of($what) == map {
287
+ @include gridle_debug_map($what);
288
+ } @else {
289
+ @_ {
290
+ #{type-of($what)} : inspect($what);
291
+ }
292
+ }
293
+ }
294
+ }
295
+ }
296
+
297
+
298
+ //
299
+ // Debug a map
300
+ //
301
+ @mixin gridle_debug_map($map, $name : '') {
302
+ @at-root {
303
+ @_ #{$name} {
304
+ @each $key, $value in $map {
305
+ @if type-of($value) == map {
306
+ @include gridle_debug_map($value, $key);
307
+ } @else {
308
+ #{$key}: inspect($value);
309
+ }
310
+ }
311
+ }
312
+ }
313
+ }
314
+
315
+
316
+ //
317
+ // Container
318
+ //
319
+ @mixin _gridle_common_container(
320
+ $state : default
321
+ ) {
322
+ &:after {
323
+ content: "";
324
+ display: table;
325
+ clear: both;
326
+ }
327
+
328
+ }
329
+ @mixin gridle_container(
330
+ ) {
331
+ @include _gridle_call(container) {
332
+ }
333
+ }
334
+
335
+
336
+ //
337
+ // Centered
338
+ //
339
+ @mixin _gridle_common_grid_centered(
340
+ $state : default
341
+ ) {
342
+ display:block !important;
343
+ float:none !important;
344
+ margin-left:auto !important;
345
+ margin-right:auto !important;
346
+ clear:both !important;
347
+ }
348
+ @mixin gridle_grid_centered(
349
+ ) {
350
+ @include _gridle_call(grid-centered) {
351
+ }
352
+ }
353
+
354
+
355
+ //
356
+ // Hide
357
+ //
358
+ @mixin _gridle_common_hide(
359
+ $state : default
360
+ ) {
361
+ }
362
+ @mixin gridle_hide(
363
+ ) {
364
+ @include _gridle_call(hide) {
365
+ display:none;
366
+ }
367
+ }
368
+
369
+
370
+ //
371
+ // Not visible on
372
+ //
373
+ @mixin _gridle_common_not_visible(
374
+ $state : default
375
+ ) {
376
+ }
377
+ @mixin gridle_not_visible(
378
+ ) {
379
+ @include _gridle_call(not-visible) {
380
+ visibility:hidden;
381
+ }
382
+ }
383
+
384
+
385
+ //
386
+ // Show on
387
+ //
388
+ // @param String $media What to hide (one of the 3 state classes name)
389
+ //
390
+ @mixin _gridle_common_show(
391
+ $state : default
392
+ ) {
393
+ }
394
+ @mixin gridle_show(
395
+ ) {
396
+ @include _gridle_call(show) {
397
+ display:block;
398
+ }
399
+ }
400
+
401
+
402
+ //
403
+ // Show inline
404
+ //
405
+ // @param String $state The state name
406
+ //
407
+ @mixin _gridle_common_show_inline(
408
+ $state : default
409
+ ) {
410
+ }
411
+ @mixin gridle_show_inline(
412
+ ) {
413
+ @include _gridle_call(show-inline) {
414
+ display:inline-block;
415
+ }
416
+ }
417
+
418
+
419
+ //
420
+ // Visible on :
421
+ // @param String $media On what state
422
+ //
423
+ @mixin _gridle_common_visible(
424
+ $state : default
425
+ ) {
426
+ }
427
+ @mixin gridle_visible(
428
+ ) {
429
+ @include _gridle_call(visible) {
430
+ visibility:visible;
431
+ }
432
+ }
433
+
434
+
435
+ //
436
+ // Float :
437
+ //
438
+ @mixin _gridle_common_float(
439
+ $state : default
440
+ ) {
441
+ }
442
+ @mixin gridle_float(
443
+ $float-direction : left
444
+ ) {
445
+ @include _gridle_call(float) {
446
+ float:#{$float-direction};
447
+ }
448
+ }
449
+
450
+
451
+ //
452
+ // Gridle clear :
453
+ //
454
+ @mixin _gridle_common_clear(
455
+ $state : default
456
+ ) {
457
+ }
458
+ @mixin gridle_clear(
459
+ $clear-direction : both
460
+ ) {
461
+ @include _gridle_call(clear) {
462
+ clear:#{$clear-direction};
463
+ }
464
+ }
465
+
466
+
467
+ //
468
+ // Gridle no gutter :
469
+ //
470
+ @mixin _gridle_common_no_gutter(
471
+ $state : default
472
+ ) {
473
+ }
474
+ @mixin gridle_no_gutter(
475
+ $side : top right bottom left
476
+ ) {
477
+ @include _gridle_call(no-gutter) {
478
+ @each $s in $side {
479
+ padding-#{$s} : 0;
480
+ }
481
+ }
482
+ }
483
+
484
+
485
+ //
486
+ // Gridle gutter :
487
+ //
488
+ @mixin _gridle_common_gutter(
489
+ $state : default
490
+ ) {
491
+ }
492
+ @mixin gridle_gutter(
493
+ $side-or-size : top right bottom left
494
+ ) {
495
+ @include _gridle_call(gutter) {
496
+
497
+ // get a gutter map
498
+ $gutters : _gridle_forge_gutters_map($side-or-size);
499
+
500
+ // check that we have a gutter map
501
+ @each $side, $value in $gutters {
502
+ @if $value > 0 {
503
+ padding-#{$side} : $value;
504
+ }
505
+ }
506
+
507
+ }
508
+ }