Comparing version 1.1.0 to 1.2.0
@@ -7,6 +7,6 @@ function main(configuration) { | ||
"name": "ignore", | ||
"expr": /(?:[^]*)(?:\/\*rtl:ignore)([^]*?)(?:\*\/)/img, | ||
"expr": /(?:[^]*)(?:\/\*(?:!)?rtl:ignore)([^]*?)(?:\*\/)/img, | ||
"action": function (decl) { | ||
if (!config.preserveDirectives) | ||
decl._value.raw = decl._value.raw.replace(/\/\*rtl:[^]*?\*\//img, ""); | ||
decl._value.raw = decl._value.raw.replace(/\/\*(?:!)?rtl:[^]*?\*\//img, ""); | ||
return true; | ||
@@ -17,4 +17,4 @@ } | ||
"name": "prepend", | ||
"expr": /(?:[^]*)(?:\/\*rtl:prepend:)([^]*?)(?:\*\/)/img, | ||
"replace": /\/\*rtl:[^]*?\*\//img, | ||
"expr": /(?:[^]*)(?:\/\*(?:!)?rtl:prepend:)([^]*?)(?:\*\/)/img, | ||
"replace": /\/\*(?:!)?rtl:[^]*?\*\//img, | ||
"action": function (decl) { | ||
@@ -32,4 +32,4 @@ this.expr.lastIndex = 0; | ||
"name": "append", | ||
"expr": /(?:[^]*)(?:\/\*rtl:append:)([^]*?)(?:\*\/)/img, | ||
"replace": /\/\*rtl:[^]*?\*\/(?:\s*)/img, | ||
"expr": /(?:[^]*)(?:\/\*(?:!)?rtl:append:)([^]*?)(?:\*\/)/img, | ||
"replace": /\/\*(?:!)?rtl:[^]*?\*\/(?:\s*)/img, | ||
"action": function (decl) { | ||
@@ -47,4 +47,4 @@ this.expr.lastIndex = 0; | ||
"name": "insert", | ||
"expr": /(?:\/\*rtl:insert:)([^]*?)(?:\*\/)/img, | ||
"replace": /\/\*rtl:[^]*?\*\//img, | ||
"expr": /(?:\/\*(?:!)?rtl:insert:)([^]*?)(?:\*\/)/img, | ||
"replace": /\/\*(?:!)?rtl:[^]*?\*\//img, | ||
"action": function (decl) { | ||
@@ -64,3 +64,3 @@ this.expr.lastIndex = 0; | ||
"name": "replace", | ||
"expr": /(?:\/\*rtl:)([^]*?)(?:\*\/)/img, | ||
"expr": /(?:\/\*(?:!)?rtl:)([^]*?)(?:\*\/)/img, | ||
"action": function (decl) { | ||
@@ -67,0 +67,0 @@ this.expr.lastIndex = 0; |
@@ -8,3 +8,3 @@ function main(configuration) { | ||
"name": "ignore", | ||
"expr": /(?:[^]*)(?:\/\*rtl:ignore)([^]*?)(?:\*\/)/img, | ||
"expr": /(?:[^]*)(?:\/\*(!)?rtl:ignore)([^]*?)(?:\*\/)/img, | ||
"action": function (rule) { | ||
@@ -16,3 +16,3 @@ return true; | ||
"name": "rename", | ||
"expr": /(?:[^]*)(?:\/\*rtl:rename)([^]*?)(?:\*\/)/img, | ||
"expr": /(?:[^]*)(?:\/\*(!)?rtl:rename)([^]*?)(?:\*\/)/img, | ||
"action": function (rule) { | ||
@@ -19,0 +19,0 @@ var renamed = util.swapLeftRight(util.swapLtrRtl(util.swapWestEast(rule.selector))); |
{ | ||
"author": "Mohammad Younes", | ||
"name": "rtlcss", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "Framework for transforming cascading style sheets (CSS) from left-to-right (LTR) to right-to-left (RTL)", | ||
@@ -6,0 +6,0 @@ "bugs": "https://github.com/MohammadYounes/rtlcss/issues?state=open", |
@@ -292,2 +292,5 @@ [![GitHub version](https://badge.fury.io/gh/MohammadYounes%2Frtlcss.svg)](http://badge.fury.io/gh/MohammadYounes%2Frtlcss) | ||
* **v1.2.0** [26 Sep. 2014] | ||
* Support !important comments for directives (enbles flipping minified stylesheets). | ||
* **v1.1.0** [26 Sep. 2014] | ||
@@ -294,0 +297,0 @@ * Upgrade to [POSTCSS] v2.2.5 |
@@ -696,2 +696,8 @@ var assert = require("assert"); | ||
{ | ||
'should': 'Should auto rename selectors having no directional decl. unless forced to ignore. (default, !important comment)', | ||
'expected': ' .right .rtl .east .bright .ultra .least { display:block; }', | ||
'input': '/*!rtl:ignore*/ .right .rtl .east .bright .ultra .least { display:block; }', | ||
'reversable': false, | ||
}, | ||
{ | ||
'should' : 'Should auto rename selectors having no directional decl. unless forced to ignore. (greedy)', | ||
@@ -702,4 +708,11 @@ 'expected' : ' .right .rtl .east .bright .ultra .least { display:block; }', | ||
'options' : {'greedy':true} | ||
}, | ||
}, | ||
{ | ||
'should': 'Should auto rename selectors having no directional decl. unless forced to ignore. (greedy, !important comment)', | ||
'expected': ' .right .rtl .east .bright .ultra .least { display:block; }', | ||
'input': '/*!rtl:ignore*/ .right .rtl .east .bright .ultra .least { display:block; }', | ||
'reversable': false, | ||
'options': { 'greedy': true } | ||
}, | ||
{ | ||
'should' : 'Should rename selectors when forced. (autoRename:false)', | ||
@@ -712,2 +725,9 @@ 'expected' : '.left .ltr .west .bright .ultra .least { display:block; }', | ||
{ | ||
'should': 'Should rename selectors when forced. (autoRename:false, !important comment)', | ||
'expected': '.left .ltr .west .bright .ultra .least { display:block; }', | ||
'input': '/*!rtl:rename*/.right .rtl .east .bright .ultra .least { display:block; }', | ||
'reversable': false, | ||
'options': { 'autoRename': false } | ||
}, | ||
{ | ||
'should' : 'Should rename selectors when forced. (autoRename:false,greedy)', | ||
@@ -720,2 +740,9 @@ 'expected' : '.left .ltr .west .bleft .urtla .lwest { display:block; }', | ||
{ | ||
'should': 'Should rename selectors when forced. (autoRename:false,greedy, !important comment)', | ||
'expected': '.left .ltr .west .bleft .urtla .lwest { display:block; }', | ||
'input': '/*!rtl:rename*/.right .rtl .east .bright .ultra .least { display:block; }', | ||
'reversable': false, | ||
'options': { 'autoRename': false, 'greedy': true } | ||
}, | ||
{ | ||
'should' : 'Should prepend value.', | ||
@@ -727,2 +754,8 @@ 'expected' : 'div { font-family: "Droid Arabic Kufi", "Droid Sans", Tahoma; }', | ||
{ | ||
'should': 'Should prepend value (!important comment)', | ||
'expected': 'div { font-family: "Droid Arabic Kufi", "Droid Sans", Tahoma; }', | ||
'input': 'div { font-family: "Droid Sans", Tahoma/*!rtl:prepend:"Droid Arabic Kufi", */; }', | ||
'reversable': false, | ||
}, | ||
{ | ||
'should' : 'Should replace value.', | ||
@@ -734,2 +767,8 @@ 'expected' : 'div { font-family: "Droid Arabic Kufi"; }', | ||
{ | ||
'should': 'Should replace value. (!important comment)', | ||
'expected': 'div { font-family: "Droid Arabic Kufi"; }', | ||
'input': 'div { font-family: "Droid Sans", Tahoma/*!rtl:"Droid Arabic Kufi"*/; }', | ||
'reversable': false, | ||
}, | ||
{ | ||
'should' : 'Should append value.', | ||
@@ -741,2 +780,8 @@ 'expected' : 'div { font-family: "Droid Sans", Tahoma, "Droid Arabic Kufi"; }', | ||
{ | ||
'should': 'Should append value. (!important comment)', | ||
'expected': 'div { font-family: "Droid Sans", Tahoma, "Droid Arabic Kufi"; }', | ||
'input': 'div { font-family: "Droid Sans", Tahoma/*!rtl:append:, "Droid Arabic Kufi"*/; }', | ||
'reversable': false, | ||
}, | ||
{ | ||
'should' : 'Should insert value.', | ||
@@ -748,2 +793,8 @@ 'expected' : 'div { font-family: "Droid Sans", "Droid Arabic Kufi", Tahoma; }', | ||
{ | ||
'should': 'Should insert value. (!important comment)', | ||
'expected': 'div { font-family: "Droid Sans", "Droid Arabic Kufi", Tahoma; }', | ||
'input': 'div { font-family: "Droid Sans"/*!rtl:insert:, "Droid Arabic Kufi"*/, Tahoma; }', | ||
'reversable': false, | ||
}, | ||
{ | ||
'should' : 'Should ignore flipping (rule level)', | ||
@@ -755,2 +806,8 @@ 'expected' : 'div { left:10px; text-align:right;}', | ||
{ | ||
'should': 'Should ignore flipping (rule level, !important comment)', | ||
'expected': 'div { left:10px; text-align:right;}', | ||
'input': '/*!rtl:ignore*/div { left:10px; text-align:right;}', | ||
'reversable': false, | ||
}, | ||
{ | ||
'should' : 'Should ignore flipping (decl. level)', | ||
@@ -761,2 +818,8 @@ 'expected' : 'div { left:10px;text-align:left;}', | ||
}, | ||
{ | ||
'should': 'Should ignore flipping (decl. level, !important comment)', | ||
'expected': 'div { left:10px;text-align:left;}', | ||
'input': 'div { left:10px/*!rtl:ignore*/;text-align:right;}', | ||
'reversable': false, | ||
} | ||
] | ||
@@ -763,0 +826,0 @@ }; |
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
85766
1730
355