bourbon 1.3.6 → 1.4.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.
@@ -1,7 +1,11 @@
1
1
  // Custom Functions
2
2
  @import "functions/deprecated-webkit-gradient";
3
+ @import "functions/flex-grid";
3
4
  @import "functions/grid-width";
5
+ @import "functions/linear-gradient";
4
6
  @import "functions/modular-scale";
7
+ @import "functions/radial-gradient";
8
+ @import "functions/render-gradients";
5
9
  @import "functions/tint-shade";
6
10
 
7
11
  // CSS3 Mixins
@@ -20,9 +24,11 @@
20
24
  @import "css3/radial-gradient";
21
25
  @import "css3/transform";
22
26
  @import "css3/transition";
27
+ @import "css3/user-select";
23
28
 
24
29
  // Addons & other mixins
25
30
  @import "addons/button";
31
+ @import "addons/clearfix";
26
32
  @import "addons/font-family";
27
33
  @import "addons/html5-input-types";
28
34
  @import "addons/position";
@@ -0,0 +1,29 @@
1
+ // Micro clearfix provides an easy way to contain floats without adding additional markup
2
+ //
3
+ // Example usage:
4
+ //
5
+ // // Contain all floats within .wrapper
6
+ // .wrapper {
7
+ // @include clearfix;
8
+ // .content,
9
+ // .sidebar {
10
+ // float : left;
11
+ // }
12
+ // }
13
+
14
+ @mixin clearfix {
15
+ zoom: 1;
16
+
17
+ &:before,
18
+ &:after {
19
+ content: "";
20
+ display: table;
21
+ }
22
+
23
+ &:after {
24
+ clear: both;
25
+ }
26
+ }
27
+
28
+ // Acknowledgements
29
+ // Micro clearfix: [Nicolas Gallagher](http://nicolasgallagher.com/micro-clearfix-hack/)
@@ -2,8 +2,6 @@
2
2
  // Background-image property for adding multiple background images with
3
3
  // gradients, or for stringing multiple gradients together.
4
4
  //************************************************************************//
5
- @import "../functions/linear-gradient";
6
- @import "../functions/radial-gradient";
7
5
 
8
6
  @mixin background-image(
9
7
  $image-1 , $image-2: false,
@@ -50,18 +48,6 @@
50
48
  }
51
49
 
52
50
 
53
- @function render-gradients($gradients, $gradient-type, $vendor: false) {
54
- $vendor-gradients: false;
55
- @if $vendor {
56
- $vendor-gradients: -#{$vendor}-#{$gradient-type}-gradient($gradients);
57
- }
58
-
59
- @else if $vendor == false {
60
- $vendor-gradients: "#{$gradient-type}-gradient(#{$gradients})";
61
- $vendor-gradients: unquote($vendor-gradients);
62
- }
63
- @return $vendor-gradients;
64
- }
65
51
 
66
52
  //Examples:
67
53
  //@include background-image(linear-gradient(top, orange, red));
@@ -1,7 +1,56 @@
1
- @mixin border-image ($image) {
2
- -webkit-border-image: $image;
3
- -moz-border-image: $image;
4
- -ms-border-image: $image;
5
- -o-border-image: $image;
6
- border-image: $image;
1
+ @mixin border-image($images) {
2
+ -webkit-border-image: border-add-prefix($images, webkit);
3
+ -moz-border-image: border-add-prefix($images, moz);
4
+ -o-border-image: border-add-prefix($images, o);
5
+ border-image: border-add-prefix($images);
7
6
  }
7
+
8
+ @function border-add-prefix($images, $vendor: false) {
9
+ $border-image: ();
10
+ $images-type: type-of(nth($images, 1));
11
+ $first-var: nth(nth($images, 1), 1); // Get type of Gradient (Linear || radial)
12
+
13
+ // If input is a gradient
14
+ @if $images-type == string {
15
+ @if ($first-var == "linear") or ($first-var == "radial") {
16
+ @for $i from 2 through length($images) {
17
+ $gradient-type: nth($images, 1); // Get type of gradient (linear || radial)
18
+ $gradient-args: nth($images, $i); // Get actual gradient (red, blue)
19
+ $border-image: render-gradients($gradient-args, $gradient-type, $vendor);
20
+ }
21
+ }
22
+
23
+ // If input is a URL
24
+ @else {
25
+ $border-image: $images;
26
+ }
27
+ }
28
+
29
+ // If input is gradient or url + additional args
30
+ @else if $images-type == list {
31
+ @for $i from 1 through length($images) {
32
+ $type: type-of(nth($images, $i)); // Get type of variable - List or String
33
+
34
+ // If variable is a list - Gradient
35
+ @if $type == list {
36
+ $gradient-type: nth(nth($images, $i), 1); // Get type of gradient (linear || radial)
37
+ $gradient-args: nth(nth($images, $i), 2); // Get actual gradient (red, blue)
38
+ $border-image: render-gradients($gradient-args, $gradient-type, $vendor);
39
+ }
40
+
41
+ // If variable is a string - Image or number
42
+ @else if ($type == string) or ($type == number) {
43
+ $border-image: append($border-image, nth($images, $i));
44
+ }
45
+ }
46
+ }
47
+ @return $border-image;
48
+ }
49
+
50
+ //Examples:
51
+ // @include border-image(url("image.png"));
52
+ // @include border-image(url("image.png") 20 stretch);
53
+ // @include border-image(linear-gradient(45deg, orange, yellow));
54
+ // @include border-image(linear-gradient(45deg, orange, yellow) stretch);
55
+ // @include border-image(linear-gradient(45deg, orange, yellow) 20 30 40 50 stretch round);
56
+ // @include border-image(radial-gradient(top, cover, orange, yellow, orange));
@@ -9,6 +9,7 @@
9
9
  @mixin border-top-left-radius($radii) {
10
10
  -webkit-border-top-left-radius: $radii;
11
11
  -moz-border-top-left-radius: $radii;
12
+ -moz-border-radius-topleft: $radii;
12
13
  -ms-border-top-left-radius: $radii;
13
14
  -o-border-top-left-radius: $radii;
14
15
  border-top-left-radius: $radii;
@@ -17,6 +18,7 @@
17
18
  @mixin border-top-right-radius($radii) {
18
19
  -webkit-border-top-right-radius: $radii;
19
20
  -moz-border-top-right-radius: $radii;
21
+ -moz-border-radius-topright: $radii;
20
22
  -ms-border-top-right-radius: $radii;
21
23
  -o-border-top-right-radius: $radii;
22
24
  border-top-right-radius: $radii;
@@ -25,6 +27,7 @@
25
27
  @mixin border-bottom-left-radius($radii) {
26
28
  -webkit-border-bottom-left-radius: $radii;
27
29
  -moz-border-bottom-left-radius: $radii;
30
+ -moz-border-radius-bottomleft: $radii;
28
31
  -ms-border-bottom-left-radius: $radii;
29
32
  -o-border-bottom-left-radius: $radii;
30
33
  border-bottom-left-radius: $radii;
@@ -33,6 +36,7 @@
33
36
  @mixin border-bottom-right-radius($radii) {
34
37
  -webkit-border-bottom-right-radius: $radii;
35
38
  -moz-border-bottom-right-radius: $radii;
39
+ -moz-border-radius-bottomright: $radii;
36
40
  -ms-border-bottom-right-radius: $radii;
37
41
  -o-border-bottom-right-radius: $radii;
38
42
  border-bottom-right-radius: $radii;
@@ -10,7 +10,5 @@
10
10
 
11
11
  -webkit-box-shadow: $full;
12
12
  -moz-box-shadow: $full;
13
- -ms-box-shadow: $full;
14
- -o-box-shadow: $full;
15
13
  box-shadow: $full;
16
14
  }
@@ -2,7 +2,5 @@
2
2
  // content-box | border-box | inherit
3
3
  -webkit-box-sizing: $box;
4
4
  -moz-box-sizing: $box;
5
- -ms-box-sizing: $box;
6
- -o-box-sizing: $box;
7
5
  box-sizing: $box;
8
6
  }
@@ -20,7 +20,7 @@
20
20
  $fallback-color: nth($G1, 1);
21
21
 
22
22
  // If $fallback is a color use that color as the fallback color
23
- @if type-of($fallback) == color {
23
+ @if (type-of($fallback) == color) or ($fallback == "transparent") {
24
24
  $fallback-color: $fallback;
25
25
  }
26
26
 
@@ -4,11 +4,20 @@
4
4
  $G3: false, $G4: false,
5
5
  $G5: false, $G6: false,
6
6
  $G7: false, $G8: false,
7
- $G9: false, $G10: false) {
7
+ $G9: false, $G10: false,
8
+ $fallback: false) {
8
9
 
9
10
  $full: compact($G1, $G2, $G3, $G4, $G5, $G6, $G7, $G8, $G9, $G10);
10
11
 
11
- background-color: nth($G1, 1);
12
+ // Set $G1 as the default fallback color
13
+ $fallback-color: nth($G1, 1);
14
+
15
+ // If $fallback is a color use that color as the fallback color
16
+ @if (type-of($fallback) == color) or ($fallback == "transparent") {
17
+ $fallback-color: $fallback;
18
+ }
19
+
20
+ background-color: $fallback-color;
12
21
  background-image: deprecated-webkit-gradient(radial, $full); // Safari <= 5.0
13
22
  background-image: -webkit-radial-gradient($pos, $shape-size, $full);
14
23
  background-image: -moz-radial-gradient($pos, $shape-size, $full);
@@ -0,0 +1,6 @@
1
+ @mixin user-select($arg: none) {
2
+ -webkit-user-select: $arg;
3
+ -moz-user-select: $arg;
4
+ -ms-user-select: $arg;
5
+ user-select: $arg;
6
+ }
@@ -0,0 +1,35 @@
1
+ // Flexible grid
2
+ @function flex-grid($columns, $container-columns: $fg-max-columns) {
3
+ $width: $columns * $fg-column + ($columns - 1) * $fg-gutter;
4
+ $container-width: $container-columns * $fg-column + ($container-columns - 1) * $fg-gutter;
5
+ @return percentage($width / $container-width);
6
+ }
7
+
8
+ // Flexible gutter
9
+ @function flex-gutter($container-columns: $fg-max-columns, $gutter: $fg-gutter) {
10
+ $container-width: $container-columns * $fg-column + ($container-columns - 1) * $fg-gutter;
11
+ @return percentage($gutter / $container-width);
12
+ }
13
+
14
+ // The $fg-column, $fg-gutter and $fg-max-columns variables must be defined in your base stylesheet to properly use the flex-grid function.
15
+ // This function takes the fluid grid equation (target / context = result) and uses columns to help define each.
16
+ //
17
+ // $fg-column: 60px; // Column Width
18
+ // $fg-gutter: 25px; // Gutter Width
19
+ // $fg-max-columns: 12; // Total Columns For Main Container
20
+ //
21
+ // div {
22
+ // width: flex-grid(4); // returns (315px / 1020px) = 30.882353%;
23
+ // margin-left: flex-gutter(); // returns (25px / 1020px) = 2.45098%;
24
+ //
25
+ // p {
26
+ // width: flex-grid(2, 4); // returns (145px / 315px) = 46.031746%;
27
+ // float: left;
28
+ // margin: flex-gutter(4); // returns (25px / 315px) = 7.936508%;
29
+ // }
30
+ //
31
+ // blockquote {
32
+ // float: left;
33
+ // width: flex-grid(2, 4); // returns (145px / 315px) = 46.031746%;
34
+ // }
35
+ // }
@@ -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
+ }
@@ -36,7 +36,7 @@ module Bourbon
36
36
  private
37
37
 
38
38
  def bourbon_files_already_exist?
39
- Dir.exist?("bourbon")
39
+ File.directory?("bourbon")
40
40
  end
41
41
 
42
42
  def install_files
@@ -1,3 +1,3 @@
1
1
  module Bourbon
2
- VERSION = "1.3.6"
2
+ VERSION = "1.4.0"
3
3
  end
data/readme.md CHANGED
@@ -179,6 +179,7 @@ Bourbon aims to provide support for CSS3 properties that are not yet fully suppo
179
179
  #Addons
180
180
  --------------------------------
181
181
  @ button(*args)
182
+ @ clearfix
182
183
  @ position(*args)
183
184
 
184
185
  #{$all-text-inputs}
@@ -197,6 +198,7 @@ Bourbon aims to provide support for CSS3 properties that are not yet fully suppo
197
198
  * = quad, cubic, quart, quint, sine, expo, circ, back
198
199
 
199
200
 
201
+
200
202
  ## Help Out
201
203
 
202
204
  Currently the project is a work in progress. Feel free to help out.
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: 1.3.6
4
+ version: 1.4.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -19,11 +19,11 @@ authors:
19
19
  autorequire:
20
20
  bindir: bin
21
21
  cert_chain: []
22
- date: 2012-01-27 00:00:00.000000000 Z
22
+ date: 2012-02-20 00:00:00.000000000 Z
23
23
  dependencies:
24
24
  - !ruby/object:Gem::Dependency
25
25
  name: sass
26
- requirement: &70251317326880 !ruby/object:Gem::Requirement
26
+ requirement: &70233260471540 !ruby/object:Gem::Requirement
27
27
  none: false
28
28
  requirements:
29
29
  - - ! '>='
@@ -31,10 +31,10 @@ dependencies:
31
31
  version: '3.1'
32
32
  type: :runtime
33
33
  prerelease: false
34
- version_requirements: *70251317326880
34
+ version_requirements: *70233260471540
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: aruba
37
- requirement: &70251317326340 !ruby/object:Gem::Requirement
37
+ requirement: &70233260470160 !ruby/object:Gem::Requirement
38
38
  none: false
39
39
  requirements:
40
40
  - - ~>
@@ -42,7 +42,7 @@ dependencies:
42
42
  version: '0.4'
43
43
  type: :development
44
44
  prerelease: false
45
- version_requirements: *70251317326340
45
+ version_requirements: *70233260470160
46
46
  description: ! 'The purpose of Bourbon Vanilla Sass Mixins is to provide a comprehensive
47
47
  framework of
48
48
 
@@ -71,6 +71,7 @@ files:
71
71
  - Rakefile
72
72
  - app/assets/stylesheets/_bourbon.scss
73
73
  - app/assets/stylesheets/addons/_button.scss
74
+ - app/assets/stylesheets/addons/_clearfix.scss
74
75
  - app/assets/stylesheets/addons/_font-family.scss
75
76
  - app/assets/stylesheets/addons/_html5-input-types.scss
76
77
  - app/assets/stylesheets/addons/_position.scss
@@ -90,11 +91,14 @@ files:
90
91
  - app/assets/stylesheets/css3/_radial-gradient.scss
91
92
  - app/assets/stylesheets/css3/_transform.scss
92
93
  - app/assets/stylesheets/css3/_transition.scss
94
+ - app/assets/stylesheets/css3/_user-select.scss
93
95
  - app/assets/stylesheets/functions/_deprecated-webkit-gradient.scss
96
+ - app/assets/stylesheets/functions/_flex-grid.scss
94
97
  - app/assets/stylesheets/functions/_grid-width.scss
95
98
  - app/assets/stylesheets/functions/_linear-gradient.scss
96
99
  - app/assets/stylesheets/functions/_modular-scale.scss
97
100
  - app/assets/stylesheets/functions/_radial-gradient.scss
101
+ - app/assets/stylesheets/functions/_render-gradients.scss
98
102
  - app/assets/stylesheets/functions/_tint-shade.scss
99
103
  - bin/bourbon
100
104
  - bourbon.gemspec