From 4ad0e5f06a025969159a51f5f882aaca14837087 Mon Sep 17 00:00:00 2001 From: Scott Kellum Date: Wed, 22 Oct 2014 15:05:55 -0400 Subject: [PATCH 01/12] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2ab41af..27ef9af 100644 --- a/README.md +++ b/README.md @@ -298,7 +298,7 @@ This is easy with fixed widths because then we can just make the child the width The concept of the parallax effect is simple, things closer to the viewer move faster while things further away move slower. Leveraging 3D transforms, this effect can be implemented without any JavaScript. You need to initialize your parallax container before being able to parallax an item. By default iOS parallax is on but setting it to false will turn on smooth scrolling within that element and no parallax effect will be shown. -The parallax mixin puts elements into real perspective and scales them back down to 100% so images and text will not have any distortion. Items will shift both vertically and horizontally in layouts to achieve the appropriate perspective. With `init`, if `$element: this`, the current element will be initialized; if `$element: '.class'|'#id'`, the respective element will be placed at the root of the stylesheet (not nested under the current selector). `ini` can be called from the root of your stylesheet. +The parallax mixin puts elements into real perspective and scales them back down to 100% so images and text will not have any distortion. Items will shift both vertically and horizontally in layouts to achieve the appropriate perspective. With `@include init()`, if `$element: this`, the current element will be initialized; if `$element: '.class'|'#id'`, the respective element will be placed at the root of the stylesheet (not nested under the current selector). `@include init()` can be called from the root of your stylesheet. #### @include parallax-init([$perspective, $element, $parallax-ios]) From a68eb6bbc73043ec36e00f36006c87a2c6eca4f3 Mon Sep 17 00:00:00 2001 From: Scott Kellum Date: Thu, 23 Oct 2014 17:39:15 -0400 Subject: [PATCH 02/12] Update LICENSE.txt --- LICENSE.txt | 6 ------ 1 file changed, 6 deletions(-) diff --git a/LICENSE.txt b/LICENSE.txt index 4f9c7ef..3b54ec7 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,9 +1,3 @@ -Toolkit is dual licensed under the MIT and GPL licenses: - -GPL license: http://www.gnu.org/licenses/gpl.html - -MIT license: http://www.opensource.org/licenses/mit-license.php - Toolkit License: Copyright (C) 2011-2014 by Sam Richard From 587317edcf2275e4ade7cc811baf602b4cb43f20 Mon Sep 17 00:00:00 2001 From: Scott Kellum Date: Thu, 23 Oct 2014 17:39:45 -0400 Subject: [PATCH 03/12] Update README.md --- README.md | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 27ef9af..2b8f3b0 100644 --- a/README.md +++ b/README.md @@ -513,6 +513,22 @@ Creates specially formatted comments for use with [gulp-css-target](https://gith ## License -(c) Sam Richard, Scott Kellum 2012-2014 - -Toolkit is dual licensed under the [MIT](http://www.opensource.org/licenses/mit-license.php) and [GPL](http://www.gnu.org/licenses/gpl.html) Licenses. +Copyright (C) 2011-2014 by Sam Richard + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. From 5351f5691635089660ad8c1925bfef92794fd8fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20Sandstr=C3=B6m?= Date: Wed, 12 Nov 2014 11:06:21 +0100 Subject: [PATCH 04/12] Update README.md Small typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2b8f3b0..7a30ba9 100644 --- a/README.md +++ b/README.md @@ -180,7 +180,7 @@ Color scales allow you to step from one color to another in even steps. Color sc ## DRY Mixins -The pattern that inspired the [A List Apart](http://alistapart.com/) article [DRY-ing Out Your Sass Mixins](http://alistapart.com/article/dry-ing-out-your-sass-mixins), now availbale for you to use in your projects! The full writeup on the why can be found in the article, and examples can be found all throughout Toolkit. +The pattern that inspired the [A List Apart](http://alistapart.com/) article [DRY-ing Out Your Sass Mixins](http://alistapart.com/article/dry-ing-out-your-sass-mixins), now available for you to use in your projects! The full writeup on the why can be found in the article, and examples can be found all throughout Toolkit. #### @include dynamic-extend($id) { @content } From a666fe7a958aeb91d37d24b43e69323d771549dc Mon Sep 17 00:00:00 2001 From: Sam Richard Date: Fri, 28 Nov 2014 07:05:43 -0500 Subject: [PATCH 05/12] Long overdue update to README --- CONTRIBUTING.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7fd0419..a132165 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,12 +2,13 @@ We love contributors! Yes we do! If you would like to contribute to Toolkit, please follow the following guidelines: +* Please ensure you have [EditorConfig](http://editorconfig.org/) installed in your editor of choice to ensure our condig standards are being followed. * Where possible, we would prefer to stay away from Ruby functionality. If something can be done entirely within Sass, it should be. -* With limited exception, such as where Toolkit expands upon the functionality in a way that is not contribute-able back upstream, additions should non mimic functionality provided by Compass, other [Team Sass](https://github.com/Team-Sass) extensions, or any included Compass extension. Currently included Compass extensions are [Breakpoint](https://github.com/Team-Sass/breakpoint), [Singularity](https://github.com/Team-Sass/Singularity), [Color Schemer](https://github.com/Team-Sass/color-schemer), and [Sassy Strings](https://github.com/Snugug/Sassy-Strings). -* With limited exception, Toolkit is primarily a place for functionality, not components or UI elements. UI elements belong in [UI Kit](https://github.com/Team-Sass/uikit). -* All functions and mixins that have defaulted arguments *must* provide globally configurable namespaced default variables for their defaults instead of only having them inside the mixin definition. This provides users with a great deal more flexibility and makes the tools in Toolkit more useful. -* When writing mixins that have no required input arguments, such as the [Clearfix](https://github.com/Team-Sass/toolkit/blob/master/compass/stylesheets/toolkit/_clearfix.scss) mixin, also include sensible namespaced silent selectors to extend from, where applicable. When doing so, be sure to include an option in the mixin for using the extended version instead of writing the output of the mixin. This argument should be called `$extend` and, where appropriate, be defaulted to `true`. -* When writing mixins that have static properties that do not change based on user input, have those styles be included via an `@extend` with a silent selector. Be sure to provide separate mixins for the pieces that do change, so a user can easily override only the pieces that change. A good example can be found in use with [Intrinsic Ratios](https://github.com/Team-Sass/toolkit/blob/master/compass/stylesheets/toolkit/_intrinsic-ratio.scss). The option to extend should be up to the user, and should use the `$extend` argument, where appropriate, defaulted to `true`. -* In any mixin that you have written includes an extend, be sure to provide a non-extend fallback within the same mixin. -* All new features require documentation the README file in order for them to be considered for inclusion. Documentation should follow the existing documentation standard as used in the README file. +* With limited exception, such as where Toolkit expands upon the functionality in a way that is not contribute-able back upstream, additions should non mimic functionality provided by Compass, other [@import](https://github.com/at-import) extensions, or any included Compass extension. Currently included Compass extensions are [Breakpoint](https://github.com/at-import/breakpoint), [Singularity](https://github.com/at-import/Singularity), [Color Schemer](https://github.com/at-import/color-schemer), and [Sassy Strings](https://github.com/Snugug/Sassy-Strings). +* Toolkit is primarily a place for functionality, not components or UI elements. +* All functions and mixins that have defaulted arguments *must* provide globally configurable [settings](https://github.com/at-import/toolkit/blob/2.x.x/stylesheets/toolkit/_settings.scss) for their defaults instead of only having them inside the mixin definition. This provides users with a great deal more flexibility and makes the tools in Toolkit more useful. +* When writing mixins that have no required input arguments, such as the [Clearfix](https://github.com/at-import/toolkit/blob/2.x.x/stylesheets/toolkit/_clearfix.scss) mixin, also include sensible namespaced silent selectors to extend from, where applicable. When doing so, be sure to include an option in the mixin for using the extended version instead of writing the output of the mixin. This argument should be called `$extend` and, where appropriate, be defaulted to `true`. +* All mixins, where appropriate, should follow the [DRY mixin pattern](http://alistapart.com/article/dry-ing-out-your-sass-mixins). And example of this in practice is the [Intrinsic Ratio](https://github.com/at-import/toolkit/blob/2.x.x/stylesheets/toolkit/_intrinsic-ratio.scss) mixin. +* All new features require documentation in the README file in order for them to be considered for inclusion. Documentation should follow the existing documentation standard as used in the README file. +* All new features require passing tests to be written. Features that break existing test or fail or provide their own tests will not be considered. * Each individual feature you would like to add, or bug you would like to squash, should be an individual pull request. Each pull request should be from an individual feature branch to either the latest stable or development branch. **The current *stable* branch is 1.x.x. The current *development* branch is 2.x.x**. Contributions that are not in the form of a pull request will not be considered. If your pull request does not apply cleanly we will ask you to fix that before we will look into pulling it in. We may ask you to update or make changes to the code you've submitted, please don't take this the wrong way. If a pull request smells (such as if a large amount of code is all within a single commit, or the coding standards aren't in line with core Toolkit) we may ask you to rewrite your commit. From 35233c01ef64cd8830522068fc57fbb1ef60f079 Mon Sep 17 00:00:00 2001 From: Sam Richard Date: Fri, 28 Nov 2014 07:06:46 -0500 Subject: [PATCH 06/12] Added EditorConfig --- .editorconfig | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..c2cdfb8 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,21 @@ +# EditorConfig helps developers define and maintain consistent +# coding styles between different editors and IDEs +# editorconfig.org + +root = true + + +[*] + +# Change these settings to your own preference +indent_style = space +indent_size = 2 + +# We recommend you to keep these unchanged +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false From 06d1287f536c0ee8e30b3f3a6c7fa4dceae49a2e Mon Sep 17 00:00:00 2001 From: Alex Williams Date: Tue, 2 Dec 2014 10:14:19 -0600 Subject: [PATCH 07/12] Change README --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index 7a30ba9..4b69411 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ Think of Toolkit as your swiss army knife for Progressive Enhancement and Respon 1. [Viewport](#viewport) 1. [Underline](#underline) 1. [Target](#target) +1. [Set Multiple](#set-multiple) ## Basics @@ -511,6 +512,25 @@ Creates specially formatted comments for use with [gulp-css-target](https://gith #### @include target($target) { @content } +## Set Multiple + +Applies the same property to multiple values. + +#### @include set-multiple($value, $property-list); + +```scss + .box { + @include set-multiple(50%, width height); + } +``` + +```css + .box { + width: 50%; + height: 50%; + } +``` + ## License Copyright (C) 2011-2014 by Sam Richard From 0b487b9f85268e609400759621e8df6b26569ba4 Mon Sep 17 00:00:00 2001 From: Alex Williams Date: Tue, 2 Dec 2014 10:14:50 -0600 Subject: [PATCH 08/12] Set Multiple mixin definition --- stylesheets/toolkit/_set-multiple.scss | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 stylesheets/toolkit/_set-multiple.scss diff --git a/stylesheets/toolkit/_set-multiple.scss b/stylesheets/toolkit/_set-multiple.scss new file mode 100644 index 0000000..89e9e1e --- /dev/null +++ b/stylesheets/toolkit/_set-multiple.scss @@ -0,0 +1,20 @@ +@mixin set-multiple($value, $properties...) { + $property-length: length($properties); + $error-msg: "The `set-multiple` mixin requires you to pass in a list of properties as the second argument"; + + @if $property-length < 1 { + @if feature-exists(at-error) { + @error $error-msg; + } + @else { + @warn $error-msg; + } + } + + // If the first argument passed in is a white-spaced separated list. + $properties: if($property-length == 1, nth($properties, 1), $properties); + + @each $property in $properties { + #{$property}: $value + } +} From 08a0079f22d3d995cca2c96f038c6ad5230568c4 Mon Sep 17 00:00:00 2001 From: Alex Williams Date: Tue, 2 Dec 2014 10:15:05 -0600 Subject: [PATCH 09/12] Test for Set Multiple mixin --- stylesheets/_toolkit.scss | 4 +++- tests/controls/17-set-multiple.css | 14 ++++++++++++++ tests/tests/17-set-multiple.scss | 16 ++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 tests/controls/17-set-multiple.css create mode 100644 tests/tests/17-set-multiple.scss diff --git a/stylesheets/_toolkit.scss b/stylesheets/_toolkit.scss index 74db5a6..46484f9 100644 --- a/stylesheets/_toolkit.scss +++ b/stylesheets/_toolkit.scss @@ -17,5 +17,7 @@ @import "toolkit/target"; @import "toolkit/triangle"; @import "toolkit/center"; +@import "toolkit/set-multiple"; @import "toolkit/viewport"; -@import "toolkit/underline"; \ No newline at end of file +@import "toolkit/underline"; + diff --git a/tests/controls/17-set-multiple.css b/tests/controls/17-set-multiple.css new file mode 100644 index 0000000..b4ff6d5 --- /dev/null +++ b/tests/controls/17-set-multiple.css @@ -0,0 +1,14 @@ +/** + * Set Multiple +**/ +.property { + _test: "@include set-multiple(30px, margin-left margin-right);"; + margin-left: 30px; + margin-right: 30px; +} + +.property { + _test: "@include set-multiple(50%, width, height);"; + width: 50%; + height: 50%; +} diff --git a/tests/tests/17-set-multiple.scss b/tests/tests/17-set-multiple.scss new file mode 100644 index 0000000..e4dab60 --- /dev/null +++ b/tests/tests/17-set-multiple.scss @@ -0,0 +1,16 @@ +@import "toolkit"; + +/** + * Set Multiple +**/ + +.property { + _test: "@include set-multiple(30px, margin-left margin-right);"; + @include set-multiple(30px, margin-left margin-right); +} + +.property { + _test: "@include set-multiple(50%, width, height);"; + @include set-multiple(50%, width, height); +} + From d94326a993b29032d46e18a275c971ba4a797a86 Mon Sep 17 00:00:00 2001 From: Sam Richard Date: Tue, 2 Dec 2014 11:28:05 -0500 Subject: [PATCH 10/12] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec46445..120dd61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Toolkit +## v 2.7.0 + +* **New** Added the `set-multiple` mixin to allow multiple properties to be set to the same value (thanks [@Robovirtuoso](https://github.com/Robovirtuoso) + ## v2.0.0.alpha.7 ### January 29, 2014 From 87389d0d3b55cef8fe9f0cd315fd890a5c0812f2 Mon Sep 17 00:00:00 2001 From: Jed Foster Date: Tue, 16 Dec 2014 20:15:07 -0800 Subject: [PATCH 11/12] Fix syntax issue with LibSass I was getting this error when processing with LibSass 3.0.2: ``` lib/sass_modules/vendor/sass-toolkit/stylesheets/toolkit/colors:113: only variable declarations and control directives are allowed inside functions ``` --- stylesheets/toolkit/_colors.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stylesheets/toolkit/_colors.scss b/stylesheets/toolkit/_colors.scss index f30e55e..6374966 100644 --- a/stylesheets/toolkit/_colors.scss +++ b/stylesheets/toolkit/_colors.scss @@ -110,7 +110,7 @@ // Color Scales ////////////////////////////// @function color-scale($main, $secondary, $steps: null) { - $steps: if($steps != null, $steps, toolkit-get('color scale steps'));; + $steps: if($steps != null, $steps, toolkit-get('color scale steps')); $list: $main; @@ -172,4 +172,4 @@ } @return $list; -} \ No newline at end of file +} From 01b5b550c5edec2076db87099c050852b36c4b3a Mon Sep 17 00:00:00 2001 From: Jed Foster Date: Tue, 16 Dec 2014 20:27:52 -0800 Subject: [PATCH 12/12] Fix trailing line return --- stylesheets/toolkit/_colors.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/stylesheets/toolkit/_colors.scss b/stylesheets/toolkit/_colors.scss index 6374966..45d1586 100644 --- a/stylesheets/toolkit/_colors.scss +++ b/stylesheets/toolkit/_colors.scss @@ -173,3 +173,4 @@ @return $list; } +