flint-gs 1.6.5 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -13
- data/lib/flint.rb +64 -4
- data/stylesheets/flint/config/_config.scss +3 -3
- data/stylesheets/flint/functions/_functions.scss +1 -1
- data/stylesheets/flint/functions/helpers/_helpers.scss +32 -23
- data/stylesheets/flint/functions/lib/_calc-breakpoint.scss +11 -11
- data/stylesheets/flint/functions/lib/_calc-margin.scss +40 -12
- data/stylesheets/flint/functions/lib/_calc-width.scss +21 -12
- data/stylesheets/flint/functions/lib/_exists.scss +6 -6
- data/stylesheets/flint/functions/lib/_fluid-width.scss +2 -2
- data/stylesheets/flint/functions/lib/_get-index.scss +3 -3
- data/stylesheets/flint/functions/lib/_get-instance-value.scss +4 -4
- data/stylesheets/flint/functions/lib/_get-value.scss +3 -3
- data/stylesheets/flint/functions/lib/_has-family-instance.scss +74 -0
- data/stylesheets/flint/functions/lib/_instance.scss +17 -15
- data/stylesheets/flint/functions/lib/_last.scss +2 -2
- data/stylesheets/flint/functions/lib/_list-to-string.scss +4 -4
- data/stylesheets/flint/functions/lib/_map-fetch.scss +6 -9
- data/stylesheets/flint/functions/lib/_next-index.scss +3 -3
- data/stylesheets/flint/functions/lib/_purge.scss +2 -2
- data/stylesheets/flint/functions/lib/_remove.scss +4 -4
- data/stylesheets/flint/functions/lib/_replace-substring.scss +21 -15
- data/stylesheets/flint/functions/lib/_replace.scss +3 -3
- data/stylesheets/flint/functions/lib/_steal-key.scss +3 -3
- data/stylesheets/flint/functions/lib/_steal-values.scss +3 -3
- data/stylesheets/flint/functions/lib/_string-to-list.scss +63 -57
- data/stylesheets/flint/functions/lib/_string-to-number.scss +42 -38
- data/stylesheets/flint/functions/lib/_support-syntax-bem.scss +3 -3
- data/stylesheets/flint/functions/lib/_support-syntax.scss +4 -4
- data/stylesheets/flint/functions/lib/_types-in-list.scss +3 -3
- data/stylesheets/flint/functions/lib/_use-syntax.scss +3 -3
- data/stylesheets/flint/globals/_globals.scss +20 -4
- data/stylesheets/flint/mixins/lib/_calculate.scss +368 -563
- data/stylesheets/flint/mixins/lib/_clearfix.scss +7 -7
- data/stylesheets/flint/mixins/lib/_main.scss +244 -244
- data/stylesheets/flint/mixins/lib/_new-instance.scss +20 -20
- data/stylesheets/flint/mixins/lib/_print-instance.scss +14 -14
- metadata +3 -3
- data/stylesheets/flint/functions/lib/_get-family-instance.scss +0 -59
@@ -1,27 +1,27 @@
|
|
1
1
|
// Creates a new instance, adds to global instance map
|
2
2
|
// -------------------------------------------------------------------------------
|
3
|
-
// @param $
|
4
|
-
// @param $
|
5
|
-
// @param $
|
6
|
-
// @param $
|
7
|
-
// @param $
|
8
|
-
// @param $
|
9
|
-
// @param $
|
10
|
-
// @param $
|
3
|
+
// @param $calc-key [string] : breakpoint key
|
4
|
+
// @param $calc-span [number] : span
|
5
|
+
// @param $calc-context [number] : context
|
6
|
+
// @param $calc-gutter [number] : gutter
|
7
|
+
// @param $calc-shift [number] : shift
|
8
|
+
// @param $output-width [number] : width
|
9
|
+
// @param $output-margin-right [number] : right margin
|
10
|
+
// @param $output-margin-left [number] : left margin
|
11
11
|
// -------------------------------------------------------------------------------
|
12
12
|
// @output new instance map
|
13
13
|
|
14
|
-
@mixin
|
15
|
-
$flint__instances:
|
16
|
-
instance(
|
17
|
-
$
|
18
|
-
$
|
19
|
-
$
|
20
|
-
$
|
21
|
-
$
|
22
|
-
$
|
23
|
-
$
|
24
|
-
$
|
14
|
+
@mixin flint-new-instance($calc-key, $calc-span, $calc-context, $calc-gutter, $calc-shift, $output-width, $output-margin-right, $output-margin-left) {
|
15
|
+
$flint__instances:
|
16
|
+
flint-instance(
|
17
|
+
$calc-key,
|
18
|
+
$calc-span,
|
19
|
+
$calc-context,
|
20
|
+
$calc-gutter,
|
21
|
+
$calc-shift,
|
22
|
+
$output-width,
|
23
|
+
$output-margin-right,
|
24
|
+
$output-margin-left
|
25
25
|
)
|
26
26
|
!global;
|
27
|
-
}
|
27
|
+
}
|
@@ -1,20 +1,20 @@
|
|
1
1
|
// Prints debug properties
|
2
2
|
// -------------------------------------------------------------------------------
|
3
|
-
// @dependence `
|
3
|
+
// @dependence `flint-print-instance()`
|
4
4
|
// -------------------------------------------------------------------------------
|
5
|
-
// @param $
|
5
|
+
// @param $calc-key [string] : breakpoint key to search for instance
|
6
6
|
// -------------------------------------------------------------------------------
|
7
7
|
// @output instance map
|
8
8
|
|
9
|
-
@mixin
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
9
|
+
@mixin flint-debug-instance($calc-key) {
|
10
|
+
@if flint-get-value("settings", "debug-mode") {
|
11
|
+
// Lets clean up the selector a bit...
|
12
|
+
$selector-string: selector_string();
|
13
|
+
$selector-list: flint-string-to-list($selector-string);
|
14
|
+
$selector-cleaned: flint-list-to-string($selector-list, " ");
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
@include printInstance( map-get( $flint__instances, unquote($printKey) ) );
|
16
|
+
$printKey: "#{$selector-cleaned}" + "::" + "#{$calc-key}";
|
17
|
+
@include flint-print-instance( map-get( $flint__instances, unquote($printKey) ) );
|
18
18
|
}
|
19
19
|
}
|
20
20
|
|
@@ -24,15 +24,15 @@
|
|
24
24
|
// -------------------------------------------------------------------------------
|
25
25
|
// @output instance map
|
26
26
|
|
27
|
-
@mixin
|
27
|
+
@mixin flint-print-instance($instance) {
|
28
28
|
|
29
29
|
// Loop through each property in passed instance
|
30
30
|
@each $property, $value in $instance {
|
31
31
|
|
32
32
|
// Check if value is output map
|
33
|
-
@if is-map($value) {
|
34
|
-
@each $
|
35
|
-
-flint-output-#{$
|
33
|
+
@if flint-is-map($value) {
|
34
|
+
@each $p, $v in $value {
|
35
|
+
-flint-output-#{$p}: #{$v};
|
36
36
|
}
|
37
37
|
// Else, print values as flagged comments
|
38
38
|
} @else {
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flint-gs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ezekiel Gabrielse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sass
|
@@ -58,10 +58,10 @@ files:
|
|
58
58
|
- stylesheets/flint/functions/lib/_calc-width.scss
|
59
59
|
- stylesheets/flint/functions/lib/_exists.scss
|
60
60
|
- stylesheets/flint/functions/lib/_fluid-width.scss
|
61
|
-
- stylesheets/flint/functions/lib/_get-family-instance.scss
|
62
61
|
- stylesheets/flint/functions/lib/_get-index.scss
|
63
62
|
- stylesheets/flint/functions/lib/_get-instance-value.scss
|
64
63
|
- stylesheets/flint/functions/lib/_get-value.scss
|
64
|
+
- stylesheets/flint/functions/lib/_has-family-instance.scss
|
65
65
|
- stylesheets/flint/functions/lib/_instance.scss
|
66
66
|
- stylesheets/flint/functions/lib/_last.scss
|
67
67
|
- stylesheets/flint/functions/lib/_list-to-string.scss
|
@@ -1,59 +0,0 @@
|
|
1
|
-
// Checks if instance exists in selector familiy tree, falls back from current selector
|
2
|
-
// -------------------------------------------------------------------------------
|
3
|
-
// @param $key [string] : breakpoint key to search for matching instance
|
4
|
-
// @param $syntax [string | null] : searches for instance using passed syntax
|
5
|
-
// -------------------------------------------------------------------------------
|
6
|
-
// @return matching instance | false
|
7
|
-
|
8
|
-
@function get-family-instance($key: get-value("settings", "default"), $syntax: $flint__support-syntax) {
|
9
|
-
$selector-string: selector_string();
|
10
|
-
|
11
|
-
// Check for syntax support, try to find instance using it
|
12
|
-
@if $syntax {
|
13
|
-
$selector-list: use-syntax($selector-string);
|
14
|
-
$length: length($selector-list);
|
15
|
-
|
16
|
-
// Loop through transformed selectors
|
17
|
-
@for $i from 1 through $length {
|
18
|
-
|
19
|
-
// Check last selector in list
|
20
|
-
@if exists($flint__instances, "#{last($selector-list)}::#{$key}") {
|
21
|
-
|
22
|
-
// Return the matching instance key
|
23
|
-
@return "#{last($selector-list)}::#{$key}";
|
24
|
-
|
25
|
-
} @else {
|
26
|
-
|
27
|
-
// Else, remove the last selector and loop again
|
28
|
-
$selector-list: remove($selector-list, last($selector-list));
|
29
|
-
|
30
|
-
}
|
31
|
-
}
|
32
|
-
|
33
|
-
// Search for a parent instance normally
|
34
|
-
@return get-family-instance($key, null);
|
35
|
-
|
36
|
-
} @else {
|
37
|
-
$selector-list: string-to-list($selector-string);
|
38
|
-
$length: length($selector-list);
|
39
|
-
|
40
|
-
// Loop through length of list of selectors
|
41
|
-
@for $i from 1 through $length {
|
42
|
-
|
43
|
-
// Make sure that we're not counting the current selector string
|
44
|
-
@if exists($flint__instances, "#{list-to-string($selector-list, " ")}::#{$key}") and $selector-string != list-to-string($selector-list, " ") {
|
45
|
-
|
46
|
-
// Return the matching instance key
|
47
|
-
@return "#{list-to-string($selector-list, " ")}::#{$key}";
|
48
|
-
|
49
|
-
} @else {
|
50
|
-
|
51
|
-
// Else, remove the last selector and loop again
|
52
|
-
$selector-list: remove($selector-list, last($selector-list));
|
53
|
-
|
54
|
-
}
|
55
|
-
}
|
56
|
-
|
57
|
-
@return false;
|
58
|
-
}
|
59
|
-
}
|