Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge and fix conflicts

  • Loading branch information...
commit e88945ad8a3f7f40c04319ee4b7214e7bed0e2f7 2 parents a3df864 + 7a359c2
Phil LaPier authored
View
6 Gemfile.lock
@@ -1,8 +1,8 @@
PATH
remote: .
specs:
- bourbon (2.1.2)
- sass (>= 3.2)
+ bourbon (2.2.0)
+ sass (>= 3.2.1)
thor
GEM
@@ -36,7 +36,7 @@ GEM
rspec-expectations (2.8.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.8.0)
- sass (3.2.2)
+ sass (3.2.3)
term-ansicolor (1.0.7)
thor (0.16.0)
View
1  app/assets/stylesheets/_bourbon.scss
@@ -1,4 +1,5 @@
// Custom Functions
+@import "functions/compact";
@import "functions/deprecated-webkit-gradient";
@import "functions/flex-grid";
@import "functions/grid-width";
View
119 app/assets/stylesheets/css3/_animation.scss
@@ -2,124 +2,51 @@
// Each of these mixins support comma separated lists of values, which allows different transitions for individual properties to be described in a single style rule. Each value in the list corresponds to the value at that same position in the other properties.
// Official animation shorthand property.
-@mixin animation ($animation-1,
- $animation-2: false, $animation-3: false,
- $animation-4: false, $animation-5: false,
- $animation-6: false, $animation-7: false,
- $animation-8: false, $animation-9: false)
- {
- $full: compact($animation-1, $animation-2, $animation-3, $animation-4,
- $animation-5, $animation-6, $animation-7, $animation-8, $animation-9);
-
- @include prefixer(animation, $full, webkit moz spec);
+@mixin animation ($animations...) {
+ @include prefixer(animation, $animations, webkit moz spec);
}
// Individual Animation Properties
-@mixin animation-name ($name-1,
- $name-2: false, $name-3: false,
- $name-4: false, $name-5: false,
- $name-6: false, $name-7: false,
- $name-8: false, $name-9: false)
- {
- $full: compact($name-1, $name-2, $name-3, $name-4,
- $name-5, $name-6, $name-7, $name-8, $name-9);
-
- @include prefixer(animation-name, $full, webkit moz spec);
+@mixin animation-name ($names...) {
+ @include prefixer(animation-name, $names, webkit moz spec);
}
-@mixin animation-duration ($time-1: 0,
- $time-2: false, $time-3: false,
- $time-4: false, $time-5: false,
- $time-6: false, $time-7: false,
- $time-8: false, $time-9: false)
- {
- $full: compact($time-1, $time-2, $time-3, $time-4,
- $time-5, $time-6, $time-7, $time-8, $time-9);
-
- @include prefixer(animation-duration, $full, webkit moz spec);
+@mixin animation-duration ($times...) {
+ @include prefixer(animation-duration, $times, webkit moz spec);
}
-@mixin animation-timing-function ($motion-1: ease,
-// ease | linear | ease-in | ease-out | ease-in-out
- $motion-2: false, $motion-3: false,
- $motion-4: false, $motion-5: false,
- $motion-6: false, $motion-7: false,
- $motion-8: false, $motion-9: false)
- {
- $full: compact($motion-1, $motion-2, $motion-3, $motion-4,
- $motion-5, $motion-6, $motion-7, $motion-8, $motion-9);
-
- @include prefixer(animation-timing-function, $full, webkit moz spec);
+@mixin animation-timing-function ($motions...) {
+// ease | linear | ease-in | ease-out | ease-in-out
+ @include prefixer(animation-timing-function, $motions, webkit moz spec);
}
-@mixin animation-iteration-count ($value-1: 1,
-// infinite | <number>
- $value-2: false, $value-3: false,
- $value-4: false, $value-5: false,
- $value-6: false, $value-7: false,
- $value-8: false, $value-9: false)
- {
- $full: compact($value-1, $value-2, $value-3, $value-4,
- $value-5, $value-6, $value-7, $value-8, $value-9);
-
- @include prefixer(animation-iteration-count, $full, webkit moz spec);
+@mixin animation-iteration-count ($values...) {
+// infinite | <number>
+ @include prefixer(animation-iteration-count, $values, webkit moz spec);
}
-@mixin animation-direction ($direction-1: normal,
-// normal | alternate
- $direction-2: false, $direction-3: false,
- $direction-4: false, $direction-5: false,
- $direction-6: false, $direction-7: false,
- $direction-8: false, $direction-9: false)
- {
- $full: compact($direction-1, $direction-2, $direction-3, $direction-4,
- $direction-5, $direction-6, $direction-7, $direction-8, $direction-9);
-
- @include prefixer(animation-direction, $full, webkit moz spec);
+@mixin animation-direction ($directions...) {
+// normal | alternate
+ @include prefixer(animation-direction, $directions, webkit moz spec);
}
-@mixin animation-play-state ($state-1: running,
-// running | paused
- $state-2: false, $state-3: false,
- $state-4: false, $state-5: false,
- $state-6: false, $state-7: false,
- $state-8: false, $state-9: false)
- {
- $full: compact($state-1, $state-2, $state-3, $state-4,
- $state-5, $state-6, $state-7, $state-8, $state-9);
-
- @include prefixer(animation-play-state, $full, webkit moz spec);
+@mixin animation-play-state ($states...) {
+// running | paused
+ @include prefixer(animation-play-state, $states, webkit moz spec);
}
-@mixin animation-delay ($time-1: 0,
- $time-2: false, $time-3: false,
- $time-4: false, $time-5: false,
- $time-6: false, $time-7: false,
- $time-8: false, $time-9: false)
- {
- $full: compact($time-1, $time-2, $time-3, $time-4,
- $time-5, $time-6, $time-7, $time-8, $time-9);
-
- @include prefixer(animation-delay, $full, webkit moz spec);
+@mixin animation-delay ($times...) {
+ @include prefixer(animation-delay, $times, webkit moz spec);
}
-@mixin animation-fill-mode ($mode-1: none,
-// http://goo.gl/l6ckm
-// none | forwards | backwards | both
- $mode-2: false, $mode-3: false,
- $mode-4: false, $mode-5: false,
- $mode-6: false, $mode-7: false,
- $mode-8: false, $mode-9: false)
- {
- $full: compact($mode-1, $mode-2, $mode-3, $mode-4,
- $mode-5, $mode-6, $mode-7, $mode-8, $mode-9);
-
- @include prefixer(animation-fill-mode, $full, webkit moz spec);
+@mixin animation-fill-mode ($modes...) {
+// none | forwards | backwards | both
+ @include prefixer(animation-fill-mode, $modes, webkit moz spec);
}
View
17 app/assets/stylesheets/css3/_background-image.scss
@@ -3,19 +3,7 @@
// gradients, or for stringing multiple gradients together.
//************************************************************************//
-@mixin background-image(
- $image-1 , $image-2: false,
- $image-3: false, $image-4: false,
- $image-5: false, $image-6: false,
- $image-7: false, $image-8: false,
- $image-9: false, $image-10: false
-) {
- $images: compact($image-1, $image-2,
- $image-3, $image-4,
- $image-5, $image-6,
- $image-7, $image-8,
- $image-9, $image-10);
-
+@mixin background-image($images...) {
background-image: add-prefix($images, webkit);
background-image: add-prefix($images, moz);
background-image: add-prefix($images, ms);
@@ -48,10 +36,9 @@
}
-
//Examples:
//@include background-image(linear-gradient(top, orange, red));
//@include background-image(radial-gradient(50% 50%, cover circle, orange, red));
//@include background-image(url("/images/a.png"), linear-gradient(orange, red));
//@include background-image(url("image.png"), linear-gradient(orange, red), url("image.png"));
- //@include background-image(linear-gradient(hsla(0, 100%, 100%, 0.25) 0%, hsla(0, 100%, 100%, 0.08) 50%, transparent 50%), linear-gradient(orange, red);
+ //@include background-image(linear-gradient(hsla(0, 100%, 100%, 0.25) 0%, hsla(0, 100%, 100%, 0.08) 50%, transparent 50%), linear-gradient(orange, red));
View
12 app/assets/stylesheets/css3/_background-size.scss
@@ -1,11 +1,3 @@
-@mixin background-size ($length-1,
- $length-2: false, $length-3: false,
- $length-4: false, $length-5: false,
- $length-6: false, $length-7: false,
- $length-8: false, $length-9: false)
- {
- $full: compact($length-1, $length-2, $length-3, $length-4,
- $length-5, $length-6, $length-7, $length-8, $length-9);
-
-@include prefixer(background-size, $full, webkit moz ms o spec);
+@mixin background-size ($lengths...) {
+ @include prefixer(background-size, $lengths, webkit moz ms o spec);
}
View
13 app/assets/stylesheets/css3/_box-shadow.scss
@@ -1,12 +1,3 @@
-// Box-Shadow Mixin Requires Sass v3.1.1+
-@mixin box-shadow ($shadow-1,
- $shadow-2: false, $shadow-3: false,
- $shadow-4: false, $shadow-5: false,
- $shadow-6: false, $shadow-7: false,
- $shadow-8: false, $shadow-9: false)
- {
- $full: compact($shadow-1, $shadow-2, $shadow-3, $shadow-4,
- $shadow-5, $shadow-6, $shadow-7, $shadow-8, $shadow-9);
-
- @include prefixer(box-shadow, $full, webkit spec);
+@mixin box-shadow ($shadows...) {
+ @include prefixer(box-shadow, $shadows, webkit spec);
}
View
4 app/assets/stylesheets/css3/_radial-gradient.scss
@@ -56,7 +56,9 @@
$full: compact($G1, $G2, $G3, $G4, $G5, $G6, $G7, $G8, $G9, $G10);
- $fallback-color: nth($G1, 1);
+ // Set $G1 as the default fallback color
+ $first-color: nth($full, 1);
+ $fallback-color: nth($first-color, 1);
@if (type-of($fallback) == color) or ($fallback == "transparent") {
$fallback-color: $fallback;
View
78 app/assets/stylesheets/css3/_transition.scss
@@ -3,70 +3,34 @@
// @include transition ((opacity, width), (1.0s, 2.0s), ease-in, (0, 2s));
// @include transition ($property:(opacity, width), $delay: (1.5s, 2.5s));
-@mixin transition ($prop-1: all 0.15s ease-out 0,
- $prop-2: false, $prop-3: false,
- $prop-4: false, $prop-5: false,
- $prop-6: false, $prop-7: false,
- $prop-8: false, $prop-9: false)
- {
- $full: compact($prop-1, $prop-2, $prop-3, $prop-4, $prop-5,
- $prop-6, $prop-7, $prop-8, $prop-9);
-
- @include prefixer(transition, $full, webkit moz ms o spec);
+@mixin transition ($properties...) {
+ @if length($properties) >= 1 {
+ @include prefixer(transition, $properties, webkit moz ms o spec);
+ }
+
+ @else {
+ $properties: all 0.15s ease-out 0;
+ @include prefixer(transition, $properties, webkit moz ms o spec);
+ }
}
-
-
-@mixin transition-property ($prop-1: all,
- $prop-2: false, $prop-3: false,
- $prop-4: false, $prop-5: false,
- $prop-6: false, $prop-7: false,
- $prop-8: false, $prop-9: false)
- {
- $full: compact($prop-1, $prop-2, $prop-3, $prop-4, $prop-5,
- $prop-6, $prop-7, $prop-8, $prop-9);
-
- -webkit-transition-property: transition-property-names($full, 'webkit');
- -moz-transition-property: transition-property-names($full, 'moz');
- -ms-transition-property: transition-property-names($full, 'ms');
- -o-transition-property: transition-property-names($full, 'o');
- transition-property: transition-property-names($full, false);
+@mixin transition-property ($properties...) {
+ -webkit-transition-property: transition-property-names($properties, 'webkit');
+ -moz-transition-property: transition-property-names($properties, 'moz');
+ -ms-transition-property: transition-property-names($properties, 'ms');
+ -o-transition-property: transition-property-names($properties, 'o');
+ transition-property: transition-property-names($properties, false);
}
-@mixin transition-duration ($time-1: 0,
- $time-2: false, $time-3: false,
- $time-4: false, $time-5: false,
- $time-6: false, $time-7: false,
- $time-8: false, $time-9: false)
- {
- $full: compact($time-1, $time-2, $time-3, $time-4, $time-5,
- $time-6, $time-7, $time-8, $time-9);
-
- @include prefixer(transition-duration, $full, webkit moz ms o spec);
+@mixin transition-duration ($times...) {
+ @include prefixer(transition-duration, $times, webkit moz ms o spec);
}
-@mixin transition-timing-function ($motion-1: ease,
- $motion-2: false, $motion-3: false,
- $motion-4: false, $motion-5: false,
- $motion-6: false, $motion-7: false,
- $motion-8: false, $motion-9: false)
- {
- $full: compact($motion-1, $motion-2, $motion-3, $motion-4, $motion-5,
- $motion-6, $motion-7, $motion-8, $motion-9);
-
+@mixin transition-timing-function ($motions...) {
// ease | linear | ease-in | ease-out | ease-in-out | cubic-bezier()
- @include prefixer(transition-timing-function, $full, webkit moz ms o spec);
+ @include prefixer(transition-timing-function, $motions, webkit moz ms o spec);
}
-@mixin transition-delay ($time-1: 0,
- $time-2: false, $time-3: false,
- $time-4: false, $time-5: false,
- $time-6: false, $time-7: false,
- $time-8: false, $time-9: false)
- {
- $full: compact($time-1, $time-2, $time-3, $time-4, $time-5,
- $time-6, $time-7, $time-8, $time-9);
-
- @include prefixer(transition-delay, $full, webkit moz ms o spec);
+@mixin transition-delay ($times...) {
+ @include prefixer(transition-delay, $times, webkit moz ms o spec);
}
-
View
17 app/assets/stylesheets/functions/_compact.scss
@@ -0,0 +1,17 @@
+// functions/_compact.scss
+
+/**
+ * Sass implementation of `compact` function from the bourbon.rb library
+ */
+@function compact($var-1, $var-2: false, $var-3: false, $var-4: false, $var-5: false, $var-6: false, $var-7: false, $var-8: false, $var-9: false, $var-10: false, $var-11: false, $var-12: false,$var-13: false, $var-14: false, $var-15: false, $var-16: false) {
+ $list: ();
+ $vars: $var-1, $var-2, $var-3, $var-4, $var-5, $var-6, $var-7, $var-8, $var-9, $var-10, $var-11, $var-12, $var-13, $var-14, $var-15;
+
+ @each $var in $vars {
+ @if $var {
+ $list: append($list, $var, comma);
+ }
+ }
+
+ @return $list;
+}
View
2  app/assets/stylesheets/functions/_deprecated-webkit-gradient.scss
@@ -18,7 +18,7 @@
$gradient-list: join($gradient-list, $color-stop, comma);
}
- @else {
+ @else if $gradient != null {
@if $i == $full-length {
$percentage: 100%;
}
View
21 app/assets/stylesheets/functions/_linear-gradient.scss
@@ -1,23 +1,6 @@
-@function linear-gradient($pos: top, $G1: false, $G2: false,
- $G3: false, $G4: false,
- $G5: false, $G6: false,
- $G7: false, $G8: false,
- $G9: false, $G10: false) {
-
- // Detect what type of value exists in $pos
- $pos-type: type-of(nth($pos, 1));
-
- // If $pos is missing from mixin, reassign vars and add default position
- @if ($pos-type == color) or (nth($pos, 1) == "transparent") {
- $G10: $G9; $G9: $G8; $G8: $G7; $G7: $G6; $G6: $G5;
- $G5: $G4; $G4: $G3; $G3: $G2; $G2: $G1; $G1: $pos;
- $pos: top; // Default position
- }
-
+@function linear-gradient($gradients...) {
$type: linear;
- $gradient: compact($pos, $G1, $G2, $G3, $G4, $G5, $G6, $G7, $G8, $G9, $G10);
- $type-gradient: append($type, $gradient, comma);
+ $type-gradient: append($type, $gradients, comma);
@return $type-gradient;
}
-
View
2  bourbon.gemspec
@@ -26,7 +26,7 @@ that support only CSS3 prefixed properties.
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
- s.add_dependency('sass', '>= 3.2')
+ s.add_dependency('sass', '>= 3.2.1')
s.add_dependency('thor')
s.add_development_dependency('aruba', '~> 0.4')
View
4 features/install.feature
@@ -6,9 +6,7 @@ Feature: Install bourbon files
Then the sass directories should have been generated
And the following directories should exist:
| bourbon |
- | bourbon/lib |
And the master bourbon partial should have been generated
- And the lib files should have been generated
And the output should contain "Bourbon files installed to bourbon/"
Scenario: Generating does not overwrite an existing bourbon directory
@@ -21,9 +19,7 @@ Feature: Install bourbon files
Then the sass directories with "custom_path" prefix should have been generated
And the following directories should exist:
| custom_path/bourbon |
- | custom_path/bourbon/lib |
And the master bourbon partial should have been generated within "custom_path" directory
- And the lib files should have been generated within "custom_path" directory
And the output should contain "Bourbon files installed to custom_path/bourbon/"
Scenario: Forcing install of bourbon
View
7 features/step_definitions/bourbon_steps.rb
@@ -15,13 +15,6 @@
check_file_presence([bourbon_path(prefix, '_bourbon.scss')], true)
end
-Then /^the lib files should have been generated(?: within "([^"]+)" directory)?$/ do |prefix|
- check_file_presence([bourbon_path(prefix, 'lib/bourbon.rb')], true)
- check_directory_presence([bourbon_path(prefix, 'lib/bourbon')], true)
- check_file_presence([bourbon_path(prefix, 'lib/bourbon/sass_extensions.rb')], true)
- check_directory_presence([bourbon_path(prefix, 'lib/bourbon/sass_extensions')], true)
-end
-
Then /^bourbon should not have been generated$/ do
check_directory_presence(['bourbon'], false)
end
View
4 lib/bourbon.rb
@@ -20,4 +20,6 @@ class Railtie < ::Rails::Railtie
end
end
-require File.join(File.dirname(__FILE__), "/bourbon/sass_extensions")
+unless defined?(Sass)
+ require 'sass'
+end
View
17 lib/bourbon/generator.rb
@@ -50,7 +50,6 @@ def install_path
def install_files
make_lib_directory
- copy_in_sass_extensions
copy_in_scss_files
end
@@ -59,13 +58,7 @@ def remove_bourbon_directory
end
def make_lib_directory
- FileUtils.mkdir_p(install_path.join('lib', 'bourbon'))
- end
-
- def copy_in_sass_extensions
- FileUtils.cp(File.join(lib_directory, 'bourbon.rb'), install_path.join('lib'))
- FileUtils.cp(File.join(lib_bourbon_directory, 'sass_extensions.rb'), install_path.join('lib', 'bourbon'))
- FileUtils.cp_r(File.join(lib_bourbon_directory, 'sass_extensions'), install_path.join('lib', 'bourbon'))
+ FileUtils.mkdir_p(install_path)
end
def copy_in_scss_files
@@ -80,14 +73,6 @@ def stylesheets_directory
File.join(top_level_directory, "app", "assets", "stylesheets")
end
- def lib_directory
- File.join(top_level_directory, "lib")
- end
-
- def lib_bourbon_directory
- File.join(top_level_directory, "lib", "bourbon")
- end
-
def top_level_directory
File.dirname(File.dirname(File.dirname(__FILE__)))
end
View
8 lib/bourbon/sass_extensions.rb
@@ -1,8 +0,0 @@
-module Bourbon::SassExtensions
-end
-
-unless defined?(Sass)
- require 'sass'
-end
-
-require File.join(File.dirname(__FILE__), '/sass_extensions/functions')
View
13 lib/bourbon/sass_extensions/functions.rb
@@ -1,13 +0,0 @@
-module Bourbon::SassExtensions::Functions
-end
-
-require File.join(File.dirname(__FILE__), "/functions/compact")
-
-module Sass::Script::Functions
- include Bourbon::SassExtensions::Functions::Compact
-end
-
-# Wierd that this has to be re-included to pick up sub-modules. Ruby bug?
-class Sass::Script::Functions::EvaluationContext
- include Sass::Script::Functions
-end
View
14 lib/bourbon/sass_extensions/functions/compact.rb
@@ -1,14 +0,0 @@
-# Compact function pulled from compass
-module Bourbon::SassExtensions::Functions::Compact
-
- def compact(*args)
- sep = :comma
- if args.size == 1 && args.first.is_a?(Sass::Script::List)
- list = args.first
- args = list.value
- sep = list.separator
- end
- Sass::Script::List.new(args.reject{|a| !a.to_bool}, sep)
- end
-
-end
Please sign in to comment.
Something went wrong with that request. Please try again.