Skip to content

Commit

Permalink
Version 2.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Petr Brzek committed Nov 15, 2013
1 parent 1066068 commit b528371
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 31 deletions.
4 changes: 2 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ module.exports = function(grunt) {
* Register tasks
*/

grunt.registerTask('version', ['prompt:version', 'iterate', 'build', 'mixins_update', 'git']);
grunt.registerTask('version', ['prompt:version', 'iterate', 'build', 'mixins_update']);
grunt.registerTask('dev', ['build', 'test']);
grunt.registerTask('generate', ['prompt:generate', 'generator']);
grunt.registerTask('contrib', ['build', 'test', 'mixins_update', 'prefix', 'documentation']);
grunt.registerTask('default', ['version','build', 'test', 'mixins_update', 'prefix', 'documentation']);
grunt.registerTask('default', ['version','build', 'test', 'mixins_update', 'prefix', 'documentation', 'git']);

};
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ README.md file is automatically generated.
**[Documentation](#documentation) |**

---
### Current version: v2.0.5 (2013-11-15)
### Current version: v2.0.6 (2013-11-15)
## Intro
Why LESS Hat? In August 2012, while we were developing and extending [CSS Hat](www.csshat.com) for LESS we needed universal mixins. Unfortunately, none of available were good enough that would satisfy our needs and that’s why we created new custom ones on our own, which have become the most popular mixin library for the whole LESS CSS.

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "lesshat",
"version": "2.0.5",
"version": "2.0.6",
"main": "./build/lesshat.less"
}
6 changes: 3 additions & 3 deletions build/lesshat-prefixed.less
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Handcrafted by Petr Brzek, lesshat.com
// Works great with CSS Hat csshat.com

// version: v2.0.5 (2013-11-15)
// version: v2.0.6 (2013-11-15)

// TABLE OF MIXINS:
// align-content
Expand Down Expand Up @@ -2475,7 +2475,7 @@
@process_webkit: ~`(function(value){value=value||"all 0 ease 0";var prefixedProperties=["background-size","border-radius","border-bottom-left-radius","border-bottom-right-radius","border-top-left-radius","border-top-right-radius","box-shadow","column","transform","filter"],prefix="-webkit-",valueRegex=/(?:\d)(?:ms|s)/gi,numWithoutValue=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%)/gi;return/^[-a-z0-9]*,/.test(value)&&(value=value.replace(/(?:,)(?![^(]*\))/g,"")),prefixedProperties.forEach(function(property){-1!==value.indexOf(property)&&(value=value.replace(new RegExp(property,"g"),function(match){return prefix+match}))}),valueRegex.test(value)||"0"===value||(value=value.replace(numWithoutValue,function(match){return match+=parseFloat(match,10)>10?"ms":"s"})),value})((function(){var args="@{arguments}";return args=args.replace(/^\[|\]$/g,"")})())`;
@process_moz: ~`(function(value){value=value||"all 0 ease 0";var prefixedProperties=["background-size","box-shadow","column","transform","filter"],prefix="-moz-",valueRegex=/(?:\d)(?:ms|s)/gi,numWithoutValue=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%)/gi;return/^[-a-z0-9]*,/.test(value)&&(value=value.replace(/(?:,)(?![^(]*\))/g,"")),prefixedProperties.forEach(function(property){-1!==value.indexOf(property)&&(value=value.replace(new RegExp(property,"g"),function(match){return prefix+match}))}),valueRegex.test(value)||"0"===value||(value=value.replace(numWithoutValue,function(match){return match+=parseFloat(match,10)>10?"ms":"s"})),value})((function(){var args="@{arguments}";return args=args.replace(/^\[|\]$/g,"")})())`;
@process_opera: ~`(function(value){value=value||"all 0 ease 0";var prefixedProperties=["transform"],prefix="-o-",valueRegex=/(?:\d)(?:ms|s)/gi,numWithoutValue=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%)/gi;return/^[-a-z0-9]*,/.test(value)&&(value=value.replace(/(?:,)(?![^(]*\))/g,"")),prefixedProperties.forEach(function(property){-1!==value.indexOf(property)&&(value=value.replace(new RegExp(property,"g"),function(match){return prefix+match}))}),valueRegex.test(value)||"0"===value||(value=value.replace(numWithoutValue,function(match){return match+=parseFloat(match,10)>10?"ms":"s"})),value})((function(){var args="@{arguments}";return args=args.replace(/^\[|\]$/g,"")})())`;
@process: ~`(function(value){value=value||"all 0 ease 0";var valueRegex=/(?:\d)(?:ms|s)/gi,numWithoutValue=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%)/gi;return/^[-a-z0-9]*,/.test(value)&&(value=value.replace(/(?:,)(?![^(]*\))/g,"")),valueRegex.test(value)||"0"===value||(value=value.replace(numWithoutValue,function(match){return match+=parseFloat(match,10)>10?"ms":"s"})),value})((function(){var args="@{arguments}";return args=args.replace(/^\[|\]$/g,"")})())`;
@process: ~`(function(value){value=value||"all 0 ease 0";var prefixes=["-webkit-","-moz-","-o-",""],prefixedProperties=["column","transform","filter"],valueRegex=/(?:\d)(?:ms|s)/gi,numWithoutValue=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%)/gi;/^[-a-z0-9]*,/.test(value)&&(value=value.replace(/(?:,)(?![^(]*\))/g,""));var subSplit=value.split(/(?:,)(?![^(]*\))/g);return subSplit.forEach(function(css,index){prefixedProperties.forEach(function(property){-1!==css.indexOf(property)&&(subSplit[index]="",prefixes.forEach(function(vendor,i){subSplit[index]+=css.trim().replace(new RegExp(property,"g"),function(match){return vendor+match}),i<prefixes.length-1&&(subSplit[index]+=",")}))})}),value=subSplit.join(","),valueRegex.test(value)||"0"===value||(value=value.replace(numWithoutValue,function(match){return match+=parseFloat(match,10)>10?"ms":"s"})),value})((function(){var args="@{arguments}";return args=args.replace(/^\[|\]$/g,"")})())`;

.result (@arguments, @signal, @boolean, @local_boolean) when (@boolean = true) and (@local_boolean = true) {
.inception (@signal, @arguments) when (@signal = 1) and (isstring(@process_webkit)) and not (iscolor(@process_webkit)) and not (isnumber(@process_webkit)) and not (iskeyword(@process_webkit)) and not (isurl(@process_webkit)) and not (ispixel(@process_webkit)) and not (ispercentage(@process_webkit)) and not (isem(@process_webkit)) { -webkit-transition: @process_webkit; }
Expand Down Expand Up @@ -2565,7 +2565,7 @@
@process_webkit: ~`(function(value){value=value||"all";var prefixedProperties=["background-size","border-radius","border-bottom-left-radius","border-bottom-right-radius","border-top-left-radius","border-top-right-radius","box-shadow","column","transform","filter"],prefix="-webkit-";return/^[-a-z0-9]*,/.test(value)&&(value=value.replace(/(?:,)(?![^(]*\))/g,"")),prefixedProperties.forEach(function(property){-1!==value.indexOf(property)&&(value=value.replace(new RegExp(property,"g"),function(match){return prefix+match}))}),value})((function(){var args="@{arguments}";return args=args.replace(/^\[|\]$/g,"")})())`;
@process_moz: ~`(function(value){value=value||"all";var prefixedProperties=["background-size","box-shadow","column","transform","filter"],prefix="-moz-";return/^[-a-z0-9]*,/.test(value)&&(value=value.replace(/(?:,)(?![^(]*\))/g,"")),prefixedProperties.forEach(function(property){-1!==value.indexOf(property)&&(value=value.replace(new RegExp(property,"g"),function(match){return prefix+match}))}),value})((function(){var args="@{arguments}";return args=args.replace(/^\[|\]$/g,"")})())`;
@process_opera: ~`(function(value){value=value||"all";var prefixedProperties=["transform"],prefix="-o-";return/^[-a-z0-9]*,/.test(value)&&(value=value.replace(/(?:,)(?![^(]*\))/g,"")),prefixedProperties.forEach(function(property){-1!==value.indexOf(property)&&(value=value.replace(new RegExp(property,"g"),function(match){return prefix+match}))}),value})((function(){var args="@{arguments}";return args=args.replace(/^\[|\]$/g,"")})())`;
@process: ~`(function(value){return value=value||"all",/^[-a-z0-9]*,/.test(value)&&(value=value.replace(/(?:,)(?![^(]*\))/g,"")),value})((function(){var args="@{arguments}";return args=args.replace(/^\[|\]$/g,"")})())`;
@process: ~`(function(value){value=value||"all";var prefixes=["-webkit-","-moz-","-o-",""],prefixedProperties=["column","transform","filter"],subSplit=value.split(/(?:,)(?![^(]*\))/g);return subSplit.forEach(function(css,index){prefixedProperties.forEach(function(property){-1!==css.indexOf(property)&&(subSplit[index]="",prefixes.forEach(function(vendor,i){subSplit[index]+=css.trim().replace(new RegExp(property,"g"),function(match){return vendor+match}),i<prefixes.length-1&&(subSplit[index]+=",")}))})}),value=subSplit.join(",")})((function(){var args="@{arguments}";return args=args.replace(/^\[|\]$/g,"")})())`;

.result (@arguments, @signal, @boolean, @local_boolean) when (@boolean = true) and (@local_boolean = true) {
.inception (@signal, @arguments) when (@signal = 1) and (isstring(@process_webkit)) and not (iscolor(@process_webkit)) and not (isnumber(@process_webkit)) and not (iskeyword(@process_webkit)) and not (isurl(@process_webkit)) and not (ispixel(@process_webkit)) and not (ispercentage(@process_webkit)) and not (isem(@process_webkit)) { -webkit-transition-property: @process_webkit; }
Expand Down
6 changes: 3 additions & 3 deletions build/lesshat.less
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Handcrafted by Petr Brzek, lesshat.com
// Works great with CSS Hat csshat.com

// version: v2.0.5 (2013-11-15)
// version: v2.0.6 (2013-11-15)

// TABLE OF MIXINS:
// align-content
Expand Down Expand Up @@ -2475,7 +2475,7 @@
@process_webkit: ~`(function(value){value=value||"all 0 ease 0";var prefixedProperties=["background-size","border-radius","border-bottom-left-radius","border-bottom-right-radius","border-top-left-radius","border-top-right-radius","box-shadow","column","transform","filter"],prefix="-webkit-",valueRegex=/(?:\d)(?:ms|s)/gi,numWithoutValue=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%)/gi;return/^[-a-z0-9]*,/.test(value)&&(value=value.replace(/(?:,)(?![^(]*\))/g,"")),prefixedProperties.forEach(function(property){-1!==value.indexOf(property)&&(value=value.replace(new RegExp(property,"g"),function(match){return prefix+match}))}),valueRegex.test(value)||"0"===value||(value=value.replace(numWithoutValue,function(match){return match+=parseFloat(match,10)>10?"ms":"s"})),value})((function(){var args="@{arguments}";return args=args.replace(/^\[|\]$/g,"")})())`;
@process_moz: ~`(function(value){value=value||"all 0 ease 0";var prefixedProperties=["background-size","box-shadow","column","transform","filter"],prefix="-moz-",valueRegex=/(?:\d)(?:ms|s)/gi,numWithoutValue=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%)/gi;return/^[-a-z0-9]*,/.test(value)&&(value=value.replace(/(?:,)(?![^(]*\))/g,"")),prefixedProperties.forEach(function(property){-1!==value.indexOf(property)&&(value=value.replace(new RegExp(property,"g"),function(match){return prefix+match}))}),valueRegex.test(value)||"0"===value||(value=value.replace(numWithoutValue,function(match){return match+=parseFloat(match,10)>10?"ms":"s"})),value})((function(){var args="@{arguments}";return args=args.replace(/^\[|\]$/g,"")})())`;
@process_opera: ~`(function(value){value=value||"all 0 ease 0";var prefixedProperties=["transform"],prefix="-o-",valueRegex=/(?:\d)(?:ms|s)/gi,numWithoutValue=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%)/gi;return/^[-a-z0-9]*,/.test(value)&&(value=value.replace(/(?:,)(?![^(]*\))/g,"")),prefixedProperties.forEach(function(property){-1!==value.indexOf(property)&&(value=value.replace(new RegExp(property,"g"),function(match){return prefix+match}))}),valueRegex.test(value)||"0"===value||(value=value.replace(numWithoutValue,function(match){return match+=parseFloat(match,10)>10?"ms":"s"})),value})((function(){var args="@{arguments}";return args=args.replace(/^\[|\]$/g,"")})())`;
@process: ~`(function(value){value=value||"all 0 ease 0";var valueRegex=/(?:\d)(?:ms|s)/gi,numWithoutValue=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%)/gi;return/^[-a-z0-9]*,/.test(value)&&(value=value.replace(/(?:,)(?![^(]*\))/g,"")),valueRegex.test(value)||"0"===value||(value=value.replace(numWithoutValue,function(match){return match+=parseFloat(match,10)>10?"ms":"s"})),value})((function(){var args="@{arguments}";return args=args.replace(/^\[|\]$/g,"")})())`;
@process: ~`(function(value){value=value||"all 0 ease 0";var prefixes=["-webkit-","-moz-","-o-",""],prefixedProperties=["column","transform","filter"],valueRegex=/(?:\d)(?:ms|s)/gi,numWithoutValue=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%)/gi;/^[-a-z0-9]*,/.test(value)&&(value=value.replace(/(?:,)(?![^(]*\))/g,""));var subSplit=value.split(/(?:,)(?![^(]*\))/g);return subSplit.forEach(function(css,index){prefixedProperties.forEach(function(property){-1!==css.indexOf(property)&&(subSplit[index]="",prefixes.forEach(function(vendor,i){subSplit[index]+=css.trim().replace(new RegExp(property,"g"),function(match){return vendor+match}),i<prefixes.length-1&&(subSplit[index]+=",")}))})}),value=subSplit.join(","),valueRegex.test(value)||"0"===value||(value=value.replace(numWithoutValue,function(match){return match+=parseFloat(match,10)>10?"ms":"s"})),value})((function(){var args="@{arguments}";return args=args.replace(/^\[|\]$/g,"")})())`;

.result (@arguments, @signal, @boolean, @local_boolean) when (@boolean = true) and (@local_boolean = true) {
.inception (@signal, @arguments) when (@signal = 1) and (isstring(@process_webkit)) and not (iscolor(@process_webkit)) and not (isnumber(@process_webkit)) and not (iskeyword(@process_webkit)) and not (isurl(@process_webkit)) and not (ispixel(@process_webkit)) and not (ispercentage(@process_webkit)) and not (isem(@process_webkit)) { -webkit-transition: @process_webkit; }
Expand Down Expand Up @@ -2565,7 +2565,7 @@
@process_webkit: ~`(function(value){value=value||"all";var prefixedProperties=["background-size","border-radius","border-bottom-left-radius","border-bottom-right-radius","border-top-left-radius","border-top-right-radius","box-shadow","column","transform","filter"],prefix="-webkit-";return/^[-a-z0-9]*,/.test(value)&&(value=value.replace(/(?:,)(?![^(]*\))/g,"")),prefixedProperties.forEach(function(property){-1!==value.indexOf(property)&&(value=value.replace(new RegExp(property,"g"),function(match){return prefix+match}))}),value})((function(){var args="@{arguments}";return args=args.replace(/^\[|\]$/g,"")})())`;
@process_moz: ~`(function(value){value=value||"all";var prefixedProperties=["background-size","box-shadow","column","transform","filter"],prefix="-moz-";return/^[-a-z0-9]*,/.test(value)&&(value=value.replace(/(?:,)(?![^(]*\))/g,"")),prefixedProperties.forEach(function(property){-1!==value.indexOf(property)&&(value=value.replace(new RegExp(property,"g"),function(match){return prefix+match}))}),value})((function(){var args="@{arguments}";return args=args.replace(/^\[|\]$/g,"")})())`;
@process_opera: ~`(function(value){value=value||"all";var prefixedProperties=["transform"],prefix="-o-";return/^[-a-z0-9]*,/.test(value)&&(value=value.replace(/(?:,)(?![^(]*\))/g,"")),prefixedProperties.forEach(function(property){-1!==value.indexOf(property)&&(value=value.replace(new RegExp(property,"g"),function(match){return prefix+match}))}),value})((function(){var args="@{arguments}";return args=args.replace(/^\[|\]$/g,"")})())`;
@process: ~`(function(value){return value=value||"all",/^[-a-z0-9]*,/.test(value)&&(value=value.replace(/(?:,)(?![^(]*\))/g,"")),value})((function(){var args="@{arguments}";return args=args.replace(/^\[|\]$/g,"")})())`;
@process: ~`(function(value){value=value||"all";var prefixes=["-webkit-","-moz-","-o-",""],prefixedProperties=["column","transform","filter"],subSplit=value.split(/(?:,)(?![^(]*\))/g);return subSplit.forEach(function(css,index){prefixedProperties.forEach(function(property){-1!==css.indexOf(property)&&(subSplit[index]="",prefixes.forEach(function(vendor,i){subSplit[index]+=css.trim().replace(new RegExp(property,"g"),function(match){return vendor+match}),i<prefixes.length-1&&(subSplit[index]+=",")}))})}),value=subSplit.join(",")})((function(){var args="@{arguments}";return args=args.replace(/^\[|\]$/g,"")})())`;

.result (@arguments, @signal, @boolean, @local_boolean) when (@boolean = true) and (@local_boolean = true) {
.inception (@signal, @arguments) when (@signal = 1) and (isstring(@process_webkit)) and not (iscolor(@process_webkit)) and not (isnumber(@process_webkit)) and not (iskeyword(@process_webkit)) and not (isurl(@process_webkit)) and not (ispixel(@process_webkit)) and not (ispercentage(@process_webkit)) and not (isem(@process_webkit)) { -webkit-transition-property: @process_webkit; }
Expand Down
4 changes: 2 additions & 2 deletions mixins/transition-property/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ var assert = require('assert');
describe('transition-property', function() {

it('should return the same value', function(done) {
test.transitionProperty('box-shadow', 'box-shadow', done);
test.transitionProperty('box-shadow, transform', 'box-shadow,-webkit-transform,-moz-transform,-o-transform,transform', done);
});

it('should prefix property and return value', function(done) {
test.transitionProperty.webkit('box-shadow', '-webkit-box-shadow', done);
});

});
});
24 changes: 21 additions & 3 deletions mixins/transition-property/transition-property.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,28 @@

var transitionProperty = function transitionProperty(value) {
value = value || 'all';
var prefixes = ['-webkit-', '-moz-', '-o-', ''];
var prefixedProperties = ['column', 'transform', 'filter'];
var subSplit = value.split(/(?:,)(?![^(]*\))/g);
subSplit.forEach(function(css, index) {
prefixedProperties.forEach(function(property) {
if (css.indexOf(property) !== -1) {
subSplit[index] = '';
prefixes.forEach(function(vendor, i) {
subSplit[index] += css.trim().replace(new RegExp(property, 'g'), function(match) {
return vendor + match;
});

if (i < prefixes.length - 1) {
subSplit[index] += ',';
}
});
}
});
});

value = subSplit.join(',');

if (/^[-a-z0-9]*,/.test(value)) {
value = value.replace(/(?:,)(?![^(]*\))/g, '');
}

return value;
};
Expand Down
2 changes: 1 addition & 1 deletion mixins/transition/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var assert = require('assert');
describe('transition', function() {

it('should return the same value', function(done) {
test.transition('box-shadow 0.2s cubic-bezier(.17,.67,.83,.67)', 'box-shadow 0.2s cubic-bezier(0.17, 0.67, 0.83, 0.67)', done);
test.transition('box-shadow 0.2s cubic-bezier(.17,.67,.83,.67), transform 0.2s linear', 'box-shadow 0.2s cubic-bezier(0.17, 0.67, 0.83, 0.67),-webkit-transform 0.2s linear,-moz-transform 0.2s linear,-o-transform 0.2s linear,transform 0.2s linear', done);
});

it('should return the same value', function(done) {
Expand Down
34 changes: 20 additions & 14 deletions mixins/transition/transition.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

var transition = function transition(value) {
value = value || 'all 0 ease 0';
var valueCopy = value;
var prefixes = ['-webkit-', '-moz-', '-o-'];
var prefixes = ['-webkit-', '-moz-', '-o-', ''];
var prefixedProperties = ['column', 'transform', 'filter'];
var valueRegex = /(?:\d)(?:ms|s)/gi;
var numWithoutValue = /(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%)/gi;
Expand All @@ -14,18 +13,25 @@ var transition = function transition(value) {
value = value.replace(/(?:,)(?![^(]*\))/g, '');
}

// value = '';
// prefixes.forEach(function (prefix) {
// prefixedProperties.forEach(function(property, index) {
// if (valueCopy.indexOf(property) !== -1) {
// value += valueCopy.replace(new RegExp(property, 'g'), function(match) {
// return prefix + match;
// }) + ', ';
// }
// });
// });

// value += valueCopy;
var subSplit = value.split(/(?:,)(?![^(]*\))/g);
subSplit.forEach(function(css, index) {
prefixedProperties.forEach(function(property) {
if (css.indexOf(property) !== -1) {
subSplit[index] = '';
prefixes.forEach(function(vendor, i) {
subSplit[index] += css.trim().replace(new RegExp(property, 'g'), function(match) {
return vendor + match;
});

if (i < prefixes.length - 1) {
subSplit[index] += ',';
}
});
}
});
});

value = subSplit.join(',');

if (!valueRegex.test(value) && value !== '0') {
value = value.replace(numWithoutValue, function(match) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "lesshat",
"description": "Most advanced LESS CSS mixins library",
"version": "2.0.5",
"version": "2.0.6",
"homepage": "http://lesshat.com/",
"author": {
"name": "Petr Brzek",
Expand Down

0 comments on commit b528371

Please sign in to comment.