bourbon 3.1.8 → 3.2.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/_bourbon.scss +12 -2
  3. data/app/assets/stylesheets/addons/_button.scss +3 -3
  4. data/app/assets/stylesheets/addons/_clearfix.scss +5 -11
  5. data/app/assets/stylesheets/addons/_directional-values.scss +114 -0
  6. data/app/assets/stylesheets/addons/_ellipsis.scss +7 -0
  7. data/app/assets/stylesheets/addons/_font-family.scss +1 -1
  8. data/app/assets/stylesheets/addons/_hide-text.scss +8 -3
  9. data/app/assets/stylesheets/addons/_html5-input-types.scss +57 -3
  10. data/app/assets/stylesheets/addons/_position.scss +6 -16
  11. data/app/assets/stylesheets/addons/_prefixer.scss +1 -5
  12. data/app/assets/stylesheets/addons/_rem.scss +33 -0
  13. data/app/assets/stylesheets/addons/_retina-image.scss +4 -5
  14. data/app/assets/stylesheets/css3/_background.scss +8 -8
  15. data/app/assets/stylesheets/css3/_border-image.scss +1 -0
  16. data/app/assets/stylesheets/css3/_calc.scss +4 -0
  17. data/app/assets/stylesheets/css3/_flex-box.scss +269 -0
  18. data/app/assets/stylesheets/css3/_hyphens.scss +4 -0
  19. data/app/assets/stylesheets/css3/_image-rendering.scss +3 -3
  20. data/app/assets/stylesheets/css3/_keyframes.scss +0 -7
  21. data/app/assets/stylesheets/css3/_linear-gradient.scss +7 -10
  22. data/app/assets/stylesheets/css3/_radial-gradient.scss +6 -11
  23. data/app/assets/stylesheets/css3/_transition.scss +4 -4
  24. data/app/assets/stylesheets/functions/_golden-ratio.scss +3 -0
  25. data/app/assets/stylesheets/functions/_modular-scale.scss +54 -28
  26. data/app/assets/stylesheets/functions/_px-to-em.scss +7 -2
  27. data/app/assets/stylesheets/functions/_radial-gradient.scss +7 -7
  28. data/app/assets/stylesheets/functions/_strip-units.scss +5 -0
  29. data/app/assets/stylesheets/functions/_unpack.scss +17 -0
  30. data/app/assets/stylesheets/helpers/_radial-arg-parser.scss +4 -4
  31. data/app/assets/stylesheets/settings/_prefixer.scss +6 -0
  32. data/app/assets/stylesheets/settings/_px-to-em.scss +1 -0
  33. data/bourbon.gemspec +2 -2
  34. data/bower.json +16 -0
  35. data/dist/_bourbon-deprecated-upcoming.scss +13 -0
  36. data/dist/_bourbon.scss +69 -0
  37. data/dist/addons/_button.scss +273 -0
  38. data/dist/addons/_clearfix.scss +23 -0
  39. data/dist/addons/_directional-values.scss +114 -0
  40. data/dist/addons/_ellipsis.scss +7 -0
  41. data/dist/addons/_font-family.scss +5 -0
  42. data/dist/addons/_hide-text.scss +10 -0
  43. data/dist/addons/_html5-input-types.scss +110 -0
  44. data/dist/addons/_position.scss +32 -0
  45. data/dist/addons/_prefixer.scss +45 -0
  46. data/dist/addons/_rem.scss +33 -0
  47. data/dist/addons/_retina-image.scss +31 -0
  48. data/dist/addons/_size.scss +44 -0
  49. data/dist/addons/_timing-functions.scss +32 -0
  50. data/dist/addons/_triangle.scss +45 -0
  51. data/dist/css3/_animation.scss +52 -0
  52. data/dist/css3/_appearance.scss +3 -0
  53. data/dist/css3/_backface-visibility.scss +6 -0
  54. data/dist/css3/_background-image.scss +48 -0
  55. data/dist/css3/_background.scss +103 -0
  56. data/dist/css3/_border-image.scss +56 -0
  57. data/dist/css3/_border-radius.scss +22 -0
  58. data/dist/css3/_box-sizing.scss +4 -0
  59. data/dist/css3/_calc.scss +4 -0
  60. data/dist/css3/_columns.scss +47 -0
  61. data/dist/css3/_flex-box.scss +321 -0
  62. data/dist/css3/_font-face.scss +23 -0
  63. data/dist/css3/_hidpi-media-query.scss +10 -0
  64. data/dist/css3/_hyphens.scss +4 -0
  65. data/dist/css3/_image-rendering.scss +13 -0
  66. data/dist/css3/_inline-block.scss +8 -0
  67. data/dist/css3/_keyframes.scss +36 -0
  68. data/dist/css3/_linear-gradient.scss +38 -0
  69. data/dist/css3/_perspective.scss +8 -0
  70. data/dist/css3/_placeholder.scss +29 -0
  71. data/dist/css3/_radial-gradient.scss +39 -0
  72. data/dist/css3/_transform.scss +15 -0
  73. data/dist/css3/_transition.scss +34 -0
  74. data/dist/css3/_user-select.scss +3 -0
  75. data/dist/functions/_flex-grid.scss +39 -0
  76. data/dist/functions/_golden-ratio.scss +3 -0
  77. data/dist/functions/_grid-width.scss +13 -0
  78. data/dist/functions/_linear-gradient.scss +13 -0
  79. data/dist/functions/_modular-scale.scss +66 -0
  80. data/dist/functions/_px-to-em.scss +13 -0
  81. data/dist/functions/_radial-gradient.scss +23 -0
  82. data/dist/functions/_strip-units.scss +5 -0
  83. data/dist/functions/_tint-shade.scss +9 -0
  84. data/dist/functions/_transition-property-name.scss +22 -0
  85. data/dist/functions/_unpack.scss +17 -0
  86. data/dist/helpers/_gradient-positions-parser.scss +13 -0
  87. data/dist/helpers/_linear-positions-parser.scss +61 -0
  88. data/dist/helpers/_radial-arg-parser.scss +69 -0
  89. data/dist/helpers/_radial-positions-parser.scss +18 -0
  90. data/dist/helpers/_render-gradients.scss +26 -0
  91. data/dist/helpers/_shape-size-stripper.scss +10 -0
  92. data/dist/settings/_prefixer.scss +6 -0
  93. data/dist/settings/_px-to-em.scss +1 -0
  94. data/lib/bourbon/version.rb +1 -1
  95. data/readme.md +2 -0
  96. metadata +77 -9
  97. data/app/assets/stylesheets/functions/_compact.scss +0 -11
  98. data/app/assets/stylesheets/helpers/_deprecated-webkit-gradient.scss +0 -39
@@ -1,16 +1,12 @@
1
1
  // Requires Sass 3.1+
2
2
  @mixin radial-gradient($G1, $G2,
3
- $G3: false, $G4: false,
4
- $G5: false, $G6: false,
5
- $G7: false, $G8: false,
6
- $G9: false, $G10: false,
3
+ $G3: null, $G4: null,
4
+ $G5: null, $G6: null,
5
+ $G7: null, $G8: null,
6
+ $G9: null, $G10: null,
7
7
  $pos: null,
8
8
  $shape-size: null,
9
- $deprecated-pos1: center center,
10
- $deprecated-pos2: center center,
11
- $deprecated-radius1: 0,
12
- $deprecated-radius2: 460,
13
- $fallback: false) {
9
+ $fallback: null) {
14
10
 
15
11
  $data: _radial-arg-parser($G1, $G2, $pos, $shape-size);
16
12
  $G1: nth($data, 1);
@@ -18,7 +14,7 @@
18
14
  $pos: nth($data, 3);
19
15
  $shape-size: nth($data, 4);
20
16
 
21
- $full: compact($G1, $G2, $G3, $G4, $G5, $G6, $G7, $G8, $G9, $G10);
17
+ $full: $G1, $G2, $G3, $G4, $G5, $G6, $G7, $G8, $G9, $G10;
22
18
 
23
19
  // Strip deprecated cover/contain for spec
24
20
  $shape-size-spec: _shape-size-stripper($shape-size);
@@ -38,7 +34,6 @@
38
34
  $shape-size-spec: if(($shape-size-spec != ' ') and ($pos == null), '#{$shape-size-spec}, ', '#{$shape-size-spec} ');
39
35
 
40
36
  background-color: $fallback-color;
41
- background-image: _deprecated-webkit-gradient(radial, $deprecated-pos1, $deprecated-pos2, $full, $deprecated-radius1, $deprecated-radius2); // Safari <= 5.0 && IOS 4
42
37
  background-image: -webkit-radial-gradient(unquote(#{$pos}#{$shape-size}#{$full}));
43
38
  background-image: unquote("radial-gradient(#{$shape-size-spec}#{$pos-spec}#{$full})");
44
39
  }
@@ -1,7 +1,7 @@
1
1
  // Shorthand mixin. Supports multiple parentheses-deliminated values for each variable.
2
- // Example: @include transition (all, 2.0s, ease-in-out);
3
- // @include transition ((opacity, width), (1.0s, 2.0s), ease-in, (0, 2s));
4
- // @include transition ($property:(opacity, width), $delay: (1.5s, 2.5s));
2
+ // Example: @include transition (all 2s ease-in-out);
3
+ // @include transition (opacity 1s ease-in 2s, width 2s ease-out);
4
+ // @include transition-property (transform, opacity);
5
5
 
6
6
  @mixin transition ($properties...) {
7
7
  @if length($properties) >= 1 {
@@ -9,7 +9,7 @@
9
9
  }
10
10
 
11
11
  @else {
12
- $properties: all 0.15s ease-out 0;
12
+ $properties: all 0.15s ease-out 0s;
13
13
  @include prefixer(transition, $properties, webkit moz spec);
14
14
  }
15
15
  }
@@ -0,0 +1,3 @@
1
+ @function golden-ratio($value, $increment) {
2
+ @return modular-scale($value, $increment, $golden)
3
+ }
@@ -1,40 +1,66 @@
1
+ // Scaling Varaibles
2
+ $golden: 1.618;
3
+ $minor-second: 1.067;
4
+ $major-second: 1.125;
5
+ $minor-third: 1.2;
6
+ $major-third: 1.25;
7
+ $perfect-fourth: 1.333;
8
+ $augmented-fourth: 1.414;
9
+ $perfect-fifth: 1.5;
10
+ $minor-sixth: 1.6;
11
+ $major-sixth: 1.667;
12
+ $minor-seventh: 1.778;
13
+ $major-seventh: 1.875;
14
+ $octave: 2;
15
+ $major-tenth: 2.5;
16
+ $major-eleventh: 2.667;
17
+ $major-twelfth: 3;
18
+ $double-octave: 4;
19
+
1
20
  @function modular-scale($value, $increment, $ratio) {
21
+ $v1: nth($value, 1);
22
+ $v2: nth($value, length($value));
23
+ $value: $v1;
24
+
25
+ // scale $v2 to just above $v1
26
+ @while $v2 > $v1 {
27
+ $v2: ($v2 / $ratio); // will be off-by-1
28
+ }
29
+ @while $v2 < $v1 {
30
+ $v2: ($v2 * $ratio); // will fix off-by-1
31
+ }
32
+
33
+ // check AFTER scaling $v2 to prevent double-counting corner-case
34
+ $double-stranded: $v2 > $v1;
35
+
2
36
  @if $increment > 0 {
3
37
  @for $i from 1 through $increment {
4
- $value: ($value * $ratio);
38
+ @if $double-stranded and ($v1 * $ratio) > $v2 {
39
+ $value: $v2;
40
+ $v2: ($v2 * $ratio);
41
+ } @else {
42
+ $v1: ($v1 * $ratio);
43
+ $value: $v1;
44
+ }
5
45
  }
6
46
  }
7
47
 
8
48
  @if $increment < 0 {
9
- $increment: abs($increment);
10
- @for $i from 1 through $increment {
11
- $value: ($value / $ratio);
49
+ // adjust $v2 to just below $v1
50
+ @if $double-stranded {
51
+ $v2: ($v2 / $ratio);
52
+ }
53
+
54
+ @for $i from $increment through -1 {
55
+ @if $double-stranded and ($v1 / $ratio) < $v2 {
56
+ $value: $v2;
57
+ $v2: ($v2 / $ratio);
58
+ } @else {
59
+ $v1: ($v1 / $ratio);
60
+ $value: $v1;
61
+ }
12
62
  }
13
63
  }
14
64
 
15
65
  @return $value;
16
66
  }
17
-
18
- // div {
19
- // Increment Up GR with positive value
20
- // font-size: modular-scale(14px, 1, 1.618); // returns: 22.652px
21
- //
22
- // Increment Down GR with negative value
23
- // font-size: modular-scale(14px, -1, 1.618); // returns: 8.653px
24
- //
25
- // Can be used with ceil(round up) or floor(round down)
26
- // font-size: floor( modular-scale(14px, 1, 1.618) ); // returns: 22px
27
- // font-size: ceil( modular-scale(14px, 1, 1.618) ); // returns: 23px
28
- // }
29
- //
30
- // modularscale.com
31
-
32
- @function golden-ratio($value, $increment) {
33
- @return modular-scale($value, $increment, 1.618)
34
- }
35
-
36
- // div {
37
- // font-size: golden-ratio(14px, 1); // returns: 22.652px
38
- // }
39
- //
40
- // goldenratiocalculator.com
@@ -2,7 +2,12 @@
2
2
  // eg. for a relational value of 12px write em(12) when the parent is 16px
3
3
  // if the parent is another value say 24px write em(12, 24)
4
4
 
5
- @function em($pxval, $base: 16) {
5
+ @function em($pxval, $base: $em-base) {
6
+ @if not unitless($pxval) {
7
+ $pxval: strip-units($pxval);
8
+ }
9
+ @if not unitless($base) {
10
+ $base: strip-units($base);
11
+ }
6
12
  @return ($pxval / $base) * 1em;
7
13
  }
8
-
@@ -1,11 +1,11 @@
1
1
  // This function is required and used by the background-image mixin.
2
2
  @function radial-gradient($G1, $G2,
3
- $G3: false, $G4: false,
4
- $G5: false, $G6: false,
5
- $G7: false, $G8: false,
6
- $G9: false, $G10: false,
7
- $pos: null,
8
- $shape-size: null) {
3
+ $G3: null, $G4: null,
4
+ $G5: null, $G6: null,
5
+ $G7: null, $G8: null,
6
+ $G9: null, $G10: null,
7
+ $pos: null,
8
+ $shape-size: null) {
9
9
 
10
10
  $data: _radial-arg-parser($G1, $G2, $pos, $shape-size);
11
11
  $G1: nth($data, 1);
@@ -14,7 +14,7 @@
14
14
  $shape-size: nth($data, 4);
15
15
 
16
16
  $type: radial;
17
- $gradient: compact($G1, $G2, $G3, $G4, $G5, $G6, $G7, $G8, $G9, $G10);
17
+ $gradient: $G1, $G2, $G3, $G4, $G5, $G6, $G7, $G8, $G9, $G10;
18
18
 
19
19
  $type-gradient: $type, $shape-size $pos, $gradient;
20
20
  @return $type-gradient;
@@ -0,0 +1,5 @@
1
+ // Srtips the units from a value. e.g. 12px -> 12
2
+
3
+ @function strip-units($val) {
4
+ @return ($val / ($val * 0 + 1));
5
+ }
@@ -0,0 +1,17 @@
1
+ // Convert shorthand to the 4-value syntax
2
+
3
+ @function unpack($shorthand) {
4
+ @if length($shorthand) == 1 {
5
+ @return nth($shorthand, 1) nth($shorthand, 1) nth($shorthand, 1) nth($shorthand, 1);
6
+ }
7
+ @else if length($shorthand) == 2 {
8
+ @return nth($shorthand, 1) nth($shorthand, 2) nth($shorthand, 1) nth($shorthand, 2);
9
+ }
10
+ @else if length($shorthand) == 3 {
11
+ @return nth($shorthand, 1) nth($shorthand, 2) nth($shorthand, 3) nth($shorthand, 2);
12
+ }
13
+ @else {
14
+ @return $shorthand;
15
+ }
16
+ }
17
+
@@ -22,7 +22,7 @@
22
22
  $pos: $pos nth($value, $i);
23
23
  }
24
24
  }
25
- $G1: false;
25
+ $G1: null;
26
26
  }
27
27
 
28
28
  // If not spec calculate correct values
@@ -38,7 +38,7 @@
38
38
  $pos: $value;
39
39
 
40
40
  @if $pos == $G1 {
41
- $G1: false;
41
+ $G1: null;
42
42
  }
43
43
  }
44
44
 
@@ -55,11 +55,11 @@
55
55
  $shape-size: $value;
56
56
 
57
57
  @if $value == $G1 {
58
- $G1: false;
58
+ $G1: null;
59
59
  }
60
60
 
61
61
  @else if $value == $G2 {
62
- $G2: false;
62
+ $G2: null;
63
63
  }
64
64
  }
65
65
  }
@@ -0,0 +1,6 @@
1
+ // Variable settings for /addons/prefixer.scss
2
+ $prefix-for-webkit: true !default;
3
+ $prefix-for-mozilla: true !default;
4
+ $prefix-for-microsoft: true !default;
5
+ $prefix-for-opera: true !default;
6
+ $prefix-for-spec: true !default; // required for keyframe mixin
@@ -0,0 +1 @@
1
+ $em-base: 16px !default;
data/bourbon.gemspec CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
11
11
  s.homepage = "https://github.com/thoughtbot/bourbon"
12
12
  s.summary = "Bourbon Sass Mixins using SCSS syntax."
13
13
  s.description = <<-DESC
14
- The purpose of Bourbon Vanilla Sass Mixins is to provide a comprehensive framework of
14
+ Bourbon provides a comprehensive framework of
15
15
  sass mixins that are designed to be as vanilla as possible. Meaning they
16
16
  should not deter from the original CSS syntax. The mixins contain vendor
17
17
  specific prefixes for all CSS3 properties for support amongst modern
@@ -26,7 +26,7 @@ that support only CSS3 prefixed properties.
26
26
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
27
27
  s.require_paths = ["lib"]
28
28
 
29
- s.add_dependency('sass', '>= 3.2.0')
29
+ s.add_dependency('sass', '>= 3.3.0.rc.1')
30
30
  s.add_dependency('thor')
31
31
 
32
32
  s.add_development_dependency('aruba', '~> 0.4')
data/bower.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "bourbon",
3
+ "homepage": "http://bourbon.io/",
4
+ "main": "dist/_bourbon.scss",
5
+ "ignore": [
6
+ "app",
7
+ "bin",
8
+ "features",
9
+ "lib",
10
+ ".gitignore",
11
+ "Gemfile",
12
+ "Gemfile.lock",
13
+ "Rakefile",
14
+ "bourbon.gemspec"
15
+ ]
16
+ }
@@ -0,0 +1,13 @@
1
+ //************************************************************************//
2
+ // These mixins/functions are deprecated
3
+ // They will be removed in the next MAJOR version release
4
+ //************************************************************************//
5
+ @mixin box-shadow ($shadows...) {
6
+ @include prefixer(box-shadow, $shadows, spec);
7
+ @warn "box-shadow is deprecated and will be removed in the next major version release";
8
+ }
9
+
10
+ @mixin background-size ($lengths...) {
11
+ @include prefixer(background-size, $lengths, spec);
12
+ @warn "background-size is deprecated and will be removed in the next major version release";
13
+ }
@@ -0,0 +1,69 @@
1
+ // Settings
2
+ @import "settings/prefixer";
3
+ @import "settings/px-to-em";
4
+
5
+ // Custom Helpers
6
+ @import "helpers/gradient-positions-parser";
7
+ @import "helpers/linear-positions-parser";
8
+ @import "helpers/radial-arg-parser";
9
+ @import "helpers/radial-positions-parser";
10
+ @import "helpers/render-gradients";
11
+ @import "helpers/shape-size-stripper";
12
+
13
+ // Custom Functions
14
+ @import "functions/flex-grid";
15
+ @import "functions/grid-width";
16
+ @import "functions/golden-ratio";
17
+ @import "functions/linear-gradient";
18
+ @import "functions/modular-scale";
19
+ @import "functions/px-to-em";
20
+ @import "functions/radial-gradient";
21
+ @import "functions/strip-units";
22
+ @import "functions/tint-shade";
23
+ @import "functions/transition-property-name";
24
+ @import "functions/unpack";
25
+
26
+ // CSS3 Mixins
27
+ @import "css3/animation";
28
+ @import "css3/appearance";
29
+ @import "css3/backface-visibility";
30
+ @import "css3/background";
31
+ @import "css3/background-image";
32
+ @import "css3/border-image";
33
+ @import "css3/border-radius";
34
+ @import "css3/box-sizing";
35
+ @import "css3/calc";
36
+ @import "css3/columns";
37
+ @import "css3/flex-box";
38
+ @import "css3/font-face";
39
+ @import "css3/hyphens";
40
+ @import "css3/hidpi-media-query";
41
+ @import "css3/image-rendering";
42
+ @import "css3/inline-block";
43
+ @import "css3/keyframes";
44
+ @import "css3/linear-gradient";
45
+ @import "css3/perspective";
46
+ @import "css3/radial-gradient";
47
+ @import "css3/transform";
48
+ @import "css3/transition";
49
+ @import "css3/user-select";
50
+ @import "css3/placeholder";
51
+
52
+ // Addons & other mixins
53
+ @import "addons/button";
54
+ @import "addons/clearfix";
55
+ @import "addons/directional-values";
56
+ @import "addons/ellipsis";
57
+ @import "addons/font-family";
58
+ @import "addons/hide-text";
59
+ @import "addons/html5-input-types";
60
+ @import "addons/position";
61
+ @import "addons/prefixer";
62
+ @import "addons/rem";
63
+ @import "addons/retina-image";
64
+ @import "addons/size";
65
+ @import "addons/timing-functions";
66
+ @import "addons/triangle";
67
+
68
+ // Soon to be deprecated Mixins
69
+ @import "bourbon-deprecated-upcoming";
@@ -0,0 +1,273 @@
1
+ @mixin button ($style: simple, $base-color: #4294f0) {
2
+
3
+ @if type-of($style) == color {
4
+ $base-color: $style;
5
+ $style: simple;
6
+ }
7
+
8
+ // Grayscale button
9
+ @if $base-color == grayscale($base-color) {
10
+ @if $style == simple {
11
+ @include simple($base-color, $grayscale: true);
12
+ }
13
+
14
+ @else if $style == shiny {
15
+ @include shiny($base-color, $grayscale: true);
16
+ }
17
+
18
+ @else if $style == pill {
19
+ @include pill($base-color, $grayscale: true);
20
+ }
21
+ }
22
+
23
+ // Colored button
24
+ @else {
25
+ @if $style == simple {
26
+ @include simple($base-color);
27
+ }
28
+
29
+ @else if $style == shiny {
30
+ @include shiny($base-color);
31
+ }
32
+
33
+ @else if $style == pill {
34
+ @include pill($base-color);
35
+ }
36
+ }
37
+
38
+ &:disabled {
39
+ opacity: 0.5;
40
+ cursor: not-allowed;
41
+ }
42
+ }
43
+
44
+
45
+ // Simple Button
46
+ //************************************************************************//
47
+ @mixin simple($base-color, $grayscale: false) {
48
+ $color: hsl(0, 0, 100%);
49
+ $border: adjust-color($base-color, $saturation: 9%, $lightness: -14%);
50
+ $inset-shadow: adjust-color($base-color, $saturation: -8%, $lightness: 15%);
51
+ $stop-gradient: adjust-color($base-color, $saturation: 9%, $lightness: -11%);
52
+ $text-shadow: adjust-color($base-color, $saturation: 15%, $lightness: -18%);
53
+
54
+ @if lightness($base-color) > 70% {
55
+ $color: hsl(0, 0, 20%);
56
+ $text-shadow: adjust-color($base-color, $saturation: 10%, $lightness: 4%);
57
+ }
58
+
59
+ @if $grayscale == true {
60
+ $border: grayscale($border);
61
+ $inset-shadow: grayscale($inset-shadow);
62
+ $stop-gradient: grayscale($stop-gradient);
63
+ $text-shadow: grayscale($text-shadow);
64
+ }
65
+
66
+ border: 1px solid $border;
67
+ border-radius: 3px;
68
+ box-shadow: inset 0 1px 0 0 $inset-shadow;
69
+ color: $color;
70
+ display: inline-block;
71
+ font-size: inherit;
72
+ font-weight: bold;
73
+ @include linear-gradient ($base-color, $stop-gradient);
74
+ padding: 7px 18px;
75
+ text-decoration: none;
76
+ text-shadow: 0 1px 0 $text-shadow;
77
+ background-clip: padding-box;
78
+
79
+ &:hover:not(:disabled) {
80
+ $base-color-hover: adjust-color($base-color, $saturation: -4%, $lightness: -5%);
81
+ $inset-shadow-hover: adjust-color($base-color, $saturation: -7%, $lightness: 5%);
82
+ $stop-gradient-hover: adjust-color($base-color, $saturation: 8%, $lightness: -14%);
83
+
84
+ @if $grayscale == true {
85
+ $base-color-hover: grayscale($base-color-hover);
86
+ $inset-shadow-hover: grayscale($inset-shadow-hover);
87
+ $stop-gradient-hover: grayscale($stop-gradient-hover);
88
+ }
89
+
90
+ box-shadow: inset 0 1px 0 0 $inset-shadow-hover;
91
+ cursor: pointer;
92
+ @include linear-gradient ($base-color-hover, $stop-gradient-hover);
93
+ }
94
+
95
+ &:active:not(:disabled) {
96
+ $border-active: adjust-color($base-color, $saturation: 9%, $lightness: -14%);
97
+ $inset-shadow-active: adjust-color($base-color, $saturation: 7%, $lightness: -17%);
98
+
99
+ @if $grayscale == true {
100
+ $border-active: grayscale($border-active);
101
+ $inset-shadow-active: grayscale($inset-shadow-active);
102
+ }
103
+
104
+ border: 1px solid $border-active;
105
+ box-shadow: inset 0 0 8px 4px $inset-shadow-active, inset 0 0 8px 4px $inset-shadow-active, 0 1px 1px 0 #eee;
106
+ }
107
+ }
108
+
109
+
110
+ // Shiny Button
111
+ //************************************************************************//
112
+ @mixin shiny($base-color, $grayscale: false) {
113
+ $color: hsl(0, 0, 100%);
114
+ $border: adjust-color($base-color, $red: -117, $green: -111, $blue: -81);
115
+ $border-bottom: adjust-color($base-color, $red: -126, $green: -127, $blue: -122);
116
+ $fourth-stop: adjust-color($base-color, $red: -79, $green: -70, $blue: -46);
117
+ $inset-shadow: adjust-color($base-color, $red: 37, $green: 29, $blue: 12);
118
+ $second-stop: adjust-color($base-color, $red: -56, $green: -50, $blue: -33);
119
+ $text-shadow: adjust-color($base-color, $red: -140, $green: -141, $blue: -114);
120
+ $third-stop: adjust-color($base-color, $red: -86, $green: -75, $blue: -48);
121
+
122
+ @if lightness($base-color) > 70% {
123
+ $color: hsl(0, 0, 20%);
124
+ $text-shadow: adjust-color($base-color, $saturation: 10%, $lightness: 4%);
125
+ }
126
+
127
+ @if $grayscale == true {
128
+ $border: grayscale($border);
129
+ $border-bottom: grayscale($border-bottom);
130
+ $fourth-stop: grayscale($fourth-stop);
131
+ $inset-shadow: grayscale($inset-shadow);
132
+ $second-stop: grayscale($second-stop);
133
+ $text-shadow: grayscale($text-shadow);
134
+ $third-stop: grayscale($third-stop);
135
+ }
136
+
137
+ border: 1px solid $border;
138
+ border-bottom: 1px solid $border-bottom;
139
+ border-radius: 5px;
140
+ box-shadow: inset 0 1px 0 0 $inset-shadow;
141
+ color: $color;
142
+ display: inline-block;
143
+ font-size: inherit;
144
+ font-weight: bold;
145
+ @include linear-gradient(top, $base-color 0%, $second-stop 50%, $third-stop 50%, $fourth-stop 100%);
146
+ padding: 8px 20px;
147
+ text-align: center;
148
+ text-decoration: none;
149
+ text-shadow: 0 -1px 1px $text-shadow;
150
+
151
+ &:hover:not(:disabled) {
152
+ $first-stop-hover: adjust-color($base-color, $red: -13, $green: -15, $blue: -18);
153
+ $second-stop-hover: adjust-color($base-color, $red: -66, $green: -62, $blue: -51);
154
+ $third-stop-hover: adjust-color($base-color, $red: -93, $green: -85, $blue: -66);
155
+ $fourth-stop-hover: adjust-color($base-color, $red: -86, $green: -80, $blue: -63);
156
+
157
+ @if $grayscale == true {
158
+ $first-stop-hover: grayscale($first-stop-hover);
159
+ $second-stop-hover: grayscale($second-stop-hover);
160
+ $third-stop-hover: grayscale($third-stop-hover);
161
+ $fourth-stop-hover: grayscale($fourth-stop-hover);
162
+ }
163
+
164
+ cursor: pointer;
165
+ @include linear-gradient(top, $first-stop-hover 0%,
166
+ $second-stop-hover 50%,
167
+ $third-stop-hover 50%,
168
+ $fourth-stop-hover 100%);
169
+ }
170
+
171
+ &:active:not(:disabled) {
172
+ $inset-shadow-active: adjust-color($base-color, $red: -111, $green: -116, $blue: -122);
173
+
174
+ @if $grayscale == true {
175
+ $inset-shadow-active: grayscale($inset-shadow-active);
176
+ }
177
+
178
+ box-shadow: inset 0 0 20px 0 $inset-shadow-active, 0 1px 0 #fff;
179
+ }
180
+ }
181
+
182
+
183
+ // Pill Button
184
+ //************************************************************************//
185
+ @mixin pill($base-color, $grayscale: false) {
186
+ $color: hsl(0, 0, 100%);
187
+ $border-bottom: adjust-color($base-color, $hue: 8, $saturation: -11%, $lightness: -26%);
188
+ $border-sides: adjust-color($base-color, $hue: 4, $saturation: -21%, $lightness: -21%);
189
+ $border-top: adjust-color($base-color, $hue: -1, $saturation: -30%, $lightness: -15%);
190
+ $inset-shadow: adjust-color($base-color, $hue: -1, $saturation: -1%, $lightness: 7%);
191
+ $stop-gradient: adjust-color($base-color, $hue: 8, $saturation: 14%, $lightness: -10%);
192
+ $text-shadow: adjust-color($base-color, $hue: 5, $saturation: -19%, $lightness: -15%);
193
+
194
+ @if lightness($base-color) > 70% {
195
+ $color: hsl(0, 0, 20%);
196
+ $text-shadow: adjust-color($base-color, $saturation: 10%, $lightness: 4%);
197
+ }
198
+
199
+ @if $grayscale == true {
200
+ $border-bottom: grayscale($border-bottom);
201
+ $border-sides: grayscale($border-sides);
202
+ $border-top: grayscale($border-top);
203
+ $inset-shadow: grayscale($inset-shadow);
204
+ $stop-gradient: grayscale($stop-gradient);
205
+ $text-shadow: grayscale($text-shadow);
206
+ }
207
+
208
+ border: 1px solid $border-top;
209
+ border-color: $border-top $border-sides $border-bottom;
210
+ border-radius: 16px;
211
+ box-shadow: inset 0 1px 0 0 $inset-shadow, 0 1px 2px 0 #b3b3b3;
212
+ color: $color;
213
+ display: inline-block;
214
+ font-size: inherit;
215
+ font-weight: normal;
216
+ line-height: 1;
217
+ @include linear-gradient ($base-color, $stop-gradient);
218
+ padding: 5px 16px;
219
+ text-align: center;
220
+ text-decoration: none;
221
+ text-shadow: 0 -1px 1px $text-shadow;
222
+ background-clip: padding-box;
223
+
224
+ &:hover:not(:disabled) {
225
+ $base-color-hover: adjust-color($base-color, $lightness: -4.5%);
226
+ $border-bottom: adjust-color($base-color, $hue: 8, $saturation: 13.5%, $lightness: -32%);
227
+ $border-sides: adjust-color($base-color, $hue: 4, $saturation: -2%, $lightness: -27%);
228
+ $border-top: adjust-color($base-color, $hue: -1, $saturation: -17%, $lightness: -21%);
229
+ $inset-shadow-hover: adjust-color($base-color, $saturation: -1%, $lightness: 3%);
230
+ $stop-gradient-hover: adjust-color($base-color, $hue: 8, $saturation: -4%, $lightness: -15.5%);
231
+ $text-shadow-hover: adjust-color($base-color, $hue: 5, $saturation: -5%, $lightness: -22%);
232
+
233
+ @if $grayscale == true {
234
+ $base-color-hover: grayscale($base-color-hover);
235
+ $border-bottom: grayscale($border-bottom);
236
+ $border-sides: grayscale($border-sides);
237
+ $border-top: grayscale($border-top);
238
+ $inset-shadow-hover: grayscale($inset-shadow-hover);
239
+ $stop-gradient-hover: grayscale($stop-gradient-hover);
240
+ $text-shadow-hover: grayscale($text-shadow-hover);
241
+ }
242
+
243
+ border: 1px solid $border-top;
244
+ border-color: $border-top $border-sides $border-bottom;
245
+ box-shadow: inset 0 1px 0 0 $inset-shadow-hover;
246
+ cursor: pointer;
247
+ @include linear-gradient ($base-color-hover, $stop-gradient-hover);
248
+ text-shadow: 0 -1px 1px $text-shadow-hover;
249
+ background-clip: padding-box;
250
+ }
251
+
252
+ &:active:not(:disabled) {
253
+ $active-color: adjust-color($base-color, $hue: 4, $saturation: -12%, $lightness: -10%);
254
+ $border-active: adjust-color($base-color, $hue: 6, $saturation: -2.5%, $lightness: -30%);
255
+ $border-bottom-active: adjust-color($base-color, $hue: 11, $saturation: 6%, $lightness: -31%);
256
+ $inset-shadow-active: adjust-color($base-color, $hue: 9, $saturation: 2%, $lightness: -21.5%);
257
+ $text-shadow-active: adjust-color($base-color, $hue: 5, $saturation: -12%, $lightness: -21.5%);
258
+
259
+ @if $grayscale == true {
260
+ $active-color: grayscale($active-color);
261
+ $border-active: grayscale($border-active);
262
+ $border-bottom-active: grayscale($border-bottom-active);
263
+ $inset-shadow-active: grayscale($inset-shadow-active);
264
+ $text-shadow-active: grayscale($text-shadow-active);
265
+ }
266
+
267
+ background: $active-color;
268
+ border: 1px solid $border-active;
269
+ border-bottom: 1px solid $border-bottom-active;
270
+ box-shadow: inset 0 0 6px 3px $inset-shadow-active, 0 1px 0 0 #fff;
271
+ text-shadow: 0 -1px 1px $text-shadow-active;
272
+ }
273
+ }