flint-gs 1.7.1 → 1.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +21 -21
- data/README.md +906 -906
- data/lib/flint.rb +67 -77
- data/stylesheets/_flint.scss +6 -6
- data/stylesheets/flint/config/_config.scss +83 -83
- data/stylesheets/flint/functions/_functions.scss +40 -41
- data/stylesheets/flint/functions/helpers/_helpers.scss +181 -181
- data/stylesheets/flint/functions/lib/_calc-breakpoint.scss +33 -33
- data/stylesheets/flint/functions/lib/_calc-margin.scss +57 -57
- data/stylesheets/flint/functions/lib/_calc-width.scss +50 -50
- data/stylesheets/flint/functions/lib/_exists.scss +22 -22
- data/stylesheets/flint/functions/lib/_fluid-width.scss +10 -10
- data/stylesheets/flint/functions/lib/_get-index.scss +13 -13
- data/stylesheets/flint/functions/lib/_get-instance-value.scss +17 -17
- data/stylesheets/flint/functions/lib/_get-value.scss +14 -14
- data/stylesheets/flint/functions/lib/_has-family-instance.scss +74 -74
- data/stylesheets/flint/functions/lib/_instance.scss +46 -46
- data/stylesheets/flint/functions/lib/_last.scss +9 -9
- data/stylesheets/flint/functions/lib/_list-to-string.scss +25 -25
- data/stylesheets/flint/functions/lib/_map-fetch.scss +30 -30
- data/stylesheets/flint/functions/lib/_next-index.scss +15 -15
- data/stylesheets/flint/functions/lib/_purge.scss +19 -19
- data/stylesheets/flint/functions/lib/_remove.scss +13 -13
- data/stylesheets/flint/functions/lib/_replace-substring.scss +34 -34
- data/stylesheets/flint/functions/lib/_replace.scss +25 -25
- data/stylesheets/flint/functions/lib/_steal-key.scss +13 -13
- data/stylesheets/flint/functions/lib/_steal-values.scss +14 -14
- data/stylesheets/flint/functions/lib/_string-to-list.scss +90 -90
- data/stylesheets/flint/functions/lib/_support-syntax-bem.scss +31 -31
- data/stylesheets/flint/functions/lib/_support-syntax.scss +28 -28
- data/stylesheets/flint/functions/lib/_types-in-list.scss +119 -119
- data/stylesheets/flint/functions/lib/_use-syntax.scss +14 -14
- data/stylesheets/flint/globals/_globals.scss +38 -38
- data/stylesheets/flint/mixins/_mixins.scss +7 -7
- data/stylesheets/flint/mixins/lib/_calculate.scss +571 -571
- data/stylesheets/flint/mixins/lib/_clearfix.scss +19 -19
- data/stylesheets/flint/mixins/lib/_main.scss +935 -935
- data/stylesheets/flint/mixins/lib/_new-instance.scss +27 -27
- data/stylesheets/flint/mixins/lib/_print-instance.scss +42 -42
- metadata +16 -23
- data/stylesheets/flint/functions/lib/_string-to-number.scss +0 -77
@@ -1,119 +1,119 @@
|
|
1
|
-
// Checks type of each item in list
|
2
|
-
// -------------------------------------------------------------------------------
|
3
|
-
// @param $list [list] : list of items
|
4
|
-
// @param $assert-types [string | list] : single or list of types to assert
|
5
|
-
// @param $assert-length [number] : assert length of list
|
6
|
-
// -------------------------------------------------------------------------------
|
7
|
-
// @return [bool]
|
8
|
-
|
9
|
-
@function flint-types-in-list($list, $assert-types: null, $assert-length: null) {
|
10
|
-
@if flint-is-list($list) {
|
11
|
-
|
12
|
-
// Assert types in list?
|
13
|
-
// ----
|
14
|
-
@if $assert-types {
|
15
|
-
|
16
|
-
// Assert length of list?
|
17
|
-
// ----
|
18
|
-
@if $assert-length {
|
19
|
-
// Get length of list
|
20
|
-
$length: length($list);
|
21
|
-
|
22
|
-
// Make sure lengths match
|
23
|
-
@if $length == $assert-length {
|
24
|
-
// Keep empty list of types
|
25
|
-
$types: ();
|
26
|
-
|
27
|
-
// List of asserted types?
|
28
|
-
// ----
|
29
|
-
@if flint-is-list($assert-types) {
|
30
|
-
|
31
|
-
// Make sure length of types match list
|
32
|
-
// ----
|
33
|
-
@if length($assert-types) == $length {
|
34
|
-
|
35
|
-
// Loop over each item in list
|
36
|
-
@for $i from 1 through $assert-length {
|
37
|
-
$item: nth($list, $i);
|
38
|
-
$type: nth($assert-types, $i);
|
39
|
-
|
40
|
-
// Check if type of item matches asserted type
|
41
|
-
@if type-of($item) != $type {
|
42
|
-
@return false;
|
43
|
-
}
|
44
|
-
|
45
|
-
$types: append($types, $type);
|
46
|
-
}
|
47
|
-
|
48
|
-
// Lengths did not match
|
49
|
-
// ----
|
50
|
-
} @else {
|
51
|
-
@return false;
|
52
|
-
}
|
53
|
-
|
54
|
-
// Assert a single type across list
|
55
|
-
// ----
|
56
|
-
} @else {
|
57
|
-
// Assert single type
|
58
|
-
$type: nth($assert-types, 1);
|
59
|
-
|
60
|
-
// Loop over each item in list
|
61
|
-
@for $i from 1 through $assert-length {
|
62
|
-
$item: nth($list, $i);
|
63
|
-
|
64
|
-
// Check if type of item matches asserted type
|
65
|
-
@if type-of($item) != $type {
|
66
|
-
@return false;
|
67
|
-
}
|
68
|
-
}
|
69
|
-
|
70
|
-
$types: append($types, $type);
|
71
|
-
}
|
72
|
-
|
73
|
-
// Return list of types
|
74
|
-
@return true;
|
75
|
-
|
76
|
-
// Lengths did not match, return false
|
77
|
-
} @else {
|
78
|
-
@return false;
|
79
|
-
}
|
80
|
-
|
81
|
-
// Just assert types in list, any length
|
82
|
-
// ----
|
83
|
-
} @else {
|
84
|
-
// Get asserted type
|
85
|
-
$type: $assert-types;
|
86
|
-
|
87
|
-
// Check each items type
|
88
|
-
@each $item in $list {
|
89
|
-
// Check if type of item matches asserted type
|
90
|
-
@if type-of($item) != $type {
|
91
|
-
@return false;
|
92
|
-
}
|
93
|
-
}
|
94
|
-
|
95
|
-
// Passed check
|
96
|
-
@return true;
|
97
|
-
}
|
98
|
-
|
99
|
-
// Just assert type of first item in list
|
100
|
-
// ----
|
101
|
-
} @else {
|
102
|
-
// Get type of first item in list
|
103
|
-
$type: type-of(nth($list, 1));
|
104
|
-
|
105
|
-
// Check each items type
|
106
|
-
@each $item in $list {
|
107
|
-
// Check if type of item matches asserted type
|
108
|
-
@if type-of($item) != $type {
|
109
|
-
@return false;
|
110
|
-
}
|
111
|
-
}
|
112
|
-
|
113
|
-
@return true;
|
114
|
-
}
|
115
|
-
// Was not a list, return false
|
116
|
-
} @else {
|
117
|
-
@return false;
|
118
|
-
}
|
119
|
-
}
|
1
|
+
// Checks type of each item in list
|
2
|
+
// -------------------------------------------------------------------------------
|
3
|
+
// @param $list [list] : list of items
|
4
|
+
// @param $assert-types [string | list] : single or list of types to assert
|
5
|
+
// @param $assert-length [number] : assert length of list
|
6
|
+
// -------------------------------------------------------------------------------
|
7
|
+
// @return [bool]
|
8
|
+
|
9
|
+
@function flint-types-in-list($list, $assert-types: null, $assert-length: null) {
|
10
|
+
@if flint-is-list($list) {
|
11
|
+
|
12
|
+
// Assert types in list?
|
13
|
+
// ----
|
14
|
+
@if $assert-types {
|
15
|
+
|
16
|
+
// Assert length of list?
|
17
|
+
// ----
|
18
|
+
@if $assert-length {
|
19
|
+
// Get length of list
|
20
|
+
$length: length($list);
|
21
|
+
|
22
|
+
// Make sure lengths match
|
23
|
+
@if $length == $assert-length {
|
24
|
+
// Keep empty list of types
|
25
|
+
$types: ();
|
26
|
+
|
27
|
+
// List of asserted types?
|
28
|
+
// ----
|
29
|
+
@if flint-is-list($assert-types) {
|
30
|
+
|
31
|
+
// Make sure length of types match list
|
32
|
+
// ----
|
33
|
+
@if length($assert-types) == $length {
|
34
|
+
|
35
|
+
// Loop over each item in list
|
36
|
+
@for $i from 1 through $assert-length {
|
37
|
+
$item: nth($list, $i);
|
38
|
+
$type: nth($assert-types, $i);
|
39
|
+
|
40
|
+
// Check if type of item matches asserted type
|
41
|
+
@if type-of($item) != $type {
|
42
|
+
@return false;
|
43
|
+
}
|
44
|
+
|
45
|
+
$types: append($types, $type);
|
46
|
+
}
|
47
|
+
|
48
|
+
// Lengths did not match
|
49
|
+
// ----
|
50
|
+
} @else {
|
51
|
+
@return false;
|
52
|
+
}
|
53
|
+
|
54
|
+
// Assert a single type across list
|
55
|
+
// ----
|
56
|
+
} @else {
|
57
|
+
// Assert single type
|
58
|
+
$type: nth($assert-types, 1);
|
59
|
+
|
60
|
+
// Loop over each item in list
|
61
|
+
@for $i from 1 through $assert-length {
|
62
|
+
$item: nth($list, $i);
|
63
|
+
|
64
|
+
// Check if type of item matches asserted type
|
65
|
+
@if type-of($item) != $type {
|
66
|
+
@return false;
|
67
|
+
}
|
68
|
+
}
|
69
|
+
|
70
|
+
$types: append($types, $type);
|
71
|
+
}
|
72
|
+
|
73
|
+
// Return list of types
|
74
|
+
@return true;
|
75
|
+
|
76
|
+
// Lengths did not match, return false
|
77
|
+
} @else {
|
78
|
+
@return false;
|
79
|
+
}
|
80
|
+
|
81
|
+
// Just assert types in list, any length
|
82
|
+
// ----
|
83
|
+
} @else {
|
84
|
+
// Get asserted type
|
85
|
+
$type: $assert-types;
|
86
|
+
|
87
|
+
// Check each items type
|
88
|
+
@each $item in $list {
|
89
|
+
// Check if type of item matches asserted type
|
90
|
+
@if type-of($item) != $type {
|
91
|
+
@return false;
|
92
|
+
}
|
93
|
+
}
|
94
|
+
|
95
|
+
// Passed check
|
96
|
+
@return true;
|
97
|
+
}
|
98
|
+
|
99
|
+
// Just assert type of first item in list
|
100
|
+
// ----
|
101
|
+
} @else {
|
102
|
+
// Get type of first item in list
|
103
|
+
$type: type-of(nth($list, 1));
|
104
|
+
|
105
|
+
// Check each items type
|
106
|
+
@each $item in $list {
|
107
|
+
// Check if type of item matches asserted type
|
108
|
+
@if type-of($item) != $type {
|
109
|
+
@return false;
|
110
|
+
}
|
111
|
+
}
|
112
|
+
|
113
|
+
@return true;
|
114
|
+
}
|
115
|
+
// Was not a list, return false
|
116
|
+
} @else {
|
117
|
+
@return false;
|
118
|
+
}
|
119
|
+
}
|
@@ -1,14 +1,14 @@
|
|
1
|
-
// Use global syntax
|
2
|
-
// -------------------------------------------------------------------------------
|
3
|
-
// @param $selectors [string] : string of selectors to transform
|
4
|
-
// -------------------------------------------------------------------------------
|
5
|
-
// @return [list] : list of transformed selectors according to syntax
|
6
|
-
|
7
|
-
@function flint-use-syntax($selectors) {
|
8
|
-
@if $flint__support-syntax {
|
9
|
-
@return flint-support-syntax($flint__support-syntax, $selectors);
|
10
|
-
} @else {
|
11
|
-
@warn "Support syntax is set to #{$flint__support-syntax}. Aborting mission.";
|
12
|
-
@return false;
|
13
|
-
}
|
14
|
-
}
|
1
|
+
// Use global syntax
|
2
|
+
// -------------------------------------------------------------------------------
|
3
|
+
// @param $selectors [string] : string of selectors to transform
|
4
|
+
// -------------------------------------------------------------------------------
|
5
|
+
// @return [list] : list of transformed selectors according to syntax
|
6
|
+
|
7
|
+
@function flint-use-syntax($selectors) {
|
8
|
+
@if $flint__support-syntax {
|
9
|
+
@return flint-support-syntax($flint__support-syntax, $selectors);
|
10
|
+
} @else {
|
11
|
+
@warn "Support syntax is set to #{$flint__support-syntax}. Aborting mission.";
|
12
|
+
@return false;
|
13
|
+
}
|
14
|
+
}
|
@@ -1,38 +1,38 @@
|
|
1
|
-
// Set global variable to check if foundation has been applied globally
|
2
|
-
// ----
|
3
|
-
$flint__foundation: "nonexistant" !global;
|
4
|
-
|
5
|
-
// Gather all keys, breakpoints and column counts
|
6
|
-
// ----
|
7
|
-
$flint__all__keys: flint-get-all-keys() !global;
|
8
|
-
$flint__all__breakpoints: flint-get-all-breakpoints() !global;
|
9
|
-
$flint__all__columns: flint-get-all-columns() !global;
|
10
|
-
|
11
|
-
// Keep track of all instances of mixin
|
12
|
-
// ----
|
13
|
-
$flint__instance-count: 0 !global;
|
14
|
-
$flint__instances: () !global;
|
15
|
-
|
16
|
-
// Font size for em calculation
|
17
|
-
// ----
|
18
|
-
$flint__base-font-size: 16px !global;
|
19
|
-
|
20
|
-
// Global syntax support
|
21
|
-
// ----
|
22
|
-
$flint__support-syntax: if(flint-exists($flint, "support-syntax"), flint-get-value("settings", "support-syntax"), false) !global;
|
23
|
-
|
24
|
-
// Use Ruby functions?
|
25
|
-
// ----
|
26
|
-
$flint__use-ruby-functions: if(flint-use-ruby-functions(), true, false) !global;
|
27
|
-
|
28
|
-
// Cached selector instance lists
|
29
|
-
// ----
|
30
|
-
$flint__cached-instances: () !global;
|
31
|
-
|
32
|
-
// Cached calculated values
|
33
|
-
// ----
|
34
|
-
$flint__cached-values: () !global;
|
35
|
-
|
36
|
-
// Chached calculation results
|
37
|
-
// ----
|
38
|
-
$flint__cache-results: () !global;
|
1
|
+
// Set global variable to check if foundation has been applied globally
|
2
|
+
// ----
|
3
|
+
$flint__foundation: "nonexistant" !global;
|
4
|
+
|
5
|
+
// Gather all keys, breakpoints and column counts
|
6
|
+
// ----
|
7
|
+
$flint__all__keys: flint-get-all-keys() !global;
|
8
|
+
$flint__all__breakpoints: flint-get-all-breakpoints() !global;
|
9
|
+
$flint__all__columns: flint-get-all-columns() !global;
|
10
|
+
|
11
|
+
// Keep track of all instances of mixin
|
12
|
+
// ----
|
13
|
+
$flint__instance-count: 0 !global;
|
14
|
+
$flint__instances: () !global;
|
15
|
+
|
16
|
+
// Font size for em calculation
|
17
|
+
// ----
|
18
|
+
$flint__base-font-size: 16px !global;
|
19
|
+
|
20
|
+
// Global syntax support
|
21
|
+
// ----
|
22
|
+
$flint__support-syntax: if(flint-exists($flint, "support-syntax"), flint-get-value("settings", "support-syntax"), false) !global;
|
23
|
+
|
24
|
+
// Use Ruby functions?
|
25
|
+
// ----
|
26
|
+
$flint__use-ruby-functions: if(flint-use-ruby-functions(), true, false) !global;
|
27
|
+
|
28
|
+
// Cached selector instance lists
|
29
|
+
// ----
|
30
|
+
$flint__cached-instances: () !global;
|
31
|
+
|
32
|
+
// Cached calculated values
|
33
|
+
// ----
|
34
|
+
$flint__cached-values: () !global;
|
35
|
+
|
36
|
+
// Chached calculation results
|
37
|
+
// ----
|
38
|
+
$flint__cache-results: () !global;
|
@@ -1,7 +1,7 @@
|
|
1
|
-
// Mixins
|
2
|
-
// ----
|
3
|
-
@import "lib/clearfix";
|
4
|
-
@import "lib/new-instance";
|
5
|
-
@import "lib/print-instance";
|
6
|
-
@import "lib/calculate";
|
7
|
-
@import "lib/main";
|
1
|
+
// Mixins
|
2
|
+
// ----
|
3
|
+
@import "lib/clearfix";
|
4
|
+
@import "lib/new-instance";
|
5
|
+
@import "lib/print-instance";
|
6
|
+
@import "lib/calculate";
|
7
|
+
@import "lib/main";
|