diff --git a/README.md b/README.md index a668273..beab498 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ README.md file is automatically generated. **[Documentation](#documentation) |** --- -### Current version: v2.0.12 (2013-12-11) +### Current version: v2.0.13 (2013-12-13) ## 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. diff --git a/bower.json b/bower.json index 2c9abda..3e5021f 100644 --- a/bower.json +++ b/bower.json @@ -1,5 +1,5 @@ { "name": "lesshat", - "version": "2.0.12", + "version": "2.0.13", "main": "./build/lesshat.less" } \ No newline at end of file diff --git a/build/lesshat-prefixed.less b/build/lesshat-prefixed.less index 2885cf8..f00d515 100644 --- a/build/lesshat-prefixed.less +++ b/build/lesshat-prefixed.less @@ -6,7 +6,7 @@ // Handcrafted by Petr Brzek, lesshat.com // Works great with CSS Hat csshat.com -// version: v2.0.12 (2013-12-11) +// version: v2.0.13 (2013-12-13) // TABLE OF MIXINS: // align-content @@ -1499,7 +1499,7 @@ @opera_local: true; @w3c_local: true; - @process: ~`(function(value){function syntax(start,selector,prefix){var end="}\n",definition=value_temp.split(/(^[a-zA-Z0-9-]+),/g),keyframes=selector+" "+definition[1]+"{",prefixes=["-webkit-","-moz-","-ms-",""];prefix?prefixedProperties.forEach(function(property){-1!==value.indexOf(property)&&(definition[2]=definition[2].replace(new RegExp(property,"g"),function(match){return prefix+match}))}):definition[2]=definition[2].replace(/{([^}]+)}/g,function(match,sub){var subSplit=sub.split(";");subSplit.forEach(function(css,index){prefixedProperties.forEach(function(property){-1!==css.indexOf(property)&&(subSplit[index]="",prefixes.forEach(function(vendor){subSplit[index]+=css.trim().replace(new RegExp(property,"g"),function(match){return vendor+match})+";"}))})});var temp=subSplit.join("");return match.replace(sub,temp)}),keyframes+=definition[2]+end,"start"==start?value="0; } \n"+keyframes:"startend"==start?value="0; } \n"+keyframes.replace(end,""):value+="end"==start?keyframes.replace(end,""):keyframes}value=value||8121991;var state="@{state}",value_temp=value;if(8121991==value)return value;var prefixedProperties=["animation","transform","filter"];switch(state){case"1":syntax("start","@-webkit-keyframes","-webkit-"),syntax(null,"@-moz-keyframes","-moz-"),syntax(null,"@-o-keyframes","-o-"),syntax("end","@keyframes");break;case"2":syntax("start","@-webkit-keyframes","-webkit-"),syntax(null,"@-moz-keyframes","-moz-"),syntax("end","@keyframes");break;case"3":syntax("start","@-webkit-keyframes","-webkit-"),syntax(null,"@-moz-keyframes","-moz-"),syntax("end","@-o-keyframes","-o-");break;case"4":syntax("start","@-webkit-keyframes","-webkit-"),syntax(null,"@-o-keyframes","-o-"),syntax("end","@keyframes");break;case"5":syntax("start","@-webkit-keyframes","-webkit-"),syntax("end","@-moz-keyframes","-moz-");break;case"6":syntax("start","@-webkit-keyframes","-webkit-"),syntax("end","@-o-keyframes","-o-");break;case"7":syntax("start","@-webkit-keyframes","-webkit-"),syntax("end","@keyframes");break;case"8":syntax("startend","@-webkit-keyframes","-webkit-");break;case"9":syntax("start","@-moz-keyframes","-moz-"),syntax(null,"@-o-keyframes","-o-"),syntax("end","@keyframes");break;case"10":syntax("start","@-moz-keyframes","-moz-"),syntax("end","@-o-keyframes","-o-");break;case"11":syntax("start","@-moz-keyframes","-moz-"),syntax("end","@keyframes");break;case"12":syntax("startend","@-moz-keyframes","-moz-");break;case"13":syntax("start","@-o-keyframes","-o-"),syntax("end","@keyframes");break;case"14":syntax("startend","@-o-keyframes","-o-");break;case"15":syntax("startend","@keyframes")}return value})((function(){var args="@{arguments}";return args=args.replace(/^\[|\]$/g,"")})())`; + @process: ~`(function(value){function syntax(start,selector,prefix){var end="}\n",definition=value_temp.split(/(^[a-zA-Z0-9-]+),/g),keyframes=selector+" "+definition[1]+"{",prefixes=["-webkit-","-moz-","-ms-",""];prefix?prefixedProperties.forEach(function(property){-1!==value.indexOf(property)&&(definition[2]=definition[2].replace(new RegExp(property,"g"),function(match){return prefix+match}))}):definition[2]=definition[2].replace(/{([^}]+)}/g,function(match,sub){var subSplit=sub.split(";");subSplit.forEach(function(css,index){prefixedProperties.forEach(function(property){-1!==css.indexOf(property)&&(subSplit[index]="",prefixes.forEach(function(vendor){subSplit[index]+=css.trim().replace(new RegExp(property,"g"),function(match){return vendor+match})+";"}))})});var temp=subSplit.join(";").replace(/;;/g,";");return match.replace(sub,temp)}),keyframes+=definition[2]+end,"start"==start?value="0; } \n"+keyframes:"startend"==start?value="0; } \n"+keyframes.replace(end,""):value+="end"==start?keyframes.replace(end,""):keyframes}value=value||8121991;var state="@{state}",value_temp=value;if(8121991==value)return value;var prefixedProperties=["animation","transform","filter"];switch(state){case"1":syntax("start","@-webkit-keyframes","-webkit-"),syntax(null,"@-moz-keyframes","-moz-"),syntax(null,"@-o-keyframes","-o-"),syntax("end","@keyframes");break;case"2":syntax("start","@-webkit-keyframes","-webkit-"),syntax(null,"@-moz-keyframes","-moz-"),syntax("end","@keyframes");break;case"3":syntax("start","@-webkit-keyframes","-webkit-"),syntax(null,"@-moz-keyframes","-moz-"),syntax("end","@-o-keyframes","-o-");break;case"4":syntax("start","@-webkit-keyframes","-webkit-"),syntax(null,"@-o-keyframes","-o-"),syntax("end","@keyframes");break;case"5":syntax("start","@-webkit-keyframes","-webkit-"),syntax("end","@-moz-keyframes","-moz-");break;case"6":syntax("start","@-webkit-keyframes","-webkit-"),syntax("end","@-o-keyframes","-o-");break;case"7":syntax("start","@-webkit-keyframes","-webkit-"),syntax("end","@keyframes");break;case"8":syntax("startend","@-webkit-keyframes","-webkit-");break;case"9":syntax("start","@-moz-keyframes","-moz-"),syntax(null,"@-o-keyframes","-o-"),syntax("end","@keyframes");break;case"10":syntax("start","@-moz-keyframes","-moz-"),syntax("end","@-o-keyframes","-o-");break;case"11":syntax("start","@-moz-keyframes","-moz-"),syntax("end","@keyframes");break;case"12":syntax("startend","@-moz-keyframes","-moz-");break;case"13":syntax("start","@-o-keyframes","-o-"),syntax("end","@keyframes");break;case"14":syntax("startend","@-o-keyframes","-o-");break;case"15":syntax("startend","@keyframes")}return value})((function(){var args="@{arguments}";return args=args.replace(/^\[|\]$/g,"")})())`; @state: 1; // Default state 1 means all prefixes diff --git a/build/lesshat.less b/build/lesshat.less index a36aaed..56b2bc1 100644 --- a/build/lesshat.less +++ b/build/lesshat.less @@ -6,7 +6,7 @@ // Handcrafted by Petr Brzek, lesshat.com // Works great with CSS Hat csshat.com -// version: v2.0.12 (2013-12-11) +// version: v2.0.13 (2013-12-13) // TABLE OF MIXINS: // align-content @@ -1499,7 +1499,7 @@ @opera_local: true; @w3c_local: true; - @process: ~`(function(value){function syntax(start,selector,prefix){var end="}\n",definition=value_temp.split(/(^[a-zA-Z0-9-]+),/g),keyframes=selector+" "+definition[1]+"{",prefixes=["-webkit-","-moz-","-ms-",""];prefix?prefixedProperties.forEach(function(property){-1!==value.indexOf(property)&&(definition[2]=definition[2].replace(new RegExp(property,"g"),function(match){return prefix+match}))}):definition[2]=definition[2].replace(/{([^}]+)}/g,function(match,sub){var subSplit=sub.split(";");subSplit.forEach(function(css,index){prefixedProperties.forEach(function(property){-1!==css.indexOf(property)&&(subSplit[index]="",prefixes.forEach(function(vendor){subSplit[index]+=css.trim().replace(new RegExp(property,"g"),function(match){return vendor+match})+";"}))})});var temp=subSplit.join("");return match.replace(sub,temp)}),keyframes+=definition[2]+end,"start"==start?value="0; } \n"+keyframes:"startend"==start?value="0; } \n"+keyframes.replace(end,""):value+="end"==start?keyframes.replace(end,""):keyframes}value=value||8121991;var state="@{state}",value_temp=value;if(8121991==value)return value;var prefixedProperties=["animation","transform","filter"];switch(state){case"1":syntax("start","@-webkit-keyframes","-webkit-"),syntax(null,"@-moz-keyframes","-moz-"),syntax(null,"@-o-keyframes","-o-"),syntax("end","@keyframes");break;case"2":syntax("start","@-webkit-keyframes","-webkit-"),syntax(null,"@-moz-keyframes","-moz-"),syntax("end","@keyframes");break;case"3":syntax("start","@-webkit-keyframes","-webkit-"),syntax(null,"@-moz-keyframes","-moz-"),syntax("end","@-o-keyframes","-o-");break;case"4":syntax("start","@-webkit-keyframes","-webkit-"),syntax(null,"@-o-keyframes","-o-"),syntax("end","@keyframes");break;case"5":syntax("start","@-webkit-keyframes","-webkit-"),syntax("end","@-moz-keyframes","-moz-");break;case"6":syntax("start","@-webkit-keyframes","-webkit-"),syntax("end","@-o-keyframes","-o-");break;case"7":syntax("start","@-webkit-keyframes","-webkit-"),syntax("end","@keyframes");break;case"8":syntax("startend","@-webkit-keyframes","-webkit-");break;case"9":syntax("start","@-moz-keyframes","-moz-"),syntax(null,"@-o-keyframes","-o-"),syntax("end","@keyframes");break;case"10":syntax("start","@-moz-keyframes","-moz-"),syntax("end","@-o-keyframes","-o-");break;case"11":syntax("start","@-moz-keyframes","-moz-"),syntax("end","@keyframes");break;case"12":syntax("startend","@-moz-keyframes","-moz-");break;case"13":syntax("start","@-o-keyframes","-o-"),syntax("end","@keyframes");break;case"14":syntax("startend","@-o-keyframes","-o-");break;case"15":syntax("startend","@keyframes")}return value})((function(){var args="@{arguments}";return args=args.replace(/^\[|\]$/g,"")})())`; + @process: ~`(function(value){function syntax(start,selector,prefix){var end="}\n",definition=value_temp.split(/(^[a-zA-Z0-9-]+),/g),keyframes=selector+" "+definition[1]+"{",prefixes=["-webkit-","-moz-","-ms-",""];prefix?prefixedProperties.forEach(function(property){-1!==value.indexOf(property)&&(definition[2]=definition[2].replace(new RegExp(property,"g"),function(match){return prefix+match}))}):definition[2]=definition[2].replace(/{([^}]+)}/g,function(match,sub){var subSplit=sub.split(";");subSplit.forEach(function(css,index){prefixedProperties.forEach(function(property){-1!==css.indexOf(property)&&(subSplit[index]="",prefixes.forEach(function(vendor){subSplit[index]+=css.trim().replace(new RegExp(property,"g"),function(match){return vendor+match})+";"}))})});var temp=subSplit.join(";").replace(/;;/g,";");return match.replace(sub,temp)}),keyframes+=definition[2]+end,"start"==start?value="0; } \n"+keyframes:"startend"==start?value="0; } \n"+keyframes.replace(end,""):value+="end"==start?keyframes.replace(end,""):keyframes}value=value||8121991;var state="@{state}",value_temp=value;if(8121991==value)return value;var prefixedProperties=["animation","transform","filter"];switch(state){case"1":syntax("start","@-webkit-keyframes","-webkit-"),syntax(null,"@-moz-keyframes","-moz-"),syntax(null,"@-o-keyframes","-o-"),syntax("end","@keyframes");break;case"2":syntax("start","@-webkit-keyframes","-webkit-"),syntax(null,"@-moz-keyframes","-moz-"),syntax("end","@keyframes");break;case"3":syntax("start","@-webkit-keyframes","-webkit-"),syntax(null,"@-moz-keyframes","-moz-"),syntax("end","@-o-keyframes","-o-");break;case"4":syntax("start","@-webkit-keyframes","-webkit-"),syntax(null,"@-o-keyframes","-o-"),syntax("end","@keyframes");break;case"5":syntax("start","@-webkit-keyframes","-webkit-"),syntax("end","@-moz-keyframes","-moz-");break;case"6":syntax("start","@-webkit-keyframes","-webkit-"),syntax("end","@-o-keyframes","-o-");break;case"7":syntax("start","@-webkit-keyframes","-webkit-"),syntax("end","@keyframes");break;case"8":syntax("startend","@-webkit-keyframes","-webkit-");break;case"9":syntax("start","@-moz-keyframes","-moz-"),syntax(null,"@-o-keyframes","-o-"),syntax("end","@keyframes");break;case"10":syntax("start","@-moz-keyframes","-moz-"),syntax("end","@-o-keyframes","-o-");break;case"11":syntax("start","@-moz-keyframes","-moz-"),syntax("end","@keyframes");break;case"12":syntax("startend","@-moz-keyframes","-moz-");break;case"13":syntax("start","@-o-keyframes","-o-"),syntax("end","@keyframes");break;case"14":syntax("startend","@-o-keyframes","-o-");break;case"15":syntax("startend","@keyframes")}return value})((function(){var args="@{arguments}";return args=args.replace(/^\[|\]$/g,"")})())`; @state: 1; // Default state 1 means all prefixes diff --git a/mixins/keyframes/keyframes.js b/mixins/keyframes/keyframes.js index 1812d10..3ddcba1 100644 --- a/mixins/keyframes/keyframes.js +++ b/mixins/keyframes/keyframes.js @@ -124,7 +124,7 @@ var keyframes = function keyframes(value) { }); }); - var temp = subSplit.join(''); + var temp = subSplit.join(';').replace(/;;/g, ';'); return match.replace(sub, temp); }); } diff --git a/package.json b/package.json index d33f1f3..0c77597 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "lesshat", "description": "Most advanced LESS CSS mixins library", - "version": "2.0.12", + "version": "2.0.13", "homepage": "http://lesshat.com/", "author": { "name": "Petr Brzek",