bourbon 5.0.0.beta.6 → 5.0.0.beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/.github/ISSUE_TEMPLATE.md +11 -0
  3. data/.github/PULL_REQUEST_TEMPLATE.md +5 -0
  4. data/CHANGELOG.md +32 -1
  5. data/README.md +111 -44
  6. data/RELEASING.md +3 -2
  7. data/bourbon.gemspec +3 -5
  8. data/bower.json +2 -2
  9. data/core/_bourbon.scss +8 -6
  10. data/core/bourbon/library/_border-color.scss +8 -7
  11. data/core/bourbon/library/_border-radius.scss +12 -12
  12. data/core/bourbon/library/_border-style.scss +8 -7
  13. data/core/bourbon/library/_border-width.scss +8 -7
  14. data/core/bourbon/library/_buttons.scss +4 -4
  15. data/core/bourbon/library/_clearfix.scss +2 -2
  16. data/core/bourbon/library/_contrast-switch.scss +36 -14
  17. data/core/bourbon/library/_ellipsis.scss +1 -1
  18. data/core/bourbon/library/_font-face.scss +5 -4
  19. data/core/bourbon/library/_font-stacks.scss +170 -8
  20. data/core/bourbon/library/_hide-text.scss +2 -2
  21. data/core/bourbon/library/_hide-visually.scss +4 -2
  22. data/core/bourbon/library/_margin.scss +17 -14
  23. data/core/bourbon/library/_modular-scale.scss +28 -20
  24. data/core/bourbon/library/_overflow-wrap.scss +24 -0
  25. data/core/bourbon/library/_padding.scss +12 -10
  26. data/core/bourbon/library/_position.scss +30 -20
  27. data/core/bourbon/library/_prefixer.scss +1 -1
  28. data/core/bourbon/library/_shade.scss +1 -1
  29. data/core/bourbon/library/_size.scss +7 -5
  30. data/core/bourbon/library/_strip-unit.scss +1 -1
  31. data/core/bourbon/library/_text-inputs.scss +5 -5
  32. data/core/bourbon/library/_timing-functions.scss +1 -1
  33. data/core/bourbon/library/_tint.scss +1 -1
  34. data/core/bourbon/library/_triangle.scss +1 -1
  35. data/core/bourbon/library/_value-prefixer.scss +1 -1
  36. data/core/bourbon/settings/_settings.scss +28 -4
  37. data/core/bourbon/utilities/{_collapse-directionals.scss → _compact-shorthand.scss} +6 -18
  38. data/core/bourbon/utilities/_contrast-ratio.scss +31 -0
  39. data/core/bourbon/utilities/_directional-property.scss +71 -0
  40. data/core/bourbon/utilities/_font-source-declaration.scss +1 -1
  41. data/core/bourbon/utilities/_gamma.scss +21 -0
  42. data/core/bourbon/utilities/_lightness.scss +24 -0
  43. data/core/bourbon/utilities/{_unpack.scss → _unpack-shorthand.scss} +4 -4
  44. data/core/bourbon/validators/_contains-falsy.scss +1 -1
  45. data/lib/bourbon/version.rb +1 -1
  46. data/package.json +2 -2
  47. data/spec/bourbon/library/font_stacks_spec.rb +6 -4
  48. data/spec/bourbon/library/hide_visually_spec.rb +2 -0
  49. data/spec/bourbon/library/overflow_wrap_spec.rb +27 -0
  50. data/spec/bourbon/utilities/compact_shorthand_spec.rb +30 -0
  51. data/spec/bourbon/utilities/{directional_values_spec.rb → directional_property_spec.rb} +9 -2
  52. data/spec/fixtures/library/overflow-wrap.scss +9 -0
  53. data/spec/fixtures/library/position.scss +0 -4
  54. data/spec/fixtures/utilities/compact-shorthand.scss +21 -0
  55. data/spec/fixtures/utilities/{directional-values.scss → directional-property.scss} +4 -0
  56. data/spec/fixtures/utilities/unpack.scss +4 -4
  57. metadata +26 -28
  58. data/core/bourbon/library/_word-wrap.scss +0 -29
  59. data/core/bourbon/utilities/_directional-values.scss +0 -58
  60. data/core/bourbon/validators/_is-light.scss +0 -23
  61. data/spec/bourbon/library/word_wrap_spec.rb +0 -29
  62. data/spec/bourbon/utilities/collapse_directionals.rb +0 -25
  63. data/spec/bourbon/validators/is_light_spec.rb +0 -37
  64. data/spec/fixtures/library/word-wrap.scss +0 -9
  65. data/spec/fixtures/utilities/collapse-directionals.scss +0 -17
  66. data/spec/fixtures/validators/is-light.scss +0 -29
@@ -3,14 +3,14 @@
3
3
  /// Hides the text in an element, commonly used to show an image instead. Some
4
4
  /// elements will need block-level styles applied.
5
5
  ///
6
- /// @link http://goo.gl/EvLRIu
6
+ /// @link https://goo.gl/EvLRIu
7
7
  ///
8
8
  /// @example scss
9
9
  /// .element {
10
10
  /// @include hide-text;
11
11
  /// }
12
12
  ///
13
- /// @example css
13
+ /// // CSS Output
14
14
  /// .element {
15
15
  /// overflow: hidden;
16
16
  /// text-indent: 101%;
@@ -5,7 +5,7 @@
5
5
  /// the affects of the hiding, which is handy for showing the element on focus,
6
6
  /// for example.
7
7
  ///
8
- /// @link http://goo.gl/Vf1TGn
8
+ /// @link https://goo.gl/Vf1TGn
9
9
  ///
10
10
  /// @argument {string} $toggle [hide]
11
11
  /// Accepts `hide` or `unhide`. `unhide` reverses the affects of `hide`.
@@ -20,7 +20,7 @@
20
20
  /// }
21
21
  /// }
22
22
  ///
23
- /// @example css
23
+ /// // CSS Output
24
24
  /// .element {
25
25
  /// border: 0;
26
26
  /// clip: rect(1px, 1px, 1px, 1px);
@@ -53,6 +53,7 @@
53
53
  overflow: hidden;
54
54
  padding: 0;
55
55
  position: absolute;
56
+ white-space: nowrap;
56
57
  width: 1px;
57
58
  } @else if $toggle == "unhide" {
58
59
  clip: auto;
@@ -60,6 +61,7 @@
60
61
  height: auto;
61
62
  overflow: visible;
62
63
  position: static;
64
+ white-space: inherit;
63
65
  width: auto;
64
66
  }
65
67
  }
@@ -1,27 +1,30 @@
1
1
  @charset "UTF-8";
2
2
 
3
- /// Provides a quick method for targeting `margin` on specific sides of a
4
- /// box. Use a `null` value to “skip” a side.
3
+ /// Provides a concise, one-line method for setting `margin` on specific edges
4
+ /// of a box. Use a `null` value to “skip” edges of the box with standard
5
+ /// CSS shorthand.
5
6
  ///
6
- /// @argument {arglist} $values
7
- /// List of margin values, defined as CSS shorthand.
7
+ /// @argument {list} $values
8
+ /// List of margin values; accepts CSS shorthand.
8
9
  ///
9
10
  /// @example scss
10
- /// .element-one {
11
+ /// .element {
11
12
  /// @include margin(null auto);
12
13
  /// }
13
14
  ///
14
- /// .element-two {
15
- /// @include margin(10px 3em 20vh null);
16
- /// }
17
- ///
18
- /// @example css
19
- /// .element-one {
15
+ /// // CSS Output
16
+ /// .element {
20
17
  /// margin-left: auto;
21
18
  /// margin-right: auto;
22
19
  /// }
23
20
  ///
24
- /// .element-two {
21
+ /// @example scss
22
+ /// .element {
23
+ /// @include margin(10px 3em 20vh null);
24
+ /// }
25
+ ///
26
+ /// // CSS Output
27
+ /// .element {
25
28
  /// margin-bottom: 20vh;
26
29
  /// margin-right: 3em;
27
30
  /// margin-top: 10px;
@@ -29,6 +32,6 @@
29
32
  ///
30
33
  /// @require {mixin} _directional-property
31
34
 
32
- @mixin margin($values...) {
33
- @include _directional-property(margin, false, $values...);
35
+ @mixin margin($values) {
36
+ @include _directional-property(margin, null, $values);
34
37
  }
@@ -11,49 +11,57 @@
11
11
  /// How many steps to increment up or down the scale.
12
12
  ///
13
13
  /// @argument {number (with unit) | list} $value [1em]
14
- /// The base value the scale starts at.
14
+ /// The base value the scale starts at. Can also be set globally using the
15
+ /// `modular-scale-base` key in the Bourbon settings.
15
16
  ///
16
17
  /// @argument {number (unitless)} $ratio [1.25]
17
- /// The ratio the scale is built on.
18
+ /// The ratio the scale is built on. Can also be set globally using the
19
+ /// `modular-scale-ratio` key in the Bourbon settings.
18
20
  ///
19
21
  /// @return {number (with unit)}
20
22
  ///
21
23
  /// @example scss
22
- /// .first-element {
24
+ /// .element {
23
25
  /// font-size: modular-scale(2);
24
26
  /// }
25
27
  ///
26
- /// .second-element {
28
+ /// // CSS Output
29
+ /// .element {
30
+ /// font-size: 1.5625em;
31
+ /// }
32
+ ///
33
+ /// @example scss
34
+ /// .element {
27
35
  /// margin-right: modular-scale(3, 2em);
28
36
  /// }
29
37
  ///
30
- /// .third-element {
38
+ /// // CSS Output
39
+ /// .element {
40
+ /// margin-right: 3.90625em;
41
+ /// }
42
+ ///
43
+ /// @example scss
44
+ /// .element {
31
45
  /// font-size: modular-scale(3, 1em 1.6em, $major-seventh);
32
46
  /// }
33
47
  ///
48
+ /// // CSS Output
49
+ /// .element {
50
+ /// font-size: 3em;
51
+ /// }
52
+ ///
53
+ /// @example scss
34
54
  /// // Globally change the base ratio
35
55
  /// $bourbon: (
36
56
  /// "modular-scale-ratio": 1.2,
37
57
  /// );
38
58
  ///
39
- /// .fourth-element {
59
+ /// .element {
40
60
  /// font-size: modular-scale(3);
41
61
  /// }
42
62
  ///
43
- /// @example css
44
- /// .first-element {
45
- /// font-size: 1.5625em;
46
- /// }
47
- ///
48
- /// .second-element {
49
- /// margin-right: 3.90625em;
50
- /// }
51
- ///
52
- /// .third-element {
53
- /// font-size: 3em;
54
- /// }
55
- ///
56
- /// .fourth-element {
63
+ /// // CSS Output
64
+ /// .element {
57
65
  /// font-size: 1.728em;
58
66
  /// }
59
67
  ///
@@ -0,0 +1,24 @@
1
+ @charset "UTF-8";
2
+
3
+ /// Outputs the `overflow-wrap` property and its legacy name `word-wrap` to
4
+ /// support browsers that do not yet use `overflow-wrap`.
5
+ ///
6
+ /// @argument {string} $wrap [break-word]
7
+ /// Accepted CSS values are `normal`, `break-word`, `inherit`, `initial`,
8
+ /// or `unset`.
9
+ ///
10
+ /// @example scss
11
+ /// .wrapper {
12
+ /// @include overflow-wrap;
13
+ /// }
14
+ ///
15
+ /// // CSS Output
16
+ /// .wrapper {
17
+ /// word-wrap: break-word;
18
+ /// overflow-wrap: break-word;
19
+ /// }
20
+
21
+ @mixin overflow-wrap($wrap: break-word) {
22
+ word-wrap: $wrap;
23
+ overflow-wrap: $wrap;
24
+ }
@@ -1,26 +1,28 @@
1
1
  @charset "UTF-8";
2
2
 
3
- /// Provides a quick method for targeting `padding` on specific sides of a
3
+ /// Provides a concise method for targeting `padding` on specific sides of a
4
4
  /// box. Use a `null` value to “skip” a side.
5
5
  ///
6
- /// @argument {arglist} $values
7
- /// List of padding values, defined as CSS shorthand.
6
+ /// @argument {list} $values
7
+ /// List of padding values; accepts CSS shorthand.
8
8
  ///
9
9
  /// @example scss
10
10
  /// .element-one {
11
11
  /// @include padding(null 1rem);
12
12
  /// }
13
13
  ///
14
- /// .element-two {
15
- /// @include padding(10vh null 10px 5%);
16
- /// }
17
- ///
18
- /// @example css
14
+ /// // CSS Output
19
15
  /// .element-one {
20
16
  /// padding-left: 1rem;
21
17
  /// padding-right: 1rem;
22
18
  /// }
23
19
  ///
20
+ /// @example scss
21
+ /// .element-two {
22
+ /// @include padding(10vh null 10px 5%);
23
+ /// }
24
+ ///
25
+ /// // CSS Output
24
26
  /// .element-two {
25
27
  /// padding-bottom: 10px;
26
28
  /// padding-left: 5%;
@@ -29,6 +31,6 @@
29
31
  ///
30
32
  /// @require {mixin} _directional-property
31
33
 
32
- @mixin padding($values...) {
33
- @include _directional-property(padding, false, $values...);
34
+ @mixin padding($values) {
35
+ @include _directional-property(padding, null, $values);
34
36
  }
@@ -1,47 +1,57 @@
1
1
  @charset "UTF-8";
2
2
 
3
- /// Provides a quick method for setting an element’s position. Use a `null`
4
- /// value to “skip” a side.
3
+ /// Provides a concise, one-line method for setting an element’s positioning
4
+ /// properties: `position`, `top`, `right`, `bottom` and `left`. Use a `null`
5
+ /// value to “skip” an edge of the box.
5
6
  ///
6
- /// @argument {string} $position [relative]
7
+ /// @argument {string} $position
7
8
  /// A CSS position value.
8
9
  ///
9
- /// @argument {arglist} $coordinates [null]
10
- /// List of lengths, defined as CSS shorthand.
10
+ /// @argument {list} $box-edge-values
11
+ /// List of lengths; accepts CSS shorthand.
11
12
  ///
12
13
  /// @example scss
13
14
  /// .element {
14
- /// @include position(absolute, 0 null null 10em);
15
+ /// @include position(relative, 0 null null 10em);
15
16
  /// }
16
17
  ///
17
- /// @example css
18
+ /// // CSS Output
18
19
  /// .element {
19
20
  /// left: 10em;
21
+ /// position: relative;
22
+ /// top: 0;
23
+ /// }
24
+ ///
25
+ /// @example scss
26
+ /// .element {
27
+ /// @include position(absolute, 0);
28
+ /// }
29
+ ///
30
+ /// // CSS Output
31
+ /// .element {
20
32
  /// position: absolute;
21
33
  /// top: 0;
34
+ /// right: 0;
35
+ /// bottom: 0;
36
+ /// left: 0;
22
37
  /// }
23
38
  ///
24
39
  /// @require {function} _is-length
25
40
  ///
26
- /// @require {function} _unpack
41
+ /// @require {function} _unpack-shorthand
27
42
 
28
43
  @mixin position(
29
- $position: relative,
30
- $coordinates: null
44
+ $position,
45
+ $box-edge-values
31
46
  ) {
32
47
 
33
- @if type-of($position) == list {
34
- $coordinates: $position;
35
- $position: relative;
36
- }
37
-
38
- $coordinates: _unpack($coordinates);
48
+ $box-edge-values: _unpack-shorthand($box-edge-values);
39
49
 
40
50
  $offsets: (
41
- top: nth($coordinates, 1),
42
- right: nth($coordinates, 2),
43
- bottom: nth($coordinates, 3),
44
- left: nth($coordinates, 4),
51
+ top: nth($box-edge-values, 1),
52
+ right: nth($box-edge-values, 2),
53
+ bottom: nth($box-edge-values, 3),
54
+ left: nth($box-edge-values, 4),
45
55
  );
46
56
 
47
57
  position: $position;
@@ -16,7 +16,7 @@
16
16
  /// @include prefixer(appearance, none, ("webkit", "moz"));
17
17
  /// }
18
18
  ///
19
- /// @example css
19
+ /// // CSS Output
20
20
  /// .element {
21
21
  /// -webkit-appearance: none;
22
22
  /// -moz-appearance: none;
@@ -14,7 +14,7 @@
14
14
  /// background-color: shade(#ffbb52, 60%);
15
15
  /// }
16
16
  ///
17
- /// @example css
17
+ /// // CSS Output
18
18
  /// .element {
19
19
  /// background-color: #664a20;
20
20
  /// }
@@ -11,16 +11,18 @@
11
11
  /// @include size(2em);
12
12
  /// }
13
13
  ///
14
- /// .second-element {
15
- /// @include size(auto, 10em);
16
- /// }
17
- ///
18
- /// @example css
14
+ /// // CSS Output
19
15
  /// .first-element {
20
16
  /// width: 2em;
21
17
  /// height: 2em;
22
18
  /// }
23
19
  ///
20
+ /// @example scss
21
+ /// .second-element {
22
+ /// @include size(auto, 10em);
23
+ /// }
24
+ ///
25
+ /// // CSS Output
24
26
  /// .second-element {
25
27
  /// width: auto;
26
28
  /// height: 10em;
@@ -9,7 +9,7 @@
9
9
  /// @example scss
10
10
  /// $dimension: strip-unit(10em);
11
11
  ///
12
- /// @example css
12
+ /// // Output
13
13
  /// $dimension: 10;
14
14
 
15
15
  @function strip-unit($value) {
@@ -16,7 +16,7 @@
16
16
  /// border: 1px solid #ccc;
17
17
  /// }
18
18
  ///
19
- /// @example css
19
+ /// // CSS Output
20
20
  /// [type='color'],
21
21
  /// [type='date'],
22
22
  /// [type='datetime'],
@@ -47,7 +47,7 @@ $all-text-inputs: _assign-inputs($_text-inputs-list);
47
47
  /// border: 1px solid #aaa;
48
48
  /// }
49
49
  ///
50
- /// @example css
50
+ /// // CSS Output
51
51
  /// [type='color']:active,
52
52
  /// [type='date']:active,
53
53
  /// [type='datetime']:active,
@@ -78,7 +78,7 @@ $all-text-inputs-active: _assign-inputs($_text-inputs-list, active);
78
78
  /// border: 1px solid #1565c0;
79
79
  /// }
80
80
  ///
81
- /// @example css
81
+ /// // CSS Output
82
82
  /// [type='color']:focus,
83
83
  /// [type='date']:focus,
84
84
  /// [type='datetime']:focus,
@@ -109,7 +109,7 @@ $all-text-inputs-focus: _assign-inputs($_text-inputs-list, focus);
109
109
  /// border: 1px solid #aaa;
110
110
  /// }
111
111
  ///
112
- /// @example css
112
+ /// // CSS Output
113
113
  /// [type='color']:hover,
114
114
  /// [type='date']:hover,
115
115
  /// [type='datetime']:hover,
@@ -140,7 +140,7 @@ $all-text-inputs-hover: _assign-inputs($_text-inputs-list, hover);
140
140
  /// border: 1px solid #00f;
141
141
  /// }
142
142
  ///
143
- /// @example css
143
+ /// // CSS Output
144
144
  /// [type='color']:invalid,
145
145
  /// [type='date']:invalid,
146
146
  /// [type='datetime']:invalid,
@@ -5,7 +5,7 @@
5
5
  ////
6
6
  /// CSS cubic-bezier timing functions.
7
7
  ///
8
- /// @link http://goo.gl/p8u6SK
8
+ /// @link https://goo.gl/p8u6SK
9
9
  ///
10
10
  /// @type string
11
11
  ////
@@ -14,7 +14,7 @@
14
14
  /// background-color: tint(#6ecaa6, 40%);
15
15
  /// }
16
16
  ///
17
- /// @example css
17
+ /// // CSS Output
18
18
  /// .element {
19
19
  /// background-color: #a8dfc9;
20
20
  /// }