gridle 1.0.9.5 → 1.0.9.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gridle.rb +1 -1
- data/stylesheets/gridle/_gridle.scss +263 -200
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23c4cd359dd5adab66ecc2717a77aebbeeff2b82
|
4
|
+
data.tar.gz: b2efe48773fdd7b3d11df8456f3cc3b991ef5fa6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 425759b8b59ef4ac61077eb8a61c901a57c4a860f567c13de431c271dafa937155955b9ffed913c8a2703d421112f6c80008fcd957590f3e20c567f0a387b35b
|
7
|
+
data.tar.gz: 3638a9c2f9e03f754c7b4699ddd2565676f6c2ce79088c1c95d65c34b3e186ba5a05b1caf4bd81f974e52f3b473a41bf5f6e01997151f246accde49f3de7a75f
|
data/lib/gridle.rb
CHANGED
@@ -31,7 +31,7 @@
|
|
31
31
|
// @created 25.03.13
|
32
32
|
// @updated 20.11.13
|
33
33
|
// @author Olivier Bossel <olivier.bossel@gmail.com>
|
34
|
-
// @version 1.0.9.
|
34
|
+
// @version 1.0.9.6
|
35
35
|
// |------------------------------------------------------
|
36
36
|
// |------------------------------------------------------
|
37
37
|
|
@@ -186,11 +186,11 @@ $_gridle-state-15-classes : true !default;
|
|
186
186
|
// For modern browser
|
187
187
|
&:before,
|
188
188
|
&:after {
|
189
|
-
|
190
|
-
|
189
|
+
content:"";
|
190
|
+
display:table;
|
191
191
|
}
|
192
192
|
&:after {
|
193
|
-
|
193
|
+
clear:both;
|
194
194
|
}
|
195
195
|
// For IE 6/7 (trigger hasLayout
|
196
196
|
& {
|
@@ -372,16 +372,16 @@ $_gridle-state-15-classes : true !default;
|
|
372
372
|
|
373
373
|
// Get column width :
|
374
374
|
@function gridle_get_columns_width(
|
375
|
-
|
376
|
-
|
375
|
+
$columns : 1,
|
376
|
+
$context : $gridle-columns-count
|
377
377
|
) {
|
378
|
-
|
378
|
+
@return percentage(1 / $context * $columns);
|
379
379
|
}
|
380
380
|
@function gridle_get_column_width(
|
381
|
-
|
382
|
-
|
381
|
+
$columns : 1,
|
382
|
+
$context : $gridle-column-count
|
383
383
|
) {
|
384
|
-
|
384
|
+
@return gridle_get_columns_width($columns, $context);
|
385
385
|
}
|
386
386
|
|
387
387
|
// prefix classname :
|
@@ -411,9 +411,9 @@ $_gridle-state-15-classes : true !default;
|
|
411
411
|
$query : _gridle_get_media_query_vars($idx,"query");
|
412
412
|
|
413
413
|
// check if exist :
|
414
|
-
@if $name
|
414
|
+
@if $name {
|
415
415
|
// check if query exist :
|
416
|
-
@if $query
|
416
|
+
@if $query {
|
417
417
|
@return $query;
|
418
418
|
} @else {
|
419
419
|
|
@@ -812,9 +812,9 @@ $_gridle-state-15-classes : true !default;
|
|
812
812
|
$query : _gridle_get_media_query_vars($idx,"query");
|
813
813
|
|
814
814
|
// check if exist :
|
815
|
-
@if $name
|
815
|
+
@if $name {
|
816
816
|
// check if query exist :
|
817
|
-
@if $query
|
817
|
+
@if $query {
|
818
818
|
@media #{$query} {
|
819
819
|
@content;
|
820
820
|
}
|
@@ -887,6 +887,9 @@ $_gridle-state-15-classes : true !default;
|
|
887
887
|
$state-context : null,
|
888
888
|
$state : null
|
889
889
|
) {
|
890
|
+
// common :
|
891
|
+
@include _gridle_grid_common();
|
892
|
+
// variables :
|
890
893
|
$context : $gridle-columns-count;
|
891
894
|
@if type-of($state-context) == number {
|
892
895
|
$state : $state;
|
@@ -894,7 +897,7 @@ $_gridle-state-15-classes : true !default;
|
|
894
897
|
} @else {
|
895
898
|
$state : $state-context;
|
896
899
|
}
|
897
|
-
|
900
|
+
// check if need media query :
|
898
901
|
@if $state {
|
899
902
|
@include gridle_state($state) {
|
900
903
|
@include _gridle($columns, $state, $context);
|
@@ -938,6 +941,9 @@ $_gridle-state-15-classes : true !default;
|
|
938
941
|
$state-context : null,
|
939
942
|
$state : null
|
940
943
|
) {
|
944
|
+
// common :
|
945
|
+
@include _gridle_push_common();
|
946
|
+
// variables :
|
941
947
|
$context : $gridle-columns-count;
|
942
948
|
@if type-of($state-context) == number {
|
943
949
|
$state : $state;
|
@@ -945,7 +951,7 @@ $_gridle-state-15-classes : true !default;
|
|
945
951
|
} @else {
|
946
952
|
$state : $state-context;
|
947
953
|
}
|
948
|
-
|
954
|
+
// check if need media query :
|
949
955
|
@if $state {
|
950
956
|
@include gridle_state($state) {
|
951
957
|
@include _gridle_push($columns,$state,$context);
|
@@ -982,6 +988,9 @@ $_gridle-state-15-classes : true !default;
|
|
982
988
|
$state-context : null,
|
983
989
|
$state : null
|
984
990
|
) {
|
991
|
+
// common :
|
992
|
+
@include _gridle_pull_common();
|
993
|
+
// variables :
|
985
994
|
$context : $gridle-columns-count;
|
986
995
|
@if type-of($state-context) == number {
|
987
996
|
$state : $state;
|
@@ -989,7 +998,7 @@ $_gridle-state-15-classes : true !default;
|
|
989
998
|
} @else {
|
990
999
|
$state : $state-context;
|
991
1000
|
}
|
992
|
-
|
1001
|
+
// check if need media query :
|
993
1002
|
@if $state {
|
994
1003
|
@include gridle_state($state) {
|
995
1004
|
@include _gridle_pull($columns,$state,$context);
|
@@ -1026,6 +1035,9 @@ $_gridle-state-15-classes : true !default;
|
|
1026
1035
|
$state-context : null,
|
1027
1036
|
$state : null
|
1028
1037
|
) {
|
1038
|
+
// common :
|
1039
|
+
@include _gridle_prefix_common();
|
1040
|
+
// variables :
|
1029
1041
|
$context : $gridle-columns-count;
|
1030
1042
|
@if type-of($state-context) == number {
|
1031
1043
|
$state : $state;
|
@@ -1033,7 +1045,7 @@ $_gridle-state-15-classes : true !default;
|
|
1033
1045
|
} @else {
|
1034
1046
|
$state : $state-context;
|
1035
1047
|
}
|
1036
|
-
|
1048
|
+
// check if need media query :
|
1037
1049
|
@if $state {
|
1038
1050
|
@include gridle_state($state) {
|
1039
1051
|
@include _gridle_prefix($columns,$state,$context);
|
@@ -1070,6 +1082,9 @@ $_gridle-state-15-classes : true !default;
|
|
1070
1082
|
$state-context : null,
|
1071
1083
|
$state : null
|
1072
1084
|
) {
|
1085
|
+
// common :
|
1086
|
+
@include _gridle_suffix_common();
|
1087
|
+
// variables :
|
1073
1088
|
$context : $gridle-columns-count;
|
1074
1089
|
@if type-of($state-context) == number {
|
1075
1090
|
$state : $state;
|
@@ -1077,7 +1092,7 @@ $_gridle-state-15-classes : true !default;
|
|
1077
1092
|
} @else {
|
1078
1093
|
$state : $state-context;
|
1079
1094
|
}
|
1080
|
-
|
1095
|
+
// check if need media query :
|
1081
1096
|
@if $state {
|
1082
1097
|
@include gridle_state($state) {
|
1083
1098
|
@include _gridle_suffix($columns,$state,$context);
|
@@ -1111,6 +1126,7 @@ $_gridle-state-15-classes : true !default;
|
|
1111
1126
|
@mixin gridle_centered(
|
1112
1127
|
$state : null
|
1113
1128
|
) {
|
1129
|
+
// check if need media query :
|
1114
1130
|
@if $state {
|
1115
1131
|
@include gridle_state($state) {
|
1116
1132
|
@include _gridle_centered();
|
@@ -1132,7 +1148,9 @@ $_gridle-state-15-classes : true !default;
|
|
1132
1148
|
@mixin gridle_parent(
|
1133
1149
|
$state : null
|
1134
1150
|
) {
|
1151
|
+
// common :
|
1135
1152
|
@include _gridle_parent_common();
|
1153
|
+
// check if need media query :
|
1136
1154
|
@if $state {
|
1137
1155
|
@include gridle_state($state) {
|
1138
1156
|
@include _gridle_parent();
|
@@ -1151,6 +1169,7 @@ $_gridle-state-15-classes : true !default;
|
|
1151
1169
|
@mixin gridle_hide(
|
1152
1170
|
$state : null
|
1153
1171
|
) {
|
1172
|
+
// check if need media query :
|
1154
1173
|
@if $state {
|
1155
1174
|
@include gridle_state($state) {
|
1156
1175
|
@include _gridle_hide();
|
@@ -1169,6 +1188,7 @@ $_gridle-state-15-classes : true !default;
|
|
1169
1188
|
@mixin gridle_not_visible(
|
1170
1189
|
$state : null
|
1171
1190
|
) {
|
1191
|
+
// check if need media query :
|
1172
1192
|
@if $state {
|
1173
1193
|
@include gridle_state($state) {
|
1174
1194
|
@include _gridle_not_visible();
|
@@ -1187,6 +1207,7 @@ $_gridle-state-15-classes : true !default;
|
|
1187
1207
|
@mixin gridle_show(
|
1188
1208
|
$state : null
|
1189
1209
|
) {
|
1210
|
+
// check if need media query :
|
1190
1211
|
@if $state {
|
1191
1212
|
@include gridle_state($state) {
|
1192
1213
|
@include _gridle_show();
|
@@ -1205,6 +1226,7 @@ $_gridle-state-15-classes : true !default;
|
|
1205
1226
|
@mixin gridle_visible(
|
1206
1227
|
$state : null
|
1207
1228
|
) {
|
1229
|
+
// check if need media query :
|
1208
1230
|
@if $state {
|
1209
1231
|
@include gridle_state($state) {
|
1210
1232
|
@include _gridle_visible();
|
@@ -1223,6 +1245,7 @@ $_gridle-state-15-classes : true !default;
|
|
1223
1245
|
$float-direction : left,
|
1224
1246
|
$state : null
|
1225
1247
|
) {
|
1248
|
+
// check if need media query :
|
1226
1249
|
@if $state {
|
1227
1250
|
@include gridle_state($state) {
|
1228
1251
|
@include gridle_float($float-direction);
|
@@ -1245,6 +1268,7 @@ $_gridle-state-15-classes : true !default;
|
|
1245
1268
|
$clear-direction : both,
|
1246
1269
|
$state : null
|
1247
1270
|
) {
|
1271
|
+
// check if need media query :
|
1248
1272
|
@if $state {
|
1249
1273
|
@include gridle_state($state) {
|
1250
1274
|
@include _gridle_clear($clear-direction);
|
@@ -1267,6 +1291,7 @@ $_gridle-state-15-classes : true !default;
|
|
1267
1291
|
$side : left right,
|
1268
1292
|
$state : null
|
1269
1293
|
) {
|
1294
|
+
// check if need media query :
|
1270
1295
|
@if $state {
|
1271
1296
|
@include gridle_state($state) {
|
1272
1297
|
@include _gridle_no_gutter($side);
|
@@ -1297,6 +1322,7 @@ $_gridle-state-15-classes : true !default;
|
|
1297
1322
|
$side : left right,
|
1298
1323
|
$state : null
|
1299
1324
|
) {
|
1325
|
+
// check if need media query :
|
1300
1326
|
@if $state {
|
1301
1327
|
@include gridle_state($state) {
|
1302
1328
|
@include _gridle_gutter($side);
|
@@ -1328,10 +1354,12 @@ $_gridle-state-15-classes : true !default;
|
|
1328
1354
|
@mixin _gridle_generate_helper_classes (
|
1329
1355
|
$state : null
|
1330
1356
|
) {
|
1357
|
+
// variables :
|
1331
1358
|
$media : '';
|
1332
|
-
@if
|
1359
|
+
@if $state { $media : -#{$state}; }
|
1333
1360
|
@else { $media : ''; }
|
1334
1361
|
|
1362
|
+
// helpers :
|
1335
1363
|
#{_gridle_prefixed_class("hide#{$media}")} {
|
1336
1364
|
@include gridle_hide(null);
|
1337
1365
|
}
|
@@ -1405,7 +1433,11 @@ $_gridle-state-15-classes : true !default;
|
|
1405
1433
|
#{_gridle_prefixed_class("centered#{$media}")} {
|
1406
1434
|
@include gridle_centered(null);
|
1407
1435
|
}
|
1436
|
+
#{_gridle_prefixed_class("parent#{$media}")} {
|
1437
|
+
@include _gridle_parent(); // gridle_parent contain extend so can not be here in a media query
|
1438
|
+
}
|
1408
1439
|
|
1440
|
+
// debug colors :
|
1409
1441
|
@if $gridle-debug {
|
1410
1442
|
// debug color classes :
|
1411
1443
|
#{_gridle_prefixed_class("debug-color#{$media}-1")} {
|
@@ -1442,13 +1474,89 @@ $_gridle-state-15-classes : true !default;
|
|
1442
1474
|
}
|
1443
1475
|
|
1444
1476
|
|
1477
|
+
// generate settings json :
|
1478
|
+
@mixin gridle_generate_json_settings(
|
1479
|
+
$scope : default
|
1480
|
+
) {
|
1481
|
+
|
1482
|
+
// settings content :
|
1483
|
+
$gridle-settings-states : "{";
|
1484
|
+
|
1485
|
+
// generate all classes for differents media queries :
|
1486
|
+
@for $i from 1 through 15 {
|
1487
|
+
// setup vars :
|
1488
|
+
$media : _gridle_get_media_query_vars($i,"name");
|
1489
|
+
$classes : _gridle_get_media_query_vars($i,"classes");
|
1490
|
+
|
1491
|
+
// generate all media queries grid classes :
|
1492
|
+
@if $media and $classes == true {
|
1493
|
+
|
1494
|
+
// manage body query :
|
1495
|
+
$body-query : _get_media_query_for_state($media);
|
1496
|
+
@if $body-query {
|
1497
|
+
@if $i == 1 {
|
1498
|
+
$gridle-settings-states : "#{$gridle-settings-states}\"#{$media}\":\"#{$body-query}\"";
|
1499
|
+
} @else {
|
1500
|
+
$gridle-settings-states : "#{$gridle-settings-states},\"#{$media}\":\"#{$body-query}\"";
|
1501
|
+
}
|
1502
|
+
}
|
1503
|
+
|
1504
|
+
}
|
1505
|
+
}
|
1506
|
+
|
1507
|
+
// usefull states :
|
1508
|
+
@if $gridle-generate-useful-states-classes != null {
|
1509
|
+
@each $state in $gridle-generate-useful-states-classes {
|
1510
|
+
|
1511
|
+
// manage body query :
|
1512
|
+
$body-query : _get_media_query_for_state($state);
|
1513
|
+
@if $body-query {
|
1514
|
+
$gridle-settings-states : "#{$gridle-settings-states},\"#{$state}\":\"#{$body-query}\"";
|
1515
|
+
}
|
1516
|
+
}
|
1517
|
+
}
|
1518
|
+
|
1519
|
+
// generate settings json :
|
1520
|
+
$gridle-settings-states : "#{$gridle-settings-states}}";
|
1521
|
+
$gridle-settings : "{";
|
1522
|
+
$gridle-settings : "#{$gridle-settings} \"states\" : #{$gridle-settings-states}";
|
1523
|
+
$gridle-settings : "#{$gridle-settings}, \"columnsCount\" : #{$gridle-columns-count}";
|
1524
|
+
$gridle-settings : "#{$gridle-settings}, \"gutterWidth\" : \"#{$gridle-gutter-width}\"";
|
1525
|
+
$gridle-settings : "#{$gridle-settings}, \"nameMultiplicator\" : #{$gridle-name-multiplicator}";
|
1526
|
+
$gridle-settings : "#{$gridle-settings}, \"direction\" : \"#{$gridle-direction}\"";
|
1527
|
+
$gridle-settings : "#{$gridle-settings}, \"ie7Support\" : #{$gridle-ie7-support}";
|
1528
|
+
$gridle-settings : "#{$gridle-settings}, \"debug\" : #{$gridle-debug}";
|
1529
|
+
$gridle-settings : "#{$gridle-settings}, \"debugShowClassNames\" : #{$gridle-debug-show-class-names}";
|
1530
|
+
$gridle-settings : "#{$gridle-settings}, \"htmlStatesClasses\" : #{$gridle-html-states-classes}";
|
1531
|
+
$gridle-settings : "#{$gridle-settings}, \"generateHelpersClasses\" : #{$gridle-generate-helpers-classes}";
|
1532
|
+
$gridle-settings : "#{$gridle-settings}, \"generatePushClasses\" : #{$gridle-generate-push-classes}";
|
1533
|
+
$gridle-settings : "#{$gridle-settings}, \"generatePullClasses\" : #{$gridle-generate-pull-classes}";
|
1534
|
+
$gridle-settings : "#{$gridle-settings}, \"generatePrefixClasses\" : #{$gridle-generate-prefix-classes}";
|
1535
|
+
$gridle-settings : "#{$gridle-settings}, \"generateSuffixClasses\" : #{$gridle-generate-suffix-classes}";
|
1536
|
+
$gridle-settings : "#{$gridle-settings}, \"classPrefix\" : \"#{$gridle-class-prefix}\"";
|
1537
|
+
$useful-states-classes : "[";
|
1538
|
+
@for $i from 1 through length($gridle-generate-useful-states-classes) {
|
1539
|
+
@if $i > 1 {
|
1540
|
+
$useful-states-classes : "#{$useful-states-classes},";
|
1541
|
+
}
|
1542
|
+
$useful-states-classes : "#{$useful-states-classes}\"#{nth($gridle-generate-useful-states-classes,$i)}\"";
|
1543
|
+
}
|
1544
|
+
$useful-states-classes : "#{$useful-states-classes}]";
|
1545
|
+
$gridle-settings : "#{$gridle-settings}, \"generateUsefulStatesClasses\" : #{$useful-states-classes}";
|
1546
|
+
$gridle-settings : "#{$gridle-settings}}";
|
1547
|
+
#gridle-settings-#{$scope} {
|
1548
|
+
content : $gridle-settings;
|
1549
|
+
}
|
1550
|
+
}
|
1551
|
+
|
1552
|
+
|
1445
1553
|
// gridle mixin :
|
1446
1554
|
// Generate all the classes needed for a grid
|
1447
1555
|
@mixin gridle_generate_classes(
|
1448
1556
|
$scope : null
|
1449
1557
|
) {
|
1450
1558
|
// check if a scope exist :
|
1451
|
-
@if $scope
|
1559
|
+
@if $scope {
|
1452
1560
|
// wrapp grid into scope :
|
1453
1561
|
.#{$scope} {
|
1454
1562
|
@include _gridle_generate_classes(true);
|
@@ -1461,15 +1569,12 @@ $_gridle-state-15-classes : true !default;
|
|
1461
1569
|
@mixin _gridle_generate_classes(
|
1462
1570
|
$has-parent
|
1463
1571
|
) {
|
1464
|
-
|
1572
|
+
|
1465
1573
|
// Windows 8 fix for snap mode :
|
1466
1574
|
@media screen and (max-width: 400px) {
|
1467
1575
|
@-ms-viewport { width: device-width; }
|
1468
1576
|
}
|
1469
|
-
|
1470
|
-
// body media query content :
|
1471
|
-
$gridle-settings-states : "{";
|
1472
|
-
|
1577
|
+
|
1473
1578
|
// generate container class :
|
1474
1579
|
$container-selector : ();
|
1475
1580
|
$container-selector : $container-selector, unquote("#{_gridle_prefixed_class("container")}, #{_gridle_prefixed_class("container-#{$gridle-columns-count}")}");
|
@@ -1477,253 +1582,211 @@ $_gridle-state-15-classes : true !default;
|
|
1477
1582
|
@include gridle_container();
|
1478
1583
|
}
|
1479
1584
|
|
1585
|
+
// parent common css :
|
1586
|
+
$parentSelector : "#{"#{$gridle-class-prefix}parent"}";
|
1587
|
+
$gridSelector : "#{"#{$gridle-class-prefix}grid-"}";
|
1588
|
+
[class*="#{$gridSelector}"][class*="#{$parentSelector}"] {
|
1589
|
+
@extend %gridle-clearfix;
|
1590
|
+
@extend %gridle-parent-common;
|
1591
|
+
}
|
1592
|
+
|
1480
1593
|
// generate all grid-x classes :
|
1481
1594
|
@for $i from 0 through $gridle-columns-count {
|
1595
|
+
|
1596
|
+
// variables :
|
1597
|
+
$calculatedSelector : "#{$i*$gridle-name-multiplicator}";
|
1482
1598
|
|
1483
|
-
|
1484
|
-
|
1599
|
+
// classes :
|
1600
|
+
#{_gridle_prefixed_class("grid-#{$calculatedSelector}")} {
|
1601
|
+
@include _gridle($i);
|
1485
1602
|
}
|
1486
1603
|
@if $gridle-generate-push-classes == true {
|
1487
|
-
#{_gridle_prefixed_class("push-#{$
|
1488
|
-
@include
|
1604
|
+
#{_gridle_prefixed_class("push-#{$calculatedSelector}")} {
|
1605
|
+
@include _gridle_push($i);
|
1489
1606
|
}
|
1490
1607
|
}
|
1491
1608
|
@if $gridle-generate-pull-classes == true {
|
1492
|
-
#{_gridle_prefixed_class("pull-#{$
|
1493
|
-
@include
|
1609
|
+
#{_gridle_prefixed_class("pull-#{$calculatedSelector}")} {
|
1610
|
+
@include _gridle_pull($i);
|
1494
1611
|
}
|
1495
1612
|
}
|
1496
1613
|
@if $gridle-generate-prefix-classes == true {
|
1497
|
-
#{_gridle_prefixed_class("prefix-#{$
|
1498
|
-
@include
|
1614
|
+
#{_gridle_prefixed_class("prefix-#{$calculatedSelector}")} {
|
1615
|
+
@include _gridle_prefix($i);
|
1499
1616
|
}
|
1500
1617
|
}
|
1501
1618
|
@if $gridle-generate-suffix-classes == true {
|
1502
|
-
#{_gridle_prefixed_class("suffix-#{$
|
1503
|
-
@include
|
1619
|
+
#{_gridle_prefixed_class("suffix-#{$calculatedSelector}")} {
|
1620
|
+
@include _gridle_suffix($i);
|
1504
1621
|
}
|
1505
1622
|
}
|
1506
1623
|
}
|
1507
|
-
|
1624
|
+
|
1508
1625
|
// helpers classes :
|
1509
1626
|
@if $gridle-generate-helpers-classes == true {
|
1510
1627
|
@include _gridle_generate_helper_classes();
|
1628
|
+
}
|
1629
|
+
|
1630
|
+
// generate all selector for extends :
|
1631
|
+
$push-common-selector : ();
|
1632
|
+
$pull-common-selector : ();
|
1633
|
+
$prefix-common-selector : ();
|
1634
|
+
$suffix-common-selector : ();
|
1635
|
+
$common-selector : ();
|
1636
|
+
@for $i from 0 through $gridle-columns-count {
|
1511
1637
|
|
1512
|
-
|
1513
|
-
|
1638
|
+
// variables :
|
1639
|
+
$calculatedSelector : "#{$i*$gridle-name-multiplicator}";
|
1640
|
+
|
1641
|
+
// selectors :
|
1642
|
+
$push-common-selector : append( $push-common-selector, unquote("#{_gridle_prefixed_class("push-#{$calculatedSelector}")}"), comma );
|
1643
|
+
$pull-common-selector : append( $pull-common-selector, unquote("#{_gridle_prefixed_class("pull-#{$calculatedSelector}")}"), comma );
|
1644
|
+
$prefix-common-selector : append( $prefix-common-selector, unquote("#{_gridle_prefixed_class("prefix-#{$calculatedSelector}")}"), comma );
|
1645
|
+
$suffix-common-selector : append( $suffix-common-selector, unquote("#{_gridle_prefixed_class("suffix-#{$calculatedSelector}")}"), comma );
|
1646
|
+
$common-selector : append( $common-selector, unquote("#{_gridle_prefixed_class("grid-#{$calculatedSelector}")}"), comma );
|
1647
|
+
|
1648
|
+
// generate all classes for media queries :
|
1649
|
+
@for $j from 1 through 15 {
|
1650
|
+
// setup vars :
|
1651
|
+
$media : _gridle_get_media_query_vars($j,"name");
|
1652
|
+
$classes : _gridle_get_media_query_vars($j,"classes");
|
1653
|
+
|
1654
|
+
// generate classes :
|
1655
|
+
@if $media and $classes == true {
|
1656
|
+
|
1657
|
+
$push-common-selector : append( $push-common-selector, unquote("#{_gridle_prefixed_class("push-#{$media}-#{$calculatedSelector}")}"), comma );
|
1658
|
+
$pull-common-selector : append( $pull-common-selector, unquote("#{_gridle_prefixed_class("pull-#{$media}-#{$calculatedSelector}")}"), comma );
|
1659
|
+
$prefix-common-selector : append( $prefix-common-selector, unquote("#{_gridle_prefixed_class("prefix-#{$media}-#{$calculatedSelector}")}"), comma );
|
1660
|
+
$suffix-common-selector : append( $suffix-common-selector, unquote("#{_gridle_prefixed_class("suffix-#{$media}-#{$calculatedSelector}")}"), comma );
|
1661
|
+
$common-selector : append( $common-selector, unquote("#{_gridle_prefixed_class("grid-#{$media}-#{$calculatedSelector}")}"), comma );
|
1662
|
+
}
|
1663
|
+
}
|
1664
|
+
|
1665
|
+
// generate all classes for usefull states :
|
1666
|
+
@if $gridle-generate-useful-states-classes != null {
|
1667
|
+
@each $state in $gridle-generate-useful-states-classes {
|
1668
|
+
$push-common-selector : append( $push-common-selector, unquote("#{_gridle_prefixed_class("push-#{$state}-#{$calculatedSelector}")}"), comma );
|
1669
|
+
$pull-common-selector : append( $pull-common-selector, unquote("#{_gridle_prefixed_class("pull-#{$state}-#{$calculatedSelector}")}"), comma );
|
1670
|
+
$prefix-common-selector : append( $prefix-common-selector, unquote("#{_gridle_prefixed_class("prefix-#{$state}-#{$calculatedSelector}")}"), comma );
|
1671
|
+
$suffix-common-selector : append( $suffix-common-selector, unquote("#{_gridle_prefixed_class("suffix-#{$state}-#{$calculatedSelector}")}"), comma );
|
1672
|
+
$common-selector : append( $common-selector, unquote("#{_gridle_prefixed_class("grid-#{$state}-#{$calculatedSelector}")}"), comma );
|
1673
|
+
}
|
1514
1674
|
}
|
1515
1675
|
}
|
1516
|
-
|
1676
|
+
|
1677
|
+
// common css :
|
1678
|
+
#{$push-common-selector} {
|
1679
|
+
@include _gridle_push_common();
|
1680
|
+
}
|
1681
|
+
#{$pull-common-selector} {
|
1682
|
+
@include _gridle_pull_common();
|
1683
|
+
}
|
1684
|
+
#{$prefix-common-selector} {
|
1685
|
+
@include _gridle_prefix_common();
|
1686
|
+
}
|
1687
|
+
#{$suffix-common-selector} {
|
1688
|
+
@include _gridle_suffix_common();
|
1689
|
+
}
|
1690
|
+
#{$common-selector} {
|
1691
|
+
@include _gridle_grid_common();
|
1692
|
+
}
|
1693
|
+
|
1517
1694
|
// generate all classes for differents media queries :
|
1518
1695
|
@for $i from 1 through 15 {
|
1519
1696
|
// setup vars :
|
1520
1697
|
$media : _gridle_get_media_query_vars($i,"name");
|
1521
|
-
$min-width : _gridle_get_media_query_vars($i,"min-width");
|
1522
|
-
$max-width : _gridle_get_media_query_vars($i,"max-width");
|
1523
1698
|
$classes : _gridle_get_media_query_vars($i,"classes");
|
1524
|
-
|
1699
|
+
|
1525
1700
|
// generate all media queries grid classes :
|
1526
1701
|
@if $media and $classes == true {
|
1527
|
-
|
1528
|
-
// manage body query :
|
1529
|
-
$body-query : _get_media_query_for_state($media);
|
1530
|
-
@if ($body-query != null) {
|
1531
|
-
@if $i == 1 {
|
1532
|
-
$gridle-settings-states : "#{$gridle-settings-states}\"#{$media}\":\"#{$body-query}\"";
|
1533
|
-
} @else {
|
1534
|
-
$gridle-settings-states : "#{$gridle-settings-states},\"#{$media}\":\"#{$body-query}\"";
|
1535
|
-
}
|
1536
|
-
}
|
1537
|
-
|
1538
|
-
// extend common css :
|
1539
|
-
@for $j from 0 through $gridle-columns-count {
|
1540
|
-
|
1541
|
-
// extend classes :
|
1542
|
-
#{_gridle_prefixed_class("grid-#{$media}-#{$j*$gridle-name-multiplicator}")} {
|
1543
|
-
@include _gridle_grid_common();
|
1544
|
-
}
|
1545
|
-
@if $gridle-generate-push-classes == true {
|
1546
|
-
#{_gridle_prefixed_class("push-#{$media}-#{$j*$gridle-name-multiplicator}")} {
|
1547
|
-
@include _gridle_push_common();
|
1548
|
-
}
|
1549
|
-
}
|
1550
|
-
@if $gridle-generate-pull-classes == true {
|
1551
|
-
#{_gridle_prefixed_class("pull-#{$media}-#{$j*$gridle-name-multiplicator}")} {
|
1552
|
-
@include _gridle_pull_common();
|
1553
|
-
}
|
1554
|
-
}
|
1555
|
-
@if $gridle-generate-prefix-classes == true {
|
1556
|
-
#{_gridle_prefixed_class("prefix-#{$media}-#{$j*$gridle-name-multiplicator}")} {
|
1557
|
-
@include _gridle_prefix_common();
|
1558
|
-
}
|
1559
|
-
}
|
1560
|
-
@if $gridle-generate-suffix-classes == true {
|
1561
|
-
#{_gridle_prefixed_class("suffix-#{$media}-#{$j*$gridle-name-multiplicator}")} {
|
1562
|
-
@include _gridle_suffix_common();
|
1563
|
-
}
|
1564
|
-
}
|
1565
|
-
|
1566
|
-
}
|
1567
|
-
|
1702
|
+
|
1568
1703
|
// generate all the classes :
|
1569
1704
|
@include gridle_state($media, null, $has-parent) {
|
1570
|
-
|
1571
|
-
@for $
|
1572
|
-
|
1573
|
-
|
1574
|
-
|
1705
|
+
|
1706
|
+
@for $j from 0 through $gridle-columns-count {
|
1707
|
+
|
1708
|
+
// variables :
|
1709
|
+
$calculatedSelector : "#{$j*$gridle-name-multiplicator}";
|
1710
|
+
|
1711
|
+
// classes :
|
1712
|
+
#{_gridle_prefixed_class("grid-#{$media}-#{$calculatedSelector}")} {
|
1713
|
+
@include _gridle($j,$media);
|
1575
1714
|
}
|
1576
1715
|
@if $gridle-generate-push-classes == true {
|
1577
|
-
#{_gridle_prefixed_class("push-#{$media}-#{$
|
1578
|
-
@include _gridle_push($
|
1716
|
+
#{_gridle_prefixed_class("push-#{$media}-#{$calculatedSelector}")} {
|
1717
|
+
@include _gridle_push($j,$media);
|
1579
1718
|
}
|
1580
1719
|
}
|
1581
1720
|
@if $gridle-generate-pull-classes == true {
|
1582
|
-
#{_gridle_prefixed_class("pull-#{$media}-#{$
|
1583
|
-
@include _gridle_pull($
|
1721
|
+
#{_gridle_prefixed_class("pull-#{$media}-#{$calculatedSelector}")} {
|
1722
|
+
@include _gridle_pull($j,$media);
|
1584
1723
|
}
|
1585
1724
|
}
|
1586
1725
|
@if $gridle-generate-prefix-classes == true {
|
1587
|
-
#{_gridle_prefixed_class("prefix-#{$media}-#{$
|
1588
|
-
@include _gridle_prefix($
|
1726
|
+
#{_gridle_prefixed_class("prefix-#{$media}-#{$calculatedSelector}")} {
|
1727
|
+
@include _gridle_prefix($j,$media);
|
1589
1728
|
}
|
1590
1729
|
}
|
1591
1730
|
@if $gridle-generate-suffix-classes == true {
|
1592
|
-
#{_gridle_prefixed_class("suffix-#{$media}-#{$
|
1593
|
-
@include _gridle_suffix($
|
1594
|
-
}
|
1731
|
+
#{_gridle_prefixed_class("suffix-#{$media}-#{$calculatedSelector}")} {
|
1732
|
+
@include _gridle_suffix($j,$media);
|
1733
|
+
}
|
1595
1734
|
}
|
1596
1735
|
}
|
1597
|
-
|
1598
|
-
// media queries helpers classes
|
1736
|
+
|
1737
|
+
// media queries helpers classes :
|
1599
1738
|
@if $gridle-generate-helpers-classes == true and $media {
|
1600
1739
|
@include _gridle_generate_helper_classes($media);
|
1601
1740
|
}
|
1602
1741
|
}
|
1603
|
-
|
1604
|
-
// helpers that have extend in them (can not been in the @media) :
|
1605
|
-
@if $gridle-generate-helpers-classes == true and $media {
|
1606
|
-
#{_gridle_prefixed_class("parent-#{$media}")} {
|
1607
|
-
@include gridle_parent($media);
|
1608
|
-
}
|
1609
|
-
}
|
1610
1742
|
}
|
1611
1743
|
}
|
1612
|
-
|
1744
|
+
|
1613
1745
|
// usefull states :
|
1614
1746
|
@if $gridle-generate-useful-states-classes != null {
|
1615
1747
|
@each $state in $gridle-generate-useful-states-classes {
|
1616
|
-
|
1617
|
-
// manage body query :
|
1618
|
-
$body-query : _get_media_query_for_state($state);
|
1619
|
-
@if ($body-query != null) {
|
1620
|
-
$gridle-settings-states : "#{$gridle-settings-states},\"#{$state}\":\"#{$body-query}\"";
|
1621
|
-
}
|
1622
|
-
|
1623
|
-
// extend common css :
|
1624
|
-
@for $l from 0 through $gridle-columns-count {
|
1625
|
-
|
1626
|
-
// extend classes :
|
1627
|
-
#{_gridle_prefixed_class("grid-#{$state}-#{$l*$gridle-name-multiplicator}")} {
|
1628
|
-
@include _gridle_grid_common();
|
1629
|
-
}
|
1630
|
-
@if $gridle-generate-push-classes == true {
|
1631
|
-
#{_gridle_prefixed_class("push-#{$state}-#{$l*$gridle-name-multiplicator}")} {
|
1632
|
-
@include _gridle_push_common();
|
1633
|
-
}
|
1634
|
-
}
|
1635
|
-
@if $gridle-generate-pull-classes == true {
|
1636
|
-
#{_gridle_prefixed_class("pull-#{$state}-#{$l*$gridle-name-multiplicator}")} {
|
1637
|
-
@include _gridle_pull_common();
|
1638
|
-
}
|
1639
|
-
}
|
1640
|
-
@if $gridle-generate-prefix-classes == true {
|
1641
|
-
#{_gridle_prefixed_class("prefix-#{$state}-#{$l*$gridle-name-multiplicator}")} {
|
1642
|
-
@include _gridle_prefix_common();
|
1643
|
-
}
|
1644
|
-
}
|
1645
|
-
@if $gridle-generate-suffix-classes == true {
|
1646
|
-
#{_gridle_prefixed_class("suffix-#{$state}-#{$l*$gridle-name-multiplicator}")} {
|
1647
|
-
@include _gridle_suffix_common();
|
1648
|
-
}
|
1649
|
-
}
|
1650
|
-
|
1651
|
-
}
|
1652
|
-
|
1748
|
+
|
1653
1749
|
// creating classes :
|
1654
1750
|
@include gridle_state($state, null, $has-parent) {
|
1751
|
+
|
1752
|
+
@for $k from 0 through $gridle-columns-count {
|
1753
|
+
|
1754
|
+
// variables :
|
1755
|
+
$calculatedSelector : "#{$k*$gridle-name-multiplicator}";
|
1655
1756
|
|
1656
|
-
|
1657
|
-
|
1658
|
-
|
1659
|
-
@include _gridle($m,$state);
|
1757
|
+
// classes :
|
1758
|
+
#{_gridle_prefixed_class("grid-#{$state}-#{$calculatedSelector}")} {
|
1759
|
+
@include _gridle($k,$state);
|
1660
1760
|
}
|
1661
1761
|
@if $gridle-generate-push-classes == true {
|
1662
|
-
#{_gridle_prefixed_class("push-#{$state}-#{$
|
1663
|
-
@include _gridle_push($
|
1762
|
+
#{_gridle_prefixed_class("push-#{$state}-#{$calculatedSelector}")} {
|
1763
|
+
@include _gridle_push($k,$state);
|
1664
1764
|
}
|
1665
1765
|
}
|
1666
1766
|
@if $gridle-generate-pull-classes == true {
|
1667
|
-
#{_gridle_prefixed_class("pull-#{$state}-#{$
|
1668
|
-
@include _gridle_pull($
|
1767
|
+
#{_gridle_prefixed_class("pull-#{$state}-#{$calculatedSelector}")} {
|
1768
|
+
@include _gridle_pull($k,$state);
|
1669
1769
|
}
|
1670
1770
|
}
|
1671
1771
|
@if $gridle-generate-prefix-classes == true {
|
1672
|
-
#{_gridle_prefixed_class("prefix-#{$state}-#{$
|
1673
|
-
@include _gridle_prefix($
|
1772
|
+
#{_gridle_prefixed_class("prefix-#{$state}-#{$calculatedSelector}")} {
|
1773
|
+
@include _gridle_prefix($k,$state);
|
1674
1774
|
}
|
1675
1775
|
}
|
1676
1776
|
@if $gridle-generate-suffix-classes == true {
|
1677
|
-
#{_gridle_prefixed_class("suffix-#{$state}-#{$
|
1678
|
-
@include _gridle_suffix($
|
1679
|
-
}
|
1777
|
+
#{_gridle_prefixed_class("suffix-#{$state}-#{$calculatedSelector}")} {
|
1778
|
+
@include _gridle_suffix($k,$state);
|
1779
|
+
}
|
1680
1780
|
}
|
1681
1781
|
}
|
1682
|
-
|
1683
|
-
// media queries helpers classes (that not contain extend css) :
|
1782
|
+
|
1684
1783
|
@if $gridle-generate-helpers-classes == true {
|
1685
|
-
@include _gridle_generate_helper_classes($state);
|
1686
|
-
}
|
1687
|
-
}
|
1688
|
-
|
1689
|
-
// helpers that have extend in them (can not been in the @media) :
|
1690
|
-
@if $gridle-generate-helpers-classes == true {
|
1691
|
-
#{_gridle_prefixed_class("parent-#{$state}")} {
|
1692
|
-
@include gridle_parent($state);
|
1784
|
+
@include _gridle_generate_helper_classes($state);
|
1693
1785
|
}
|
1694
1786
|
}
|
1695
1787
|
}
|
1696
1788
|
}
|
1697
|
-
|
1698
|
-
// generate settings
|
1699
|
-
|
1700
|
-
$gridle-settings : "{";
|
1701
|
-
$gridle-settings : "#{$gridle-settings} \"states\" : #{$gridle-settings-states}";
|
1702
|
-
$gridle-settings : "#{$gridle-settings}, \"columnsCount\" : #{$gridle-columns-count}";
|
1703
|
-
$gridle-settings : "#{$gridle-settings}, \"gutterWidth\" : \"#{$gridle-gutter-width}\"";
|
1704
|
-
$gridle-settings : "#{$gridle-settings}, \"nameMultiplicator\" : #{$gridle-name-multiplicator}";
|
1705
|
-
$gridle-settings : "#{$gridle-settings}, \"direction\" : \"#{$gridle-direction}\"";
|
1706
|
-
$gridle-settings : "#{$gridle-settings}, \"ie7Support\" : #{$gridle-ie7-support}";
|
1707
|
-
$gridle-settings : "#{$gridle-settings}, \"debug\" : #{$gridle-debug}";
|
1708
|
-
$gridle-settings : "#{$gridle-settings}, \"debugShowClassNames\" : #{$gridle-debug-show-class-names}";
|
1709
|
-
$gridle-settings : "#{$gridle-settings}, \"htmlStatesClasses\" : #{$gridle-html-states-classes}";
|
1710
|
-
$gridle-settings : "#{$gridle-settings}, \"generateHelpersClasses\" : #{$gridle-generate-helpers-classes}";
|
1711
|
-
$gridle-settings : "#{$gridle-settings}, \"generatePushClasses\" : #{$gridle-generate-push-classes}";
|
1712
|
-
$gridle-settings : "#{$gridle-settings}, \"generatePullClasses\" : #{$gridle-generate-pull-classes}";
|
1713
|
-
$gridle-settings : "#{$gridle-settings}, \"generatePrefixClasses\" : #{$gridle-generate-prefix-classes}";
|
1714
|
-
$gridle-settings : "#{$gridle-settings}, \"generateSuffixClasses\" : #{$gridle-generate-suffix-classes}";
|
1715
|
-
$gridle-settings : "#{$gridle-settings}, \"classPrefix\" : \"#{$gridle-class-prefix}\"";
|
1716
|
-
$useful-states-classes : "[";
|
1717
|
-
@for $i from 1 through length($gridle-generate-useful-states-classes) {
|
1718
|
-
@if $i > 1 {
|
1719
|
-
$useful-states-classes : "#{$useful-states-classes},";
|
1720
|
-
}
|
1721
|
-
$useful-states-classes : "#{$useful-states-classes}\"#{nth($gridle-generate-useful-states-classes,$i)}\"";
|
1722
|
-
}
|
1723
|
-
$useful-states-classes : "#{$useful-states-classes}]";
|
1724
|
-
$gridle-settings : "#{$gridle-settings}, \"generateUsefulStatesClasses\" : #{$useful-states-classes}";
|
1725
|
-
$gridle-settings : "#{$gridle-settings}}";
|
1726
|
-
#gridle-settings {
|
1727
|
-
content : $gridle-settings;
|
1728
|
-
}
|
1789
|
+
|
1790
|
+
// generate json settings :
|
1791
|
+
@include gridle_generate_json_settings();
|
1729
1792
|
}
|