gridle 1.3.27 → 1.3.29

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: 8a7e42d4f361620beea144a2a237fc5add61dbba
4
- data.tar.gz: 113d7ad36be92c39b6768330e9ae19f61ab13478
3
+ metadata.gz: cc0de88b3051757dc948acc3bf43f7040eeac03c
4
+ data.tar.gz: 59dd262b6ff7969e13b1abdec39215cf826592f4
5
5
  SHA512:
6
- metadata.gz: f6d436bc519a97772a4fbb7dc7e26056a7971182cf819129866d6dcc24b85f8594f675b87269445f5c9ed3ca7d9e33c61b0dba355220c470204b2ddb2363fa3a
7
- data.tar.gz: 8e78044df9b95c6550298283956096c98e0401a8bf65aca2b1f537eabd204a87f6f00dc82d0a65dbd65845553c213335899464f7b5c3066e37f697d8a6c2b000
6
+ metadata.gz: 533f1b2160466fee09163b37e271cfa2f483c237f8ac9461e02c9f2af3354201abffdcf321c462487a440b9733162667e8656656aa7b963545386ff8f2d7cc0c
7
+ data.tar.gz: fab65351c02cd0dfa3fb33fdce5b36998206906513524b3b2f9d599f3aeeb6d77d55ad41cf9b3882686bf493eb6c60276423ca5d3241e817508e7478915c9bd2
@@ -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.27"
21
- DATE = "2014-07-14"
20
+ VERSION = "1.3.29"
21
+ DATE = "2014-07-22"
22
22
  end
23
23
 
24
24
  # This is where any custom SassScript should be placed. The functions will be
@@ -25,25 +25,29 @@
25
25
  {
26
26
  // vars :
27
27
  $direction : _gridle_get_var_value(direction, $state);
28
+ $classes : _gridle_get_var_value(classes, $state);
28
29
  $gutter-width : _gridle_get_var_value(gutter-width, $state);
29
30
  $debug : _gridle_get_var_value(debug, $state);
30
31
 
31
- @include gridle_state($state) {
32
- @if $direction == rtl {
33
- float:right;
34
- direction:rtl;
35
- } @else {
36
- float:left;
37
- direction:ltr;
38
- }
32
+ @if $classes
33
+ {
34
+ @include gridle_state($state) {
35
+ @if $direction == rtl {
36
+ float:right;
37
+ direction:rtl;
38
+ } @else {
39
+ float:left;
40
+ direction:ltr;
41
+ }
39
42
 
40
- padding-left:$gutter-width/2;
41
- padding-right:$gutter-width/2;
42
- }
43
-
44
- @if $debug == true {
45
- #{$gridle-debug-selector} {
46
- @extend %gridle-grid-debug-common;
43
+ padding-left:$gutter-width/2;
44
+ padding-right:$gutter-width/2;
45
+ }
46
+
47
+ @if $debug == true {
48
+ #{$gridle-debug-selector} {
49
+ @extend %gridle-grid-debug-common;
50
+ }
47
51
  }
48
52
  }
49
53
  }
@@ -0,0 +1,35 @@
1
+ // |------------------------------------------------------
2
+ // |------------------------------------------------------
3
+ // | Default states
4
+ // |------------------------------------------------------
5
+ // |------------------------------------------------------
6
+
7
+ // retina
8
+ @include gridle_register_state("retina", (
9
+ query : "(-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi)",
10
+ classes : false
11
+ ) );
12
+
13
+ // tv
14
+ @include gridle_register_state("tv", (
15
+ query : "only tv",
16
+ classes : false
17
+ ) );
18
+
19
+ // print
20
+ @include gridle_register_state("print", (
21
+ query : "only print",
22
+ classes : false
23
+ ) );
24
+
25
+ // portrait
26
+ @include gridle_register_state("portrait", (
27
+ query : "only screen and (orientation: portrait)",
28
+ classes : false
29
+ ) );
30
+
31
+ // landscape
32
+ @include gridle_register_state("landscape", (
33
+ query : "only screen and (orientation: landscape)",
34
+ classes : false
35
+ ) );
@@ -44,13 +44,15 @@
44
44
  $stateMap-or-stateName
45
45
  ) {
46
46
  // check if has a state named like this :
47
- @if (map-has-key($_gridle_states, unquote($stateMap-or-stateName)))
47
+ @if (type-of($stateMap-or-stateName) == string
48
+ and map-has-key($_gridle_states, unquote($stateMap-or-stateName)))
48
49
  {
49
50
  @return map-get($_gridle_states, unquote($stateMap-or-stateName));
50
51
  }
51
52
 
52
53
  // nothing finded, so return the default state :
53
54
  @if $stateMap-or-stateName
55
+ and type-of($stateMap-or-stateName) == map
54
56
  {
55
57
  @return map-merge($_gridle-settings, $stateMap-or-stateName);
56
58
  }
@@ -178,12 +180,14 @@
178
180
  @function _gridle_create_column(
179
181
  $name,
180
182
  $columns,
181
- $context
183
+ $context,
184
+ $name-multiplicator : 1 // used to extend the state on custom registered columns
182
185
  ) {
183
186
  @return (
184
187
  name : $name,
185
188
  columns : $columns,
186
- context : $context
189
+ context : $context,
190
+ name-multiplicator : $name-multiplicator
187
191
  );
188
192
  }
189
193
 
@@ -325,26 +329,6 @@
325
329
  }
326
330
 
327
331
  }
328
- @else if unquote($state-or-settings) == print
329
- {
330
- @return "only print";
331
- }
332
- @else if unquote($state-or-settings) == tv
333
- {
334
- @return "only tv";
335
- }
336
- @else if unquote($state-or-settings) == portrait
337
- {
338
- @return "only screen and (orientation: portrait)";
339
- }
340
- @else if unquote($state-or-settings) == landscape
341
- {
342
- @return "only screen and (orientation: landscape)";
343
- }
344
- @else if unquote($state-or-settings) == retina
345
- {
346
- @return "only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min--moz-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2/1), only screen and (min-device-pixel-ratio: 2), only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx)";
347
- }
348
332
  @else
349
333
  {
350
334
  @return null;
@@ -34,10 +34,16 @@
34
34
  $stateName : map-get($stateName, name);
35
35
  }
36
36
 
37
+ // classes :
38
+ $classes : _gridle_get_var_value(classes, $stateName);
39
+
37
40
  // genrate the classname :
38
- @include gridle_state($stateName, false) {
39
- #{_gridle_classname($pattern, $stateName)} {
40
- @content;
41
+ @if $classes
42
+ {
43
+ @include gridle_state($stateName, false) {
44
+ #{_gridle_classname($pattern, $stateName)} {
45
+ @content;
46
+ }
41
47
  }
42
48
  }
43
49
  }
@@ -402,7 +408,10 @@ $_gridle_generateOnlyOnce : true; // keep track of generate once classes
402
408
  // // | ------------------------
403
409
 
404
410
  // // generate json settings :
405
- @include gridle_generate_json_settings();
411
+ @if $gridle-generate-json-settings
412
+ {
413
+ @include gridle_generate_json_settings();
414
+ }
406
415
 
407
416
  }
408
417
 
@@ -456,9 +465,10 @@ $_gridle_generateOnlyOnce : true; // keep track of generate once classes
456
465
 
457
466
  // name :
458
467
  $columnName : "#{$j*$name-multiplicator}";
468
+ $columnWidth : $j * $name-multiplicator;
459
469
 
460
470
  // // create a column :
461
- $col : _gridle_create_column($columnName, $j, $context);
471
+ $col : _gridle_create_column($columnName, $columnWidth, $context, $name-multiplicator);
462
472
 
463
473
  // // add column in columns map :
464
474
  $columnsMap : map-set($columnsMap, $columnName, $col);
@@ -532,16 +542,16 @@ $_gridle_generateOnlyOnce : true; // keep track of generate once classes
532
542
  $generate-suffix-classes : _gridle_get_var_value(generate-suffix-classes, $state);
533
543
  $generate-helpers-classes : _gridle_get_var_value(generate-helpers-classes, $state);
534
544
 
535
- // parent common css :
536
- $parentSelector : _gridle_classname($gridle-parent-name-pattern,$stateName,null);
537
- #{$parentSelector} {
538
- @extend %gridle-clearfix;
539
- @extend %gridle-parent-common;
540
- }
541
-
542
545
  // generate all media queries grid classes :
543
546
  @if $classes == true {
544
547
 
548
+ // parent common css :
549
+ $parentSelector : _gridle_classname($gridle-parent-name-pattern,$stateName,null);
550
+ #{$parentSelector} {
551
+ @extend %gridle-clearfix;
552
+ @extend %gridle-parent-common;
553
+ }
554
+
545
555
  // generate all the classes :
546
556
  @include gridle_state($stateName, $has-parent) {
547
557
 
@@ -553,9 +563,10 @@ $_gridle_generateOnlyOnce : true; // keep track of generate once classes
553
563
 
554
564
  // name :
555
565
  $columnName : "#{$j*$name-multiplicator}";
566
+ $columnWidth : $j * $name-multiplicator;
556
567
 
557
568
  // // create a column :
558
- $col : _gridle_create_column($columnName, $j, $context);
569
+ $col : _gridle_create_column($columnName, $columnWidth, $context, $name-multiplicator);
559
570
 
560
571
  // // add column in columns map :
561
572
  $columnsMap : map-set($columnsMap, $columnName, $col);
@@ -567,10 +578,12 @@ $_gridle_generateOnlyOnce : true; // keep track of generate once classes
567
578
  // variables :
568
579
  $columnsCount : map-get($column, columns);
569
580
  $columnsContext : map-get($column, context);
581
+ $columnsNameMultiplicator : map-get($column, name-multiplicator);
570
582
 
571
583
  // extend context in state (for columns) :
572
584
  $extendedState : map-merge($state, (
573
- context : $columnsContext
585
+ context : $columnsContext,
586
+ name-multiplicator : $columnsNameMultiplicator // inject the name multiplicator here getted from column to handle custom registered columns
574
587
  ));
575
588
 
576
589
  // classes :
@@ -29,13 +29,13 @@
29
29
  // |------------------------------------------------------
30
30
  // |------------------------------------------------------
31
31
  // @created 25.03.13
32
- // @updated 14.07.14
32
+ // @updated 22.07.14
33
33
  // @author Olivier Bossel <olivier.bossel@gmail.com>
34
- // @version 1.3.27
34
+ // @version 1.3.29
35
35
  // |------------------------------------------------------
36
36
  // |------------------------------------------------------
37
37
 
38
- $_gridle-version : "1.3.27";
38
+ $_gridle-version : "1.3.29";
39
39
 
40
40
 
41
41
 
@@ -128,3 +128,14 @@ $_gridle_states_debug_devices : (); // save the debug states devices
128
128
  // |------------------------------------------------------
129
129
 
130
130
  @import 'generate-mixins';
131
+
132
+
133
+
134
+
135
+ // |------------------------------------------------------
136
+ // |------------------------------------------------------
137
+ // | Default states
138
+ // |------------------------------------------------------
139
+ // |------------------------------------------------------
140
+
141
+ @import 'default-states';
@@ -4,6 +4,8 @@
4
4
  // |------------------------------------------------------
5
5
  // |------------------------------------------------------
6
6
 
7
+ $gridle-generate-json-settings : true !default;
8
+
7
9
  $gridle-debug-selector : ".gridle-debug &, &.gridle-debug" !default;
8
10
 
9
11
  $gridle-class-prefix : '' !default;
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.27
4
+ version: 1.3.29
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-07-14 00:00:00.000000000 Z
11
+ date: 2014-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sass
@@ -35,6 +35,7 @@ files:
35
35
  - lib/gridle.rb
36
36
  - stylesheets/_gridle.scss
37
37
  - stylesheets/gridle/_common-mixins.scss
38
+ - stylesheets/gridle/_default-states.scss
38
39
  - stylesheets/gridle/_functions.scss
39
40
  - stylesheets/gridle/_generate-mixins.scss
40
41
  - stylesheets/gridle/_gridle.scss