flint-gs 2.3.6 → 2.3.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +21 -21
- data/README.md +99 -98
- data/lib/flint-gs.rb +8 -0
- data/lib/flint.rb +22 -16
- data/lib/flint/functions.rb +99 -99
- data/lib/flint/version.rb +3 -3
- data/stylesheets/_flint.scss +7 -7
- data/stylesheets/flint/config/_config.scss +56 -56
- data/stylesheets/flint/functions/_functions.scss +48 -48
- data/stylesheets/flint/functions/helpers/_helpers.scss +229 -229
- data/stylesheets/flint/functions/lib/_calc-breakpoint.scss +47 -47
- data/stylesheets/flint/functions/lib/_calc-width.scss +70 -70
- data/stylesheets/flint/functions/lib/_fluid-width.scss +15 -15
- data/stylesheets/flint/functions/lib/_get-index.scss +21 -21
- data/stylesheets/flint/functions/lib/_get-instance-value.scss +15 -15
- data/stylesheets/flint/functions/lib/_get-value.scss +14 -14
- data/stylesheets/flint/functions/lib/_has-family-instance.scss +84 -84
- data/stylesheets/flint/functions/lib/_html-encode.scss +14 -14
- data/stylesheets/flint/functions/lib/_instance.scss +48 -48
- data/stylesheets/flint/functions/lib/_last.scss +14 -14
- data/stylesheets/flint/functions/lib/_list-to-str.scss +38 -38
- data/stylesheets/flint/functions/lib/_map-fetch.scss +31 -31
- data/stylesheets/flint/functions/lib/_next-index.scss +14 -14
- data/stylesheets/flint/functions/lib/_purge.scss +24 -24
- data/stylesheets/flint/functions/lib/_remove.scss +18 -18
- data/stylesheets/flint/functions/lib/_replace.scss +30 -30
- data/stylesheets/flint/functions/lib/_steal-key.scss +32 -32
- data/stylesheets/flint/functions/lib/_steal-values.scss +15 -15
- data/stylesheets/flint/functions/lib/_str-replace.scss +39 -39
- data/stylesheets/flint/functions/lib/_str-to-list.scss +89 -89
- data/stylesheets/flint/functions/lib/_support-syntax-bem.scss +37 -37
- data/stylesheets/flint/functions/lib/_support-syntax.scss +31 -31
- data/stylesheets/flint/functions/lib/_types-in-list.scss +76 -76
- data/stylesheets/flint/functions/lib/_use-syntax.scss +22 -22
- data/stylesheets/flint/globals/_globals.scss +122 -122
- data/stylesheets/flint/mixins/_mixins.scss +11 -11
- data/stylesheets/flint/mixins/lib/_box-sizing.scss +18 -18
- data/stylesheets/flint/mixins/lib/_calculate.scss +241 -241
- data/stylesheets/flint/mixins/lib/_clearfix.scss +29 -29
- data/stylesheets/flint/mixins/lib/_container.scss +45 -45
- data/stylesheets/flint/mixins/lib/_grid-overlay.scss +73 -73
- data/stylesheets/flint/mixins/lib/_main.scss +1057 -1057
- data/stylesheets/flint/mixins/lib/_new-instance.scss +28 -28
- data/stylesheets/flint/mixins/lib/_print-instance.scss +44 -44
- data/tests/config.rb +22 -34
- data/tests/input/functions/_functions.scss +47 -47
- data/tests/input/functions/helpers/_helpers.scss +437 -437
- data/tests/input/functions/lib/_calc-breakpoint.scss +62 -62
- data/tests/input/functions/lib/_calc-width.scss +195 -195
- data/tests/input/functions/lib/_fluid-width.scss +32 -32
- data/tests/input/functions/lib/_get-index.scss +31 -31
- data/tests/input/functions/lib/_get-instance-value.scss +72 -72
- data/tests/input/functions/lib/_get-value.scss +28 -28
- data/tests/input/functions/lib/_has-family-instance.scss +35 -35
- data/tests/input/functions/lib/_instance.scss +187 -187
- data/tests/input/functions/lib/_last.scss +18 -18
- data/tests/input/functions/lib/_list-to-str.scss +28 -28
- data/tests/input/functions/lib/_map-fetch.scss +34 -34
- data/tests/input/functions/lib/_next-index.scss +24 -24
- data/tests/input/functions/lib/_purge.scss +14 -14
- data/tests/input/functions/lib/_remove.scss +14 -14
- data/tests/input/functions/lib/_replace.scss +14 -14
- data/tests/input/functions/lib/_steal-key.scss +19 -19
- data/tests/input/functions/lib/_steal-values.scss +16 -16
- data/tests/input/functions/lib/_str-replace.scss +14 -14
- data/tests/input/functions/lib/_str-to-list.scss +28 -28
- data/tests/input/functions/lib/_support-syntax-bem.scss +14 -14
- data/tests/input/functions/lib/_support-syntax.scss +21 -21
- data/tests/input/functions/lib/_types-in-list.scss +50 -50
- data/tests/input/functions/lib/_use-syntax.scss +14 -14
- data/tests/input/output.scss +250 -250
- data/tests/output/output.css +3499 -3499
- data/tests/tests.html +110 -110
- metadata +12 -212
- data/tests/bootcamp/CHANGELOG.md +0 -70
- data/tests/bootcamp/CONTRIBUTING.md +0 -72
- data/tests/bootcamp/Gruntfile.coffee +0 -34
- data/tests/bootcamp/LICENSE.md +0 -7
- data/tests/bootcamp/README.md +0 -52
- data/tests/bootcamp/bower.json +0 -15
- data/tests/bootcamp/dist/_bootcamp.scss +0 -46
- data/tests/bootcamp/dist/bootcamp.coffee +0 -101
- data/tests/bootcamp/dist/core/functions/_actual.scss +0 -3
- data/tests/bootcamp/dist/core/functions/_error.scss +0 -29
- data/tests/bootcamp/dist/core/functions/_expect.scss +0 -6
- data/tests/bootcamp/dist/core/functions/_not-to.scss +0 -5
- data/tests/bootcamp/dist/core/functions/_should.scss +0 -6
- data/tests/bootcamp/dist/core/functions/_to.scss +0 -5
- data/tests/bootcamp/dist/core/mixins/_describe.scss +0 -31
- data/tests/bootcamp/dist/core/mixins/_it.scss +0 -31
- data/tests/bootcamp/dist/core/mixins/_runner.scss +0 -28
- data/tests/bootcamp/dist/core/mixins/_should.scss +0 -46
- data/tests/bootcamp/dist/core/mixins/_xdescribe.scss +0 -9
- data/tests/bootcamp/dist/core/mixins/_xit.scss +0 -9
- data/tests/bootcamp/dist/core/variables/_helpers.scss +0 -5
- data/tests/bootcamp/dist/core/variables/_settings.scss +0 -2
- data/tests/bootcamp/dist/core/variables/_should.scss +0 -6
- data/tests/bootcamp/dist/core/variables/_trackers.scss +0 -6
- data/tests/bootcamp/dist/lib/_sassyjson.scss +0 -1075
- data/tests/bootcamp/dist/matchers/_be.scss +0 -3
- data/tests/bootcamp/dist/matchers/_equal.scss +0 -3
- data/tests/bootcamp/dist/matchers/lists/_be-empty.scss +0 -3
- data/tests/bootcamp/dist/matchers/lists/_be-longer-than.scss +0 -3
- data/tests/bootcamp/dist/matchers/lists/_be-shorter-than.scss +0 -3
- data/tests/bootcamp/dist/matchers/lists/_contain.scss +0 -3
- data/tests/bootcamp/dist/matchers/lists/_deep-contain.scss +0 -3
- data/tests/bootcamp/dist/matchers/lists/_deep-equal.scss +0 -47
- data/tests/bootcamp/dist/matchers/lists/_have-length-of.scss +0 -3
- data/tests/bootcamp/dist/matchers/numbers/_be-close-to.scss +0 -12
- data/tests/bootcamp/dist/matchers/numbers/_be-greater-than.scss +0 -12
- data/tests/bootcamp/dist/matchers/numbers/_be-less-than.scss +0 -12
- data/tests/bootcamp/dist/matchers/types/_be-falsy.scss +0 -3
- data/tests/bootcamp/dist/matchers/types/_be-null.scss +0 -3
- data/tests/bootcamp/dist/matchers/types/_be-truthy.scss +0 -3
- data/tests/bootcamp/dist/matchers/types/_have-type-of.scss +0 -3
- data/tests/bootcamp/dist/utils/_contain.scss +0 -15
- data/tests/bootcamp/dist/utils/_equal.scss +0 -23
- data/tests/bootcamp/dist/utils/_list-join.scss +0 -35
- data/tests/bootcamp/dist/utils/_power.scss +0 -15
- data/tests/bootcamp/package.json +0 -63
- data/tests/bootcamp/tasks/bootcamp.coffee +0 -83
- data/tests/bootcamp/test/core/functions/_actual.scss +0 -10
- data/tests/bootcamp/test/core/functions/_expect.scss +0 -6
- data/tests/bootcamp/test/core/functions/_not-to.scss +0 -5
- data/tests/bootcamp/test/core/functions/_should.scss +0 -10
- data/tests/bootcamp/test/core/functions/_to.scss +0 -5
- data/tests/bootcamp/test/core/mixins/_describe.scss +0 -11
- data/tests/bootcamp/test/core/mixins/_it.scss +0 -5
- data/tests/bootcamp/test/core/mixins/_should.scss +0 -5
- data/tests/bootcamp/test/core/mixins/_xdescribe.scss +0 -28
- data/tests/bootcamp/test/core/mixins/_xit.scss +0 -12
- data/tests/bootcamp/test/matchers/_be.scss +0 -90
- data/tests/bootcamp/test/matchers/_equal.scss +0 -33
- data/tests/bootcamp/test/matchers/lists/_be-empty.scss +0 -12
- data/tests/bootcamp/test/matchers/lists/_be-longer-than.scss +0 -29
- data/tests/bootcamp/test/matchers/lists/_be-shorter-than.scss +0 -29
- data/tests/bootcamp/test/matchers/lists/_contain.scss +0 -39
- data/tests/bootcamp/test/matchers/lists/_deep-contain.scss +0 -51
- data/tests/bootcamp/test/matchers/lists/_deep-equal.scss +0 -151
- data/tests/bootcamp/test/matchers/lists/_have-length-of.scss +0 -31
- data/tests/bootcamp/test/matchers/numbers/_be-close-to.scss +0 -24
- data/tests/bootcamp/test/matchers/numbers/_be-greater-than.scss +0 -16
- data/tests/bootcamp/test/matchers/numbers/_be-less-than.scss +0 -16
- data/tests/bootcamp/test/matchers/types/_be-falsy.scss +0 -14
- data/tests/bootcamp/test/matchers/types/_be-null.scss +0 -13
- data/tests/bootcamp/test/matchers/types/_be-truthy.scss +0 -13
- data/tests/bootcamp/test/matchers/types/_have-type-of.scss +0 -17
- data/tests/bootcamp/test/specs.scss +0 -45
- data/tests/bootcamp/test/utils/_contain.scss +0 -41
- data/tests/bootcamp/test/utils/_equal.scss +0 -79
- data/tests/bootcamp/test/utils/_list-join.scss +0 -39
- data/tests/bootcamp/test/utils/_power.scss +0 -13
- data/tests/sass-prof.log +0 -0
@@ -1,62 +1,62 @@
|
|
1
|
-
//
|
2
|
-
// Calculate breakpoint query
|
3
|
-
//
|
4
|
-
@include describe("[function] calc-breakpoint") {
|
5
|
-
|
6
|
-
@include it("should expect breakpoint of passed key") {
|
7
|
-
@include should(expect(
|
8
|
-
flint-calc-breakpoint("alias", "desktop", 1)),
|
9
|
-
to(be(80em))
|
10
|
-
);
|
11
|
-
@include should(expect(
|
12
|
-
flint-calc-breakpoint("alias", "laptop", 2)),
|
13
|
-
to(be(60em))
|
14
|
-
);
|
15
|
-
@include should(expect(
|
16
|
-
flint-calc-breakpoint("alias", "tablet", 3)),
|
17
|
-
to(be(40em))
|
18
|
-
);
|
19
|
-
@include should(expect(
|
20
|
-
flint-calc-breakpoint("alias", "mobile", 4)),
|
21
|
-
to(be(20em))
|
22
|
-
);
|
23
|
-
}
|
24
|
-
|
25
|
-
@include it("should expect next breakpoint down from passed key") {
|
26
|
-
@include should(expect(
|
27
|
-
flint-calc-breakpoint("next", "desktop", 1)),
|
28
|
-
to(be(60em))
|
29
|
-
);
|
30
|
-
@include should(expect(
|
31
|
-
flint-calc-breakpoint("next", "laptop", 2)),
|
32
|
-
to(be(40em))
|
33
|
-
);
|
34
|
-
@include should(expect(
|
35
|
-
flint-calc-breakpoint("next", "tablet", 3)),
|
36
|
-
to(be(20em))
|
37
|
-
);
|
38
|
-
@include should(expect(
|
39
|
-
flint-calc-breakpoint("next", "mobile", 4)),
|
40
|
-
to(be(0))
|
41
|
-
);
|
42
|
-
}
|
43
|
-
|
44
|
-
@include it("should expect previous breakpoint up from passed key") {
|
45
|
-
@include should(expect(
|
46
|
-
flint-calc-breakpoint("prev", "desktop", 1)),
|
47
|
-
to(be(80em))
|
48
|
-
);
|
49
|
-
@include should(expect(
|
50
|
-
flint-calc-breakpoint("prev", "laptop", 2)),
|
51
|
-
to(be(80em))
|
52
|
-
);
|
53
|
-
@include should(expect(
|
54
|
-
flint-calc-breakpoint("prev", "tablet", 3)),
|
55
|
-
to(be(60em))
|
56
|
-
);
|
57
|
-
@include should(expect(
|
58
|
-
flint-calc-breakpoint("prev", "mobile", 4)),
|
59
|
-
to(be(40em))
|
60
|
-
);
|
61
|
-
}
|
62
|
-
}
|
1
|
+
//
|
2
|
+
// Calculate breakpoint query
|
3
|
+
//
|
4
|
+
@include describe("[function] calc-breakpoint") {
|
5
|
+
|
6
|
+
@include it("should expect breakpoint of passed key") {
|
7
|
+
@include should(expect(
|
8
|
+
flint-calc-breakpoint("alias", "desktop", 1)),
|
9
|
+
to(be(80em))
|
10
|
+
);
|
11
|
+
@include should(expect(
|
12
|
+
flint-calc-breakpoint("alias", "laptop", 2)),
|
13
|
+
to(be(60em))
|
14
|
+
);
|
15
|
+
@include should(expect(
|
16
|
+
flint-calc-breakpoint("alias", "tablet", 3)),
|
17
|
+
to(be(40em))
|
18
|
+
);
|
19
|
+
@include should(expect(
|
20
|
+
flint-calc-breakpoint("alias", "mobile", 4)),
|
21
|
+
to(be(20em))
|
22
|
+
);
|
23
|
+
}
|
24
|
+
|
25
|
+
@include it("should expect next breakpoint down from passed key") {
|
26
|
+
@include should(expect(
|
27
|
+
flint-calc-breakpoint("next", "desktop", 1)),
|
28
|
+
to(be(60em))
|
29
|
+
);
|
30
|
+
@include should(expect(
|
31
|
+
flint-calc-breakpoint("next", "laptop", 2)),
|
32
|
+
to(be(40em))
|
33
|
+
);
|
34
|
+
@include should(expect(
|
35
|
+
flint-calc-breakpoint("next", "tablet", 3)),
|
36
|
+
to(be(20em))
|
37
|
+
);
|
38
|
+
@include should(expect(
|
39
|
+
flint-calc-breakpoint("next", "mobile", 4)),
|
40
|
+
to(be(0))
|
41
|
+
);
|
42
|
+
}
|
43
|
+
|
44
|
+
@include it("should expect previous breakpoint up from passed key") {
|
45
|
+
@include should(expect(
|
46
|
+
flint-calc-breakpoint("prev", "desktop", 1)),
|
47
|
+
to(be(80em))
|
48
|
+
);
|
49
|
+
@include should(expect(
|
50
|
+
flint-calc-breakpoint("prev", "laptop", 2)),
|
51
|
+
to(be(80em))
|
52
|
+
);
|
53
|
+
@include should(expect(
|
54
|
+
flint-calc-breakpoint("prev", "tablet", 3)),
|
55
|
+
to(be(60em))
|
56
|
+
);
|
57
|
+
@include should(expect(
|
58
|
+
flint-calc-breakpoint("prev", "mobile", 4)),
|
59
|
+
to(be(40em))
|
60
|
+
);
|
61
|
+
}
|
62
|
+
}
|
@@ -1,195 +1,195 @@
|
|
1
|
-
//
|
2
|
-
// Calculate width
|
3
|
-
//
|
4
|
-
@include describe("[function] calc-width") {
|
5
|
-
|
6
|
-
@include it("should expect full width columns to be equal to manually calculated value") {
|
7
|
-
@include should(expect(
|
8
|
-
flint-calc-width("desktop", 16)),
|
9
|
-
to(be(("target": 80em, "context": 80em)))
|
10
|
-
);
|
11
|
-
@include should(expect(
|
12
|
-
flint-calc-width("laptop", 12)),
|
13
|
-
to(be(("target": 60em, "context": 60em)))
|
14
|
-
);
|
15
|
-
@include should(expect(
|
16
|
-
flint-calc-width("tablet", 8)),
|
17
|
-
to(be(("target": 40em, "context": 40em)))
|
18
|
-
);
|
19
|
-
@include should(expect(
|
20
|
-
flint-calc-width("mobile", 4)),
|
21
|
-
to(be(("target": 20em, "context": 20em)))
|
22
|
-
);
|
23
|
-
}
|
24
|
-
|
25
|
-
@include it("should expect three-quarter width columns to be equal to manually calculated value") {
|
26
|
-
@include should(expect(
|
27
|
-
flint-calc-width("desktop", 12)),
|
28
|
-
to(be(("target": (80em / 4 * 3), "context": 80em)))
|
29
|
-
);
|
30
|
-
@include should(expect(
|
31
|
-
flint-calc-width("laptop", 9)),
|
32
|
-
to(be(("target": (60em / 4 * 3), "context": 60em)))
|
33
|
-
);
|
34
|
-
@include should(expect(
|
35
|
-
flint-calc-width("tablet", 6)),
|
36
|
-
to(be(("target": (40em / 4 * 3), "context": 40em)))
|
37
|
-
);
|
38
|
-
@include should(expect(
|
39
|
-
flint-calc-width("mobile", 3)),
|
40
|
-
to(be(("target": (20em / 4 * 3), "context": 20em)))
|
41
|
-
);
|
42
|
-
}
|
43
|
-
|
44
|
-
@include it("should expect half width columns to be equal to manually calculated value") {
|
45
|
-
@include should(expect(
|
46
|
-
flint-calc-width("desktop", 8)),
|
47
|
-
to(be(("target": (80em / 2), "context": 80em)))
|
48
|
-
);
|
49
|
-
@include should(expect(
|
50
|
-
flint-calc-width("laptop", 6)),
|
51
|
-
to(be(("target": (60em / 2), "context": 60em)))
|
52
|
-
);
|
53
|
-
@include should(expect(
|
54
|
-
flint-calc-width("tablet", 4)),
|
55
|
-
to(be(("target": (40em / 2), "context": 40em)))
|
56
|
-
);
|
57
|
-
@include should(expect(
|
58
|
-
flint-calc-width("mobile", 2)),
|
59
|
-
to(be(("target": (20em / 2), "context": 20em)))
|
60
|
-
);
|
61
|
-
}
|
62
|
-
|
63
|
-
@include it("should expect quarter width columns to be equal to manually calculated value") {
|
64
|
-
@include should(expect(
|
65
|
-
flint-calc-width("desktop", 4, null, 1em)),
|
66
|
-
to(be(("target": (80em / 4) - 1em, "context": 80em)))
|
67
|
-
);
|
68
|
-
@include should(expect(
|
69
|
-
flint-calc-width("laptop", 3, null, 1em)),
|
70
|
-
to(be(("target": (60em / 4) - 1em, "context": 60em)))
|
71
|
-
);
|
72
|
-
@include should(expect(
|
73
|
-
flint-calc-width("tablet", 2, null, 1em)),
|
74
|
-
to(be(("target": (40em / 4) - 1em, "context": 40em)))
|
75
|
-
);
|
76
|
-
@include should(expect(
|
77
|
-
flint-calc-width("mobile", 1, null, 1em)),
|
78
|
-
to(be(("target": (20em / 4) - 1em, "context": 20em)))
|
79
|
-
);
|
80
|
-
}
|
81
|
-
|
82
|
-
@include it("should expect single width columns to be equal to manually calculated value") {
|
83
|
-
@include should(expect(
|
84
|
-
flint-calc-width("desktop", 1)),
|
85
|
-
to(be(("target": (80em / 16), "context": 80em)))
|
86
|
-
);
|
87
|
-
@include should(expect(
|
88
|
-
flint-calc-width("laptop", 1)),
|
89
|
-
to(be(("target": (60em / 12), "context": 60em)))
|
90
|
-
);
|
91
|
-
@include should(expect(
|
92
|
-
flint-calc-width("tablet", 1)),
|
93
|
-
to(be(("target": (40em / 8), "context": 40em)))
|
94
|
-
);
|
95
|
-
@include should(expect(
|
96
|
-
flint-calc-width("mobile", 1)),
|
97
|
-
to(be(("target": (20em / 4), "context": 20em)))
|
98
|
-
);
|
99
|
-
}
|
100
|
-
|
101
|
-
@include it("should expect full width columns with context to be equal to manually calculated value") {
|
102
|
-
@include should(expect(
|
103
|
-
flint-calc-width("desktop", 8, 8)),
|
104
|
-
to(be(("target": 40em, "context": 40em)))
|
105
|
-
);
|
106
|
-
@include should(expect(
|
107
|
-
flint-calc-width("laptop", 6, 6)),
|
108
|
-
to(be(("target": 30em, "context": 30em)))
|
109
|
-
);
|
110
|
-
@include should(expect(
|
111
|
-
flint-calc-width("tablet", 4, 4)),
|
112
|
-
to(be(("target": 20em, "context": 20em)))
|
113
|
-
);
|
114
|
-
@include should(expect(
|
115
|
-
flint-calc-width("mobile", 2, 2)),
|
116
|
-
to(be(("target": 10em, "context": 10em)))
|
117
|
-
);
|
118
|
-
}
|
119
|
-
|
120
|
-
@include it("should expect three-quarter width columns with context to be equal to manually calculated value") {
|
121
|
-
@include should(expect(
|
122
|
-
flint-calc-width("desktop", 6, 8)),
|
123
|
-
to(be(("target": (40em / 4 * 3), "context": 40em)))
|
124
|
-
);
|
125
|
-
@include should(expect(
|
126
|
-
flint-calc-width("laptop", 4.5, 6)),
|
127
|
-
to(be(("target": (30em / 4 * 3), "context": 30em)))
|
128
|
-
);
|
129
|
-
@include should(expect(
|
130
|
-
flint-calc-width("tablet", 6, 8)),
|
131
|
-
to(be(("target": (40em / 4 * 3), "context": 40em)))
|
132
|
-
);
|
133
|
-
@include should(expect(
|
134
|
-
flint-calc-width("mobile", 3, 4)),
|
135
|
-
to(be(("target": (20em / 4 * 3), "context": 20em)))
|
136
|
-
);
|
137
|
-
}
|
138
|
-
|
139
|
-
@include it("should expect half width columns with context to be equal to manually calculated value") {
|
140
|
-
@include should(expect(
|
141
|
-
flint-calc-width("desktop", 4, 8)),
|
142
|
-
to(be(("target": (40em / 2), "context": 40em)))
|
143
|
-
);
|
144
|
-
@include should(expect(
|
145
|
-
flint-calc-width("laptop", 3, 6)),
|
146
|
-
to(be(("target": (30em / 2), "context": 30em)))
|
147
|
-
);
|
148
|
-
@include should(expect(
|
149
|
-
flint-calc-width("tablet", 2, 4)),
|
150
|
-
to(be(("target": (20em / 2), "context": 20em)))
|
151
|
-
);
|
152
|
-
@include should(expect(
|
153
|
-
flint-calc-width("mobile", 1, 2)),
|
154
|
-
to(be(("target": (10em / 2), "context": 10em)))
|
155
|
-
);
|
156
|
-
}
|
157
|
-
|
158
|
-
@include it("should expect quarter width columns with context to be equal to manually calculated value") {
|
159
|
-
@include should(expect(
|
160
|
-
flint-calc-width("desktop", 1, 4)),
|
161
|
-
to(be(("target": (20em / 4), "context": 20em)))
|
162
|
-
);
|
163
|
-
@include should(expect(
|
164
|
-
flint-calc-width("laptop", 1, 4)),
|
165
|
-
to(be(("target": (20em / 4), "context": 20em)))
|
166
|
-
);
|
167
|
-
@include should(expect(
|
168
|
-
flint-calc-width("tablet", 1, 4)),
|
169
|
-
to(be(("target": (20em / 4), "context": 20em)))
|
170
|
-
);
|
171
|
-
@include should(expect(
|
172
|
-
flint-calc-width("mobile", 0.5, 2)),
|
173
|
-
to(be(("target": (10em / 4), "context": 10em)))
|
174
|
-
);
|
175
|
-
}
|
176
|
-
|
177
|
-
@include it("should expect single width columns with context to be equal to manually calculated value") {
|
178
|
-
@include should(expect(
|
179
|
-
flint-calc-width("desktop", 1, 16)),
|
180
|
-
to(be(("target": (80em / 16), "context": 80em)))
|
181
|
-
);
|
182
|
-
@include should(expect(
|
183
|
-
flint-calc-width("laptop", 1, 12)),
|
184
|
-
to(be(("target": (60em / 12), "context": 60em)))
|
185
|
-
);
|
186
|
-
@include should(expect(
|
187
|
-
flint-calc-width("tablet", 1, 8)),
|
188
|
-
to(be(("target": (40em / 8), "context": 40em)))
|
189
|
-
);
|
190
|
-
@include should(expect(
|
191
|
-
flint-calc-width("mobile", 1, 4)),
|
192
|
-
to(be(("target": (20em / 4), "context": 20em)))
|
193
|
-
);
|
194
|
-
}
|
195
|
-
}
|
1
|
+
//
|
2
|
+
// Calculate width
|
3
|
+
//
|
4
|
+
@include describe("[function] calc-width") {
|
5
|
+
|
6
|
+
@include it("should expect full width columns to be equal to manually calculated value") {
|
7
|
+
@include should(expect(
|
8
|
+
flint-calc-width("desktop", 16)),
|
9
|
+
to(be(("target": 80em, "context": 80em)))
|
10
|
+
);
|
11
|
+
@include should(expect(
|
12
|
+
flint-calc-width("laptop", 12)),
|
13
|
+
to(be(("target": 60em, "context": 60em)))
|
14
|
+
);
|
15
|
+
@include should(expect(
|
16
|
+
flint-calc-width("tablet", 8)),
|
17
|
+
to(be(("target": 40em, "context": 40em)))
|
18
|
+
);
|
19
|
+
@include should(expect(
|
20
|
+
flint-calc-width("mobile", 4)),
|
21
|
+
to(be(("target": 20em, "context": 20em)))
|
22
|
+
);
|
23
|
+
}
|
24
|
+
|
25
|
+
@include it("should expect three-quarter width columns to be equal to manually calculated value") {
|
26
|
+
@include should(expect(
|
27
|
+
flint-calc-width("desktop", 12)),
|
28
|
+
to(be(("target": (80em / 4 * 3), "context": 80em)))
|
29
|
+
);
|
30
|
+
@include should(expect(
|
31
|
+
flint-calc-width("laptop", 9)),
|
32
|
+
to(be(("target": (60em / 4 * 3), "context": 60em)))
|
33
|
+
);
|
34
|
+
@include should(expect(
|
35
|
+
flint-calc-width("tablet", 6)),
|
36
|
+
to(be(("target": (40em / 4 * 3), "context": 40em)))
|
37
|
+
);
|
38
|
+
@include should(expect(
|
39
|
+
flint-calc-width("mobile", 3)),
|
40
|
+
to(be(("target": (20em / 4 * 3), "context": 20em)))
|
41
|
+
);
|
42
|
+
}
|
43
|
+
|
44
|
+
@include it("should expect half width columns to be equal to manually calculated value") {
|
45
|
+
@include should(expect(
|
46
|
+
flint-calc-width("desktop", 8)),
|
47
|
+
to(be(("target": (80em / 2), "context": 80em)))
|
48
|
+
);
|
49
|
+
@include should(expect(
|
50
|
+
flint-calc-width("laptop", 6)),
|
51
|
+
to(be(("target": (60em / 2), "context": 60em)))
|
52
|
+
);
|
53
|
+
@include should(expect(
|
54
|
+
flint-calc-width("tablet", 4)),
|
55
|
+
to(be(("target": (40em / 2), "context": 40em)))
|
56
|
+
);
|
57
|
+
@include should(expect(
|
58
|
+
flint-calc-width("mobile", 2)),
|
59
|
+
to(be(("target": (20em / 2), "context": 20em)))
|
60
|
+
);
|
61
|
+
}
|
62
|
+
|
63
|
+
@include it("should expect quarter width columns to be equal to manually calculated value") {
|
64
|
+
@include should(expect(
|
65
|
+
flint-calc-width("desktop", 4, null, 1em)),
|
66
|
+
to(be(("target": (80em / 4) - 1em, "context": 80em)))
|
67
|
+
);
|
68
|
+
@include should(expect(
|
69
|
+
flint-calc-width("laptop", 3, null, 1em)),
|
70
|
+
to(be(("target": (60em / 4) - 1em, "context": 60em)))
|
71
|
+
);
|
72
|
+
@include should(expect(
|
73
|
+
flint-calc-width("tablet", 2, null, 1em)),
|
74
|
+
to(be(("target": (40em / 4) - 1em, "context": 40em)))
|
75
|
+
);
|
76
|
+
@include should(expect(
|
77
|
+
flint-calc-width("mobile", 1, null, 1em)),
|
78
|
+
to(be(("target": (20em / 4) - 1em, "context": 20em)))
|
79
|
+
);
|
80
|
+
}
|
81
|
+
|
82
|
+
@include it("should expect single width columns to be equal to manually calculated value") {
|
83
|
+
@include should(expect(
|
84
|
+
flint-calc-width("desktop", 1)),
|
85
|
+
to(be(("target": (80em / 16), "context": 80em)))
|
86
|
+
);
|
87
|
+
@include should(expect(
|
88
|
+
flint-calc-width("laptop", 1)),
|
89
|
+
to(be(("target": (60em / 12), "context": 60em)))
|
90
|
+
);
|
91
|
+
@include should(expect(
|
92
|
+
flint-calc-width("tablet", 1)),
|
93
|
+
to(be(("target": (40em / 8), "context": 40em)))
|
94
|
+
);
|
95
|
+
@include should(expect(
|
96
|
+
flint-calc-width("mobile", 1)),
|
97
|
+
to(be(("target": (20em / 4), "context": 20em)))
|
98
|
+
);
|
99
|
+
}
|
100
|
+
|
101
|
+
@include it("should expect full width columns with context to be equal to manually calculated value") {
|
102
|
+
@include should(expect(
|
103
|
+
flint-calc-width("desktop", 8, 8)),
|
104
|
+
to(be(("target": 40em, "context": 40em)))
|
105
|
+
);
|
106
|
+
@include should(expect(
|
107
|
+
flint-calc-width("laptop", 6, 6)),
|
108
|
+
to(be(("target": 30em, "context": 30em)))
|
109
|
+
);
|
110
|
+
@include should(expect(
|
111
|
+
flint-calc-width("tablet", 4, 4)),
|
112
|
+
to(be(("target": 20em, "context": 20em)))
|
113
|
+
);
|
114
|
+
@include should(expect(
|
115
|
+
flint-calc-width("mobile", 2, 2)),
|
116
|
+
to(be(("target": 10em, "context": 10em)))
|
117
|
+
);
|
118
|
+
}
|
119
|
+
|
120
|
+
@include it("should expect three-quarter width columns with context to be equal to manually calculated value") {
|
121
|
+
@include should(expect(
|
122
|
+
flint-calc-width("desktop", 6, 8)),
|
123
|
+
to(be(("target": (40em / 4 * 3), "context": 40em)))
|
124
|
+
);
|
125
|
+
@include should(expect(
|
126
|
+
flint-calc-width("laptop", 4.5, 6)),
|
127
|
+
to(be(("target": (30em / 4 * 3), "context": 30em)))
|
128
|
+
);
|
129
|
+
@include should(expect(
|
130
|
+
flint-calc-width("tablet", 6, 8)),
|
131
|
+
to(be(("target": (40em / 4 * 3), "context": 40em)))
|
132
|
+
);
|
133
|
+
@include should(expect(
|
134
|
+
flint-calc-width("mobile", 3, 4)),
|
135
|
+
to(be(("target": (20em / 4 * 3), "context": 20em)))
|
136
|
+
);
|
137
|
+
}
|
138
|
+
|
139
|
+
@include it("should expect half width columns with context to be equal to manually calculated value") {
|
140
|
+
@include should(expect(
|
141
|
+
flint-calc-width("desktop", 4, 8)),
|
142
|
+
to(be(("target": (40em / 2), "context": 40em)))
|
143
|
+
);
|
144
|
+
@include should(expect(
|
145
|
+
flint-calc-width("laptop", 3, 6)),
|
146
|
+
to(be(("target": (30em / 2), "context": 30em)))
|
147
|
+
);
|
148
|
+
@include should(expect(
|
149
|
+
flint-calc-width("tablet", 2, 4)),
|
150
|
+
to(be(("target": (20em / 2), "context": 20em)))
|
151
|
+
);
|
152
|
+
@include should(expect(
|
153
|
+
flint-calc-width("mobile", 1, 2)),
|
154
|
+
to(be(("target": (10em / 2), "context": 10em)))
|
155
|
+
);
|
156
|
+
}
|
157
|
+
|
158
|
+
@include it("should expect quarter width columns with context to be equal to manually calculated value") {
|
159
|
+
@include should(expect(
|
160
|
+
flint-calc-width("desktop", 1, 4)),
|
161
|
+
to(be(("target": (20em / 4), "context": 20em)))
|
162
|
+
);
|
163
|
+
@include should(expect(
|
164
|
+
flint-calc-width("laptop", 1, 4)),
|
165
|
+
to(be(("target": (20em / 4), "context": 20em)))
|
166
|
+
);
|
167
|
+
@include should(expect(
|
168
|
+
flint-calc-width("tablet", 1, 4)),
|
169
|
+
to(be(("target": (20em / 4), "context": 20em)))
|
170
|
+
);
|
171
|
+
@include should(expect(
|
172
|
+
flint-calc-width("mobile", 0.5, 2)),
|
173
|
+
to(be(("target": (10em / 4), "context": 10em)))
|
174
|
+
);
|
175
|
+
}
|
176
|
+
|
177
|
+
@include it("should expect single width columns with context to be equal to manually calculated value") {
|
178
|
+
@include should(expect(
|
179
|
+
flint-calc-width("desktop", 1, 16)),
|
180
|
+
to(be(("target": (80em / 16), "context": 80em)))
|
181
|
+
);
|
182
|
+
@include should(expect(
|
183
|
+
flint-calc-width("laptop", 1, 12)),
|
184
|
+
to(be(("target": (60em / 12), "context": 60em)))
|
185
|
+
);
|
186
|
+
@include should(expect(
|
187
|
+
flint-calc-width("tablet", 1, 8)),
|
188
|
+
to(be(("target": (40em / 8), "context": 40em)))
|
189
|
+
);
|
190
|
+
@include should(expect(
|
191
|
+
flint-calc-width("mobile", 1, 4)),
|
192
|
+
to(be(("target": (20em / 4), "context": 20em)))
|
193
|
+
);
|
194
|
+
}
|
195
|
+
}
|