bourbon-compass 2.1.1.0

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 (43) hide show
  1. data/lib/bourbon-compass.rb +4 -0
  2. data/readme.md +31 -0
  3. data/stylesheets/bourbon/_bourbon.scss +40 -0
  4. data/stylesheets/bourbon/addons/_button.scss +273 -0
  5. data/stylesheets/bourbon/addons/_clearfix.scss +29 -0
  6. data/stylesheets/bourbon/addons/_font-face.scss +12 -0
  7. data/stylesheets/bourbon/addons/_font-family.scss +5 -0
  8. data/stylesheets/bourbon/addons/_hide-text.scss +15 -0
  9. data/stylesheets/bourbon/addons/_html5-input-types.scss +36 -0
  10. data/stylesheets/bourbon/addons/_position.scss +42 -0
  11. data/stylesheets/bourbon/addons/_timing-functions.scss +32 -0
  12. data/stylesheets/bourbon/css3/_animation.scss +125 -0
  13. data/stylesheets/bourbon/css3/_appearance.scss +3 -0
  14. data/stylesheets/bourbon/css3/_background-image.scss +57 -0
  15. data/stylesheets/bourbon/css3/_background-size.scss +11 -0
  16. data/stylesheets/bourbon/css3/_background.scss +107 -0
  17. data/stylesheets/bourbon/css3/_border-image.scss +56 -0
  18. data/stylesheets/bourbon/css3/_border-radius.scss +44 -0
  19. data/stylesheets/bourbon/css3/_box-shadow.scss +12 -0
  20. data/stylesheets/bourbon/css3/_box-sizing.scss +4 -0
  21. data/stylesheets/bourbon/css3/_columns.scss +47 -0
  22. data/stylesheets/bourbon/css3/_flex-box.scss +52 -0
  23. data/stylesheets/bourbon/css3/_inline-block.scss +8 -0
  24. data/stylesheets/bourbon/css3/_linear-gradient.scss +43 -0
  25. data/stylesheets/bourbon/css3/_prefixer.scss +12 -0
  26. data/stylesheets/bourbon/css3/_radial-gradient.scss +76 -0
  27. data/stylesheets/bourbon/css3/_transform.scss +11 -0
  28. data/stylesheets/bourbon/css3/_transition.scss +72 -0
  29. data/stylesheets/bourbon/css3/_user-select.scss +3 -0
  30. data/stylesheets/bourbon/functions/_deprecated-webkit-gradient.scss +44 -0
  31. data/stylesheets/bourbon/functions/_flex-grid.scss +35 -0
  32. data/stylesheets/bourbon/functions/_grid-width.scss +13 -0
  33. data/stylesheets/bourbon/functions/_linear-gradient.scss +23 -0
  34. data/stylesheets/bourbon/functions/_modular-scale.scss +40 -0
  35. data/stylesheets/bourbon/functions/_radial-gradient.scss +62 -0
  36. data/stylesheets/bourbon/functions/_render-gradients.scss +14 -0
  37. data/stylesheets/bourbon/functions/_tint-shade.scss +9 -0
  38. data/stylesheets/bourbon/functions/_transition-property-name.scss +22 -0
  39. data/stylesheets/bourbon/lib/bourbon.rb +19 -0
  40. data/stylesheets/bourbon/lib/bourbon/sass_extensions.rb +6 -0
  41. data/stylesheets/bourbon/lib/bourbon/sass_extensions/functions.rb +13 -0
  42. data/stylesheets/bourbon/lib/bourbon/sass_extensions/functions/compact.rb +14 -0
  43. metadata +118 -0
@@ -0,0 +1,23 @@
1
+ @function linear-gradient($pos: top, $G1: false, $G2: false,
2
+ $G3: false, $G4: false,
3
+ $G5: false, $G6: false,
4
+ $G7: false, $G8: false,
5
+ $G9: false, $G10: false) {
6
+
7
+ // Detect what type of value exists in $pos
8
+ $pos-type: type-of(nth($pos, 1));
9
+
10
+ // If $pos is missing from mixin, reassign vars and add default position
11
+ @if ($pos-type == color) or (nth($pos, 1) == "transparent") {
12
+ $G10: $G9; $G9: $G8; $G8: $G7; $G7: $G6; $G6: $G5;
13
+ $G5: $G4; $G4: $G3; $G3: $G2; $G2: $G1; $G1: $pos;
14
+ $pos: top; // Default position
15
+ }
16
+
17
+ $type: linear;
18
+ $gradient: compact($pos, $G1, $G2, $G3, $G4, $G5, $G6, $G7, $G8, $G9, $G10);
19
+ $type-gradient: append($type, $gradient, comma);
20
+
21
+ @return $type-gradient;
22
+ }
23
+
@@ -0,0 +1,40 @@
1
+ @function modular-scale($value, $increment, $ratio) {
2
+ @if $increment > 0 {
3
+ @for $i from 1 through $increment {
4
+ $value: ($value * $ratio);
5
+ }
6
+ }
7
+
8
+ @if $increment < 0 {
9
+ $increment: abs($increment);
10
+ @for $i from 1 through $increment {
11
+ $value: ($value / $ratio);
12
+ }
13
+ }
14
+
15
+ @return $value;
16
+ }
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
@@ -0,0 +1,62 @@
1
+ // This function is required and used by the background-image mixin.
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: 50% 50%,
8
+ $shape-size: ellipse cover,
9
+ $deprecated-pos1: center center,
10
+ $deprecated-pos2: center center,
11
+ $deprecated-radius1: 0,
12
+ $deprecated-radius2: 50,
13
+ $fallback: false) {
14
+
15
+ @each $value in $G1, $G2 {
16
+ $first-val: nth($value, 1);
17
+ $pos-type: type-of($first-val);
18
+
19
+ @if ($pos-type != color) or ($first-val != "transparent") {
20
+ @if ($pos-type == number)
21
+ or ($first-val == "center")
22
+ or ($first-val == "top")
23
+ or ($first-val == "right")
24
+ or ($first-val == "bottom")
25
+ or ($first-val == "left") {
26
+
27
+ $pos: $value;
28
+
29
+ @if $pos == $G1 {
30
+ $G1: false;
31
+ }
32
+ }
33
+
34
+ @else if
35
+ ($first-val == "ellipse")
36
+ or ($first-val == "circle")
37
+ or ($first-val == "closest-side")
38
+ or ($first-val == "closest-corner")
39
+ or ($first-val == "farthest-side")
40
+ or ($first-val == "farthest-corner")
41
+ or ($first-val == "contain")
42
+ or ($first-val == "cover") {
43
+
44
+ $shape-size: $value;
45
+
46
+ @if $value == $G1 {
47
+ $G1: false;
48
+ }
49
+
50
+ @else if $value == $G2 {
51
+ $G2: false;
52
+ }
53
+ }
54
+ }
55
+ }
56
+
57
+ $type: radial;
58
+ $gradient: compact($pos, $shape-size, $G1, $G2, $G3, $G4, $G5, $G6, $G7, $G8, $G9, $G10);
59
+ $type-gradient: append($type, $gradient, comma);
60
+
61
+ @return $type-gradient;
62
+ }
@@ -0,0 +1,14 @@
1
+ // User for linear and radial gradients within background-image or border-image properties
2
+
3
+ @function render-gradients($gradients, $gradient-type, $vendor: false) {
4
+ $vendor-gradients: false;
5
+ @if $vendor {
6
+ $vendor-gradients: -#{$vendor}-#{$gradient-type}-gradient($gradients);
7
+ }
8
+
9
+ @else if $vendor == false {
10
+ $vendor-gradients: "#{$gradient-type}-gradient(#{$gradients})";
11
+ $vendor-gradients: unquote($vendor-gradients);
12
+ }
13
+ @return $vendor-gradients;
14
+ }
@@ -0,0 +1,9 @@
1
+ // Add percentage of white to a color
2
+ @function tint($color, $percent){
3
+ @return mix(white, $color, $percent);
4
+ }
5
+
6
+ // Add percentage of black to a color
7
+ @function shade($color, $percent){
8
+ @return mix(black, $color, $percent);
9
+ }
@@ -0,0 +1,22 @@
1
+ // Return vendor-prefixed property names if appropriate
2
+ // Example: transition-property-names((transform, color, background), moz) -> -moz-transform, color, background
3
+ //************************************************************************//
4
+ @function transition-property-names($props, $vendor: false) {
5
+ $new-props: ();
6
+
7
+ @each $prop in $props {
8
+ $new-props: append($new-props, transition-property-name($prop, $vendor), comma);
9
+ }
10
+
11
+ @return $new-props;
12
+ }
13
+
14
+ @function transition-property-name($prop, $vendor: false) {
15
+ // put other properties that need to be prefixed here aswell
16
+ @if $vendor and $prop == transform {
17
+ @return unquote('-'+$vendor+'-'+$prop);
18
+ }
19
+ @else {
20
+ @return $prop;
21
+ }
22
+ }
@@ -0,0 +1,19 @@
1
+ require "bourbon/generator"
2
+
3
+ module Bourbon
4
+ if defined?(Rails) && defined?(Rails::Engine)
5
+ class Engine < ::Rails::Engine
6
+ require 'bourbon/engine'
7
+ end
8
+
9
+ module Rails
10
+ class Railtie < ::Rails::Railtie
11
+ rake_tasks do
12
+ load "tasks/install.rake"
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
18
+
19
+ require File.join(File.dirname(__FILE__), "/bourbon/sass_extensions")
@@ -0,0 +1,6 @@
1
+ module Bourbon::SassExtensions
2
+ end
3
+
4
+ require "sass"
5
+
6
+ require File.join(File.dirname(__FILE__), "/sass_extensions/functions")
@@ -0,0 +1,13 @@
1
+ module Bourbon::SassExtensions::Functions
2
+ end
3
+
4
+ require File.join(File.dirname(__FILE__), "/functions/compact")
5
+
6
+ module Sass::Script::Functions
7
+ include Bourbon::SassExtensions::Functions::Compact
8
+ end
9
+
10
+ # Wierd that this has to be re-included to pick up sub-modules. Ruby bug?
11
+ class Sass::Script::Functions::EvaluationContext
12
+ include Sass::Script::Functions
13
+ end
@@ -0,0 +1,14 @@
1
+ # Compact function pulled from compass
2
+ module Bourbon::SassExtensions::Functions::Compact
3
+
4
+ def compact(*args)
5
+ sep = :comma
6
+ if args.size == 1 && args.first.is_a?(Sass::Script::List)
7
+ list = args.first
8
+ args = list.value
9
+ sep = list.separator
10
+ end
11
+ Sass::Script::List.new(args.reject{|a| !a.to_bool}, sep)
12
+ end
13
+
14
+ end
metadata ADDED
@@ -0,0 +1,118 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bourbon-compass
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.1.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Jed Foster
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-06-29 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: compass
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0.11'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0.11'
30
+ - !ruby/object:Gem::Dependency
31
+ name: sass
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '3.1'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '3.1'
46
+ description: ThoughtBot's Bourbon packaged as Compass extension.
47
+ email: jed@jedfoster.com
48
+ executables: []
49
+ extensions: []
50
+ extra_rdoc_files: []
51
+ files:
52
+ - readme.md
53
+ - lib/bourbon-compass.rb
54
+ - stylesheets/bourbon/_bourbon.scss
55
+ - stylesheets/bourbon/addons/_button.scss
56
+ - stylesheets/bourbon/addons/_clearfix.scss
57
+ - stylesheets/bourbon/addons/_font-face.scss
58
+ - stylesheets/bourbon/addons/_font-family.scss
59
+ - stylesheets/bourbon/addons/_hide-text.scss
60
+ - stylesheets/bourbon/addons/_html5-input-types.scss
61
+ - stylesheets/bourbon/addons/_position.scss
62
+ - stylesheets/bourbon/addons/_timing-functions.scss
63
+ - stylesheets/bourbon/css3/_animation.scss
64
+ - stylesheets/bourbon/css3/_appearance.scss
65
+ - stylesheets/bourbon/css3/_background-image.scss
66
+ - stylesheets/bourbon/css3/_background-size.scss
67
+ - stylesheets/bourbon/css3/_background.scss
68
+ - stylesheets/bourbon/css3/_border-image.scss
69
+ - stylesheets/bourbon/css3/_border-radius.scss
70
+ - stylesheets/bourbon/css3/_box-shadow.scss
71
+ - stylesheets/bourbon/css3/_box-sizing.scss
72
+ - stylesheets/bourbon/css3/_columns.scss
73
+ - stylesheets/bourbon/css3/_flex-box.scss
74
+ - stylesheets/bourbon/css3/_inline-block.scss
75
+ - stylesheets/bourbon/css3/_linear-gradient.scss
76
+ - stylesheets/bourbon/css3/_prefixer.scss
77
+ - stylesheets/bourbon/css3/_radial-gradient.scss
78
+ - stylesheets/bourbon/css3/_transform.scss
79
+ - stylesheets/bourbon/css3/_transition.scss
80
+ - stylesheets/bourbon/css3/_user-select.scss
81
+ - stylesheets/bourbon/functions/_deprecated-webkit-gradient.scss
82
+ - stylesheets/bourbon/functions/_flex-grid.scss
83
+ - stylesheets/bourbon/functions/_grid-width.scss
84
+ - stylesheets/bourbon/functions/_linear-gradient.scss
85
+ - stylesheets/bourbon/functions/_modular-scale.scss
86
+ - stylesheets/bourbon/functions/_radial-gradient.scss
87
+ - stylesheets/bourbon/functions/_render-gradients.scss
88
+ - stylesheets/bourbon/functions/_tint-shade.scss
89
+ - stylesheets/bourbon/functions/_transition-property-name.scss
90
+ - stylesheets/bourbon/lib/bourbon/sass_extensions/functions/compact.rb
91
+ - stylesheets/bourbon/lib/bourbon/sass_extensions/functions.rb
92
+ - stylesheets/bourbon/lib/bourbon/sass_extensions.rb
93
+ - stylesheets/bourbon/lib/bourbon.rb
94
+ homepage: https://github.com/thoughtbot/bourbon
95
+ licenses: []
96
+ post_install_message:
97
+ rdoc_options: []
98
+ require_paths:
99
+ - lib
100
+ required_ruby_version: !ruby/object:Gem::Requirement
101
+ none: false
102
+ requirements:
103
+ - - ! '>='
104
+ - !ruby/object:Gem::Version
105
+ version: '0'
106
+ required_rubygems_version: !ruby/object:Gem::Requirement
107
+ none: false
108
+ requirements:
109
+ - - ! '>='
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ requirements: []
113
+ rubyforge_project:
114
+ rubygems_version: 1.8.23
115
+ signing_key:
116
+ specification_version: 3
117
+ summary: ThoughtBot's Bourbon packaged as Compass extension.
118
+ test_files: []