bourbon 4.2.0 → 4.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.npmignore +0 -1
- data/app/assets/stylesheets/_bourbon.scss +1 -1
- data/app/assets/stylesheets/addons/_retina-image.scss +4 -10
- data/app/assets/stylesheets/addons/_size.scss +2 -6
- data/app/assets/stylesheets/addons/_triangle.scss +9 -29
- data/app/assets/stylesheets/functions/_is-length.scss +1 -1
- data/app/assets/stylesheets/helpers/_font-source-declaration.scss +1 -2
- data/bower.json +1 -1
- data/lib/bourbon/version.rb +1 -1
- data/package.json +1 -1
- data/spec/bourbon/functions/px_to_rem_spec.rb +25 -0
- data/spec/bourbon/functions/shade_spec.rb +31 -0
- data/spec/bourbon/functions/strip_units_spec.rb +31 -0
- data/spec/bourbon/functions/tint_spec.rb +31 -0
- data/spec/bourbon/functions/unpack_spec.rb +32 -0
- data/spec/bourbon/helpers/convert_units_spec.rb +31 -0
- data/spec/fixtures/functions/px-to-rem.scss +15 -0
- data/spec/fixtures/functions/shade.scss +17 -0
- data/spec/fixtures/functions/strip-units.scss +17 -0
- data/spec/fixtures/functions/tint.scss +17 -0
- data/spec/fixtures/functions/unpack.scss +17 -0
- data/spec/fixtures/helpers/convert-units.scss +17 -0
- metadata +26 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 151abcb53a0cd21cfa4337132151d9e39b2abd61
|
4
|
+
data.tar.gz: f20c75d60c7574ae94d42f8b7af3dedf8b92ef73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 793090861adf2e65b284beea77e1757083d95be8225c02da774faa4317c4ffce2bd4989377971f2f1234268ff212d600023e1e5c6c092ce953ef854e1e587ea3
|
7
|
+
data.tar.gz: dc086af8fabb7a568fc590a10a00f8eab3f863ab6156b24fbe30090dbe9079bbce7abb203ebf979f907ac756adbef9888b2cb87c9e58af6c1d5ed0807994acb8
|
data/.npmignore
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
@mixin retina-image($filename, $background-size, $extension: png, $retina-filename: null, $retina-suffix: _2x, $asset-pipeline: $asset-pipeline) {
|
2
2
|
@if $asset-pipeline {
|
3
3
|
background-image: image-url("#{$filename}.#{$extension}");
|
4
|
-
}
|
5
|
-
@else {
|
4
|
+
} @else {
|
6
5
|
background-image: url("#{$filename}.#{$extension}");
|
7
6
|
}
|
8
7
|
|
@@ -10,22 +9,17 @@
|
|
10
9
|
@if $asset-pipeline {
|
11
10
|
@if $retina-filename {
|
12
11
|
background-image: image-url("#{$retina-filename}.#{$extension}");
|
13
|
-
}
|
14
|
-
@else {
|
12
|
+
} @else {
|
15
13
|
background-image: image-url("#{$filename}#{$retina-suffix}.#{$extension}");
|
16
14
|
}
|
17
|
-
}
|
18
|
-
|
19
|
-
@else {
|
15
|
+
} @else {
|
20
16
|
@if $retina-filename {
|
21
17
|
background-image: url("#{$retina-filename}.#{$extension}");
|
22
|
-
}
|
23
|
-
@else {
|
18
|
+
} @else {
|
24
19
|
background-image: url("#{$filename}#{$retina-suffix}.#{$extension}");
|
25
20
|
}
|
26
21
|
}
|
27
22
|
|
28
23
|
background-size: $background-size;
|
29
|
-
|
30
24
|
}
|
31
25
|
}
|
@@ -39,17 +39,13 @@
|
|
39
39
|
|
40
40
|
@if is-size($height) {
|
41
41
|
height: $height;
|
42
|
-
}
|
43
|
-
|
44
|
-
@else {
|
42
|
+
} @else {
|
45
43
|
@warn "`#{$height}` is not a valid length for the `$height` parameter in the `size` mixin.";
|
46
44
|
}
|
47
45
|
|
48
46
|
@if is-size($width) {
|
49
47
|
width: $width;
|
50
|
-
}
|
51
|
-
|
52
|
-
@else {
|
48
|
+
} @else {
|
53
49
|
@warn "`#{$width}` is not a valid length for the `$width` parameter in the `size` mixin.";
|
54
50
|
}
|
55
51
|
}
|
@@ -1,15 +1,12 @@
|
|
1
|
-
@mixin triangle
|
2
|
-
height: 0;
|
3
|
-
width: 0;
|
4
|
-
|
1
|
+
@mixin triangle($size, $color, $direction) {
|
5
2
|
$width: nth($size, 1);
|
6
3
|
$height: nth($size, length($size));
|
7
|
-
|
8
4
|
$foreground-color: nth($color, 1);
|
9
5
|
$background-color: if(length($color) == 2, nth($color, 2), transparent);
|
6
|
+
height: 0;
|
7
|
+
width: 0;
|
10
8
|
|
11
9
|
@if ($direction == up) or ($direction == down) or ($direction == right) or ($direction == left) {
|
12
|
-
|
13
10
|
$width: $width / 2;
|
14
11
|
$height: if(length($size) > 1, $height, $height/2);
|
15
12
|
|
@@ -17,65 +14,48 @@
|
|
17
14
|
border-bottom: $height solid $foreground-color;
|
18
15
|
border-left: $width solid $background-color;
|
19
16
|
border-right: $width solid $background-color;
|
20
|
-
|
21
17
|
} @else if $direction == right {
|
22
18
|
border-bottom: $width solid $background-color;
|
23
19
|
border-left: $height solid $foreground-color;
|
24
20
|
border-top: $width solid $background-color;
|
25
|
-
|
26
21
|
} @else if $direction == down {
|
27
22
|
border-left: $width solid $background-color;
|
28
23
|
border-right: $width solid $background-color;
|
29
24
|
border-top: $height solid $foreground-color;
|
30
|
-
|
31
25
|
} @else if $direction == left {
|
32
26
|
border-bottom: $width solid $background-color;
|
33
27
|
border-right: $height solid $foreground-color;
|
34
28
|
border-top: $width solid $background-color;
|
35
29
|
}
|
36
|
-
}
|
37
|
-
|
38
|
-
@else if ($direction == up-right) or ($direction == up-left) {
|
30
|
+
} @else if ($direction == up-right) or ($direction == up-left) {
|
39
31
|
border-top: $height solid $foreground-color;
|
40
32
|
|
41
33
|
@if $direction == up-right {
|
42
34
|
border-left: $width solid $background-color;
|
43
|
-
|
44
35
|
} @else if $direction == up-left {
|
45
36
|
border-right: $width solid $background-color;
|
46
37
|
}
|
47
|
-
}
|
48
|
-
|
49
|
-
@else if ($direction == down-right) or ($direction == down-left) {
|
38
|
+
} @else if ($direction == down-right) or ($direction == down-left) {
|
50
39
|
border-bottom: $height solid $foreground-color;
|
51
40
|
|
52
41
|
@if $direction == down-right {
|
53
42
|
border-left: $width solid $background-color;
|
54
|
-
|
55
43
|
} @else if $direction == down-left {
|
56
44
|
border-right: $width solid $background-color;
|
57
45
|
}
|
58
|
-
}
|
59
|
-
|
60
|
-
@else if ($direction == inset-up) {
|
46
|
+
} @else if ($direction == inset-up) {
|
61
47
|
border-color: $background-color $background-color $foreground-color;
|
62
48
|
border-style: solid;
|
63
49
|
border-width: $height $width;
|
64
|
-
}
|
65
|
-
|
66
|
-
@else if ($direction == inset-down) {
|
50
|
+
} @else if ($direction == inset-down) {
|
67
51
|
border-color: $foreground-color $background-color $background-color;
|
68
52
|
border-style: solid;
|
69
53
|
border-width: $height $width;
|
70
|
-
}
|
71
|
-
|
72
|
-
@else if ($direction == inset-right) {
|
54
|
+
} @else if ($direction == inset-right) {
|
73
55
|
border-color: $background-color $background-color $background-color $foreground-color;
|
74
56
|
border-style: solid;
|
75
57
|
border-width: $width $height;
|
76
|
-
}
|
77
|
-
|
78
|
-
@else if ($direction == inset-left) {
|
58
|
+
} @else if ($direction == inset-left) {
|
79
59
|
border-color: $background-color $foreground-color $background-color $background-color;
|
80
60
|
border-style: solid;
|
81
61
|
border-width: $width $height;
|
@@ -5,7 +5,7 @@
|
|
5
5
|
/// @param {String} $value
|
6
6
|
|
7
7
|
@function is-length($value) {
|
8
|
-
@return type-of($value) != "null" and (str-slice($value + "", 1, 4) ==
|
8
|
+
@return type-of($value) != "null" and (str-slice($value + "", 1, 4) == "calc"
|
9
9
|
or index(auto inherit initial 0, $value)
|
10
10
|
or (type-of($value) == "number" and not(unitless($value))));
|
11
11
|
}
|
data/bower.json
CHANGED
data/lib/bourbon/version.rb
CHANGED
data/package.json
CHANGED
@@ -0,0 +1,25 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "px-to-rem" do
|
4
|
+
before(:all) do
|
5
|
+
ParserSupport.parse_file("functions/px-to-rem")
|
6
|
+
end
|
7
|
+
|
8
|
+
context "called with unitless integer" do
|
9
|
+
it "outputs rems" do
|
10
|
+
expect(".unitless").to have_rule("font-size: 0.75rem")
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
context "called with px" do
|
15
|
+
it "outputs rems" do
|
16
|
+
expect(".px").to have_rule("font-size: 1rem")
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
context "called with px with modified base" do
|
21
|
+
it "outputs rems" do
|
22
|
+
expect(".px-with-modified-base").to have_rule("font-size: 1rem")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "shade" do
|
4
|
+
before(:all) do
|
5
|
+
ParserSupport.parse_file("functions/shade")
|
6
|
+
end
|
7
|
+
|
8
|
+
context "called on white" do
|
9
|
+
it "shades white" do
|
10
|
+
expect(".shade-white").to have_rule("color: #3f3f3f")
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
context "called on black" do
|
15
|
+
it "still returns black" do
|
16
|
+
expect(".shade-black").to have_rule("color: black")
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
context "called on red" do
|
21
|
+
it "shades red" do
|
22
|
+
expect(".shade-red").to have_rule("color: #bf0000")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
context "called on gray" do
|
27
|
+
it "shades gray" do
|
28
|
+
expect(".shade-gray").to have_rule("color: #161616")
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "strip-units" do
|
4
|
+
before(:all) do
|
5
|
+
ParserSupport.parse_file("functions/strip-units")
|
6
|
+
end
|
7
|
+
|
8
|
+
context "called with px" do
|
9
|
+
it "strips units" do
|
10
|
+
expect(".px").to have_rule("width: 10")
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
context "called with em" do
|
15
|
+
it "strips units" do
|
16
|
+
expect(".em").to have_rule("width: 2")
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
context "called with rem" do
|
21
|
+
it "strips units" do
|
22
|
+
expect(".rem").to have_rule("width: 1.5")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
context "called with percent" do
|
27
|
+
it "strips units" do
|
28
|
+
expect(".percent").to have_rule("width: 20")
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "tint" do
|
4
|
+
before(:all) do
|
5
|
+
ParserSupport.parse_file("functions/tint")
|
6
|
+
end
|
7
|
+
|
8
|
+
context "called on white" do
|
9
|
+
it "still returns white" do
|
10
|
+
expect(".tint-white").to have_rule("color: white")
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
context "called on black" do
|
15
|
+
it "tints black" do
|
16
|
+
expect(".tint-black").to have_rule("color: #7f7f7f")
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
context "called on red" do
|
21
|
+
it "tints red" do
|
22
|
+
expect(".tint-red").to have_rule("color: #ff3f3f")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
context "called on gray" do
|
27
|
+
it "tints gray" do
|
28
|
+
expect(".tint-gray").to have_rule("color: #c6c6c6")
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "unpack" do
|
4
|
+
before(:all) do
|
5
|
+
ParserSupport.parse_file("functions/unpack")
|
6
|
+
end
|
7
|
+
|
8
|
+
context "single" do
|
9
|
+
it "unpacks four identical measurements" do
|
10
|
+
expect(".single").to have_rule("padding: 10px 10px 10px 10px")
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
context "double" do
|
15
|
+
it "unpacks identical measurements for top and bottom,
|
16
|
+
and different identical measurements for left and right" do
|
17
|
+
expect(".double").to have_rule("padding: 1em 2em 1em 2em")
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
context "triple" do
|
22
|
+
it "unpacks identical measurements for left and right" do
|
23
|
+
expect(".triple").to have_rule("padding: 10px 20px 0 20px")
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
context "quadruple" do
|
28
|
+
it "unpacks four distict measurements" do
|
29
|
+
expect(".quadruple").to have_rule("padding: 0 calc(1em + 10px) 20px 50px")
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "convert-units" do
|
4
|
+
before(:all) do
|
5
|
+
ParserSupport.parse_file("helpers/convert-units")
|
6
|
+
end
|
7
|
+
|
8
|
+
context "called with integer and px" do
|
9
|
+
it "is converted to px length" do
|
10
|
+
expect(".px").to have_rule("height: 12px")
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
context "called with integer and pt" do
|
15
|
+
it "is converted to points" do
|
16
|
+
expect(".pt").to have_rule("font-size: 16pt")
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
context "called with integer and deg" do
|
21
|
+
it "is converted to degrees" do
|
22
|
+
expect(".deg").to have_rule("transform: rotate(180deg)")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
context "called with string and px" do
|
27
|
+
it "returns false" do
|
28
|
+
expect(".string").to have_rule("padding-top: false")
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
@import "setup";
|
2
|
+
|
3
|
+
.px {
|
4
|
+
height: convert-units(10, "px");
|
5
|
+
}
|
6
|
+
|
7
|
+
.pt {
|
8
|
+
font-size: convert-units(16, "pt");
|
9
|
+
}
|
10
|
+
|
11
|
+
.deg {
|
12
|
+
transform: rotate(convert-units(180, "deg"));
|
13
|
+
}
|
14
|
+
|
15
|
+
.string {
|
16
|
+
padding-top: convert-units("stringy", "px");
|
17
|
+
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bourbon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.2.
|
4
|
+
version: 4.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andres Mejia
|
@@ -22,7 +22,7 @@ authors:
|
|
22
22
|
autorequire:
|
23
23
|
bindir: bin
|
24
24
|
cert_chain: []
|
25
|
-
date: 2015-02-
|
25
|
+
date: 2015-02-23 00:00:00.000000000 Z
|
26
26
|
dependencies:
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: sass
|
@@ -229,6 +229,12 @@ files:
|
|
229
229
|
- spec/bourbon/functions/is_size_spec.rb
|
230
230
|
- spec/bourbon/functions/modular_scale_spec.rb
|
231
231
|
- spec/bourbon/functions/px_to_em_spec.rb
|
232
|
+
- spec/bourbon/functions/px_to_rem_spec.rb
|
233
|
+
- spec/bourbon/functions/shade_spec.rb
|
234
|
+
- spec/bourbon/functions/strip_units_spec.rb
|
235
|
+
- spec/bourbon/functions/tint_spec.rb
|
236
|
+
- spec/bourbon/functions/unpack_spec.rb
|
237
|
+
- spec/bourbon/helpers/convert_units_spec.rb
|
232
238
|
- spec/fixtures/_setup.scss
|
233
239
|
- spec/fixtures/functions/assign-inputs.scss
|
234
240
|
- spec/fixtures/functions/contains.scss
|
@@ -238,6 +244,12 @@ files:
|
|
238
244
|
- spec/fixtures/functions/is-size.scss
|
239
245
|
- spec/fixtures/functions/modular-scale.scss
|
240
246
|
- spec/fixtures/functions/px-to-em.scss
|
247
|
+
- spec/fixtures/functions/px-to-rem.scss
|
248
|
+
- spec/fixtures/functions/shade.scss
|
249
|
+
- spec/fixtures/functions/strip-units.scss
|
250
|
+
- spec/fixtures/functions/tint.scss
|
251
|
+
- spec/fixtures/functions/unpack.scss
|
252
|
+
- spec/fixtures/helpers/convert-units.scss
|
241
253
|
- spec/spec_helper.rb
|
242
254
|
- spec/support/matchers/be_contained_in.rb
|
243
255
|
- spec/support/matchers/have_rule.rb
|
@@ -283,6 +295,12 @@ test_files:
|
|
283
295
|
- spec/bourbon/functions/is_size_spec.rb
|
284
296
|
- spec/bourbon/functions/modular_scale_spec.rb
|
285
297
|
- spec/bourbon/functions/px_to_em_spec.rb
|
298
|
+
- spec/bourbon/functions/px_to_rem_spec.rb
|
299
|
+
- spec/bourbon/functions/shade_spec.rb
|
300
|
+
- spec/bourbon/functions/strip_units_spec.rb
|
301
|
+
- spec/bourbon/functions/tint_spec.rb
|
302
|
+
- spec/bourbon/functions/unpack_spec.rb
|
303
|
+
- spec/bourbon/helpers/convert_units_spec.rb
|
286
304
|
- spec/fixtures/_setup.scss
|
287
305
|
- spec/fixtures/functions/assign-inputs.scss
|
288
306
|
- spec/fixtures/functions/contains.scss
|
@@ -292,6 +310,12 @@ test_files:
|
|
292
310
|
- spec/fixtures/functions/is-size.scss
|
293
311
|
- spec/fixtures/functions/modular-scale.scss
|
294
312
|
- spec/fixtures/functions/px-to-em.scss
|
313
|
+
- spec/fixtures/functions/px-to-rem.scss
|
314
|
+
- spec/fixtures/functions/shade.scss
|
315
|
+
- spec/fixtures/functions/strip-units.scss
|
316
|
+
- spec/fixtures/functions/tint.scss
|
317
|
+
- spec/fixtures/functions/unpack.scss
|
318
|
+
- spec/fixtures/helpers/convert-units.scss
|
295
319
|
- spec/spec_helper.rb
|
296
320
|
- spec/support/matchers/be_contained_in.rb
|
297
321
|
- spec/support/matchers/have_rule.rb
|