Comparing version 0.2.1 to 0.3.0
@@ -123,4 +123,4 @@ function main(configuration) { | ||
"expr": /^(?!text\-).*?transform$/ig, | ||
"match": /((translate|skew)(x|3d)?|rotate(3d)?|matrix)\((.|\s)*?\)/ig, | ||
"matrix": /matrix(.|\s)*?\(/g, | ||
"match": /((translate)(x|3d)?|skew(x|y)?|rotate(z|3d)?|matrix)\((.|\s)*?\)/ig, | ||
"matrix": /matrix(.|\s)*?\(/i, | ||
"flipMatrix": function (value) { | ||
@@ -134,7 +134,7 @@ var i = 0; | ||
}, | ||
"rotate3D": /rotate3d(.|\s)*?\(/g, | ||
"rotate3D": /rotate3d(.|\s)*?\(/i, | ||
"flipRotate3D": function (value) { | ||
var i = 0; | ||
return value.replace(/(\-?(\d?\.\d+|\d+))(?!d\()/ig, function (num) { | ||
if (++i == 2 || i == 5) | ||
if (++i == 2 || i == 4) | ||
return parseFloat(num, 10) * -1; | ||
@@ -144,2 +144,3 @@ return num | ||
}, | ||
"skewXY": /skew(x|y)?/i, | ||
"action": function (prop, value) { | ||
@@ -152,2 +153,4 @@ var parts = value.match(this.match); | ||
parts[x] = this.flipRotate3D(parts[x]); | ||
else if (parts[x].match(this.skewXY)) | ||
parts[x] = util.negateAll(parts[x]); | ||
else | ||
@@ -204,3 +207,3 @@ parts[x] = util.negate(parts[x]); | ||
if (parts && parts.length > 0) { | ||
parts[0] = parts[0].match(this.percent) ? util.complement(parts[0]) : util.swapLeftRight(parts[0]); | ||
parts[0] = parts[0] == "0" ? "100%" : (parts[0].match(this.percent) ? util.complement(parts[0]) : util.swapLeftRight(parts[0])); | ||
return value.replace(this.match, function () { return parts.shift(); }); | ||
@@ -231,3 +234,3 @@ } | ||
"match": /(?:\-?(?:\d?\.\d+|\d+))|(?:\-?(?:\d?\.\d+|\d+))(?:ex|ch|r?em|vh|vw|vmin|vmax|px|mm|cm|in|pt|pc)?/i, | ||
"replace": /\b[news]{1,4}-resize/ig, | ||
"replace": /\b([news]{1,4})-resize/ig, | ||
"other": /url\(.*?\)/ig, | ||
@@ -258,3 +261,3 @@ "others": [], | ||
"flip": function (value) { | ||
return value.replace(this.replace, function (m) { return m.replace(/e/i, "*").replace(/w/i, "e").replace(/\*/i, "w"); }); | ||
return value.replace(this.replace, function (s,m) { return s.replace(m, m.replace(/e/i, "*").replace(/w/i, "e").replace(/\*/i, "w")); }); | ||
}, | ||
@@ -261,0 +264,0 @@ "action": function (prop, value) { |
@@ -68,8 +68,13 @@ function main(configuration) { | ||
negate: function (value) { | ||
return value.replace(/(\-?(\d?\.\d+|\d+))/i, function (num) { | ||
return value.replace(/(\-?(\d?\.\d+|\d+))(?!d\()/i, function (num) { | ||
return parseFloat(num, 10) * -1; | ||
}); | ||
}, | ||
negateAll: function (value) { | ||
return value.replace(/(\-?(\d?\.\d+|\d+))(?!d\()/ig, function (num) { | ||
return parseFloat(num, 10) * -1; | ||
}); | ||
}, | ||
complement: function (value) { | ||
return value.replace(/(\-?(\d?\.\d+|\d+))/i, function (num) { | ||
return value.replace(/(\-?(\d?\.\d+|\d+))(?!d\()/i, function (num) { | ||
return 100 - parseFloat(num, 10); | ||
@@ -76,0 +81,0 @@ }); |
{ | ||
"author": "Mohammad Younes", | ||
"name": "rtlcss", | ||
"version": "0.2.1", | ||
"version": "0.3.0", | ||
"description": "Framework for transforming cascading style sheets (CSS) from left-to-right (LTR) to right-to-left (RTL)", | ||
"bugs": "https://github.com/MohammadYounes/rtlcss/issues?state=open", | ||
"license": "MIT", | ||
@@ -10,4 +11,5 @@ "keywords": ["rtl","css","ltr","rtlcss", "framework","style", "mirror", "flip"], | ||
"type": "git", | ||
"url": "https://github.com/MohammadYounes/rtlcss.git" | ||
"url": "https://github.com/MohammadYounes/rtlcss.git" | ||
}, | ||
"dependencies": { | ||
@@ -17,3 +19,9 @@ "postcss":"0.3.4", | ||
}, | ||
"devDependencies": { | ||
"mocha": "1.18.2" | ||
}, | ||
"scripts": { | ||
"test": "mocha -R spec" | ||
}, | ||
"main": "./lib/rtlcss" | ||
} |
@@ -0,1 +1,3 @@ | ||
[![Build Status](https://travis-ci.org/MohammadYounes/rtlcss.svg?branch=master)](https://travis-ci.org/MohammadYounes/rtlcss) | ||
RTLCSS | ||
@@ -205,2 +207,10 @@ ====== | ||
## Release Notes | ||
* **v0.3.0** [5 Apr. 2014] | ||
* Support flipping rotateZ. | ||
* Fix flipping rotate3d. | ||
* Fix flipping skew, skewX and skewY. | ||
* Fix flipping cursor value. | ||
* Fix flipping translate3d. | ||
* Update flipping background horizontal position to treat 0 as 0% | ||
* **v0.2.1** [20 Mar. 2014] | ||
@@ -207,0 +217,0 @@ * Upgrade to [POSTCSS] v0.3.4 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
46891
13
928
233
1