From a0579f91bbdf0de62b59df381d97a008bb98df57 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Mon, 30 Oct 2023 16:45:38 +0800 Subject: update/upgrade --- .../postcss-unrgba/test/fixtures/basic.actual.css | 50 ++++++++++++ .../test/fixtures/basic.clone.actual.css | 63 +++++++++++++++ .../test/fixtures/basic.clone.expect.css | 63 +++++++++++++++ .../postcss-unrgba/test/fixtures/basic.css | 50 ++++++++++++ .../postcss-unrgba/test/fixtures/basic.expect.css | 50 ++++++++++++ .../test/fixtures/basic.filter.actual.css | 53 +++++++++++++ .../test/fixtures/basic.filter.expect.css | 53 +++++++++++++ .../fixtures/basic.filter.properties.actual.css | 51 +++++++++++++ .../fixtures/basic.filter.properties.expect.css | 51 +++++++++++++ .../test/fixtures/basic.properties.actual.css | 50 ++++++++++++ .../test/fixtures/basic.properties.expect.css | 50 ++++++++++++ .../test/fixtures/basic.replace.actual.css | 50 ++++++++++++ .../test/fixtures/basic.replace.expect.css | 50 ++++++++++++ .../test/fixtures/basic.warn.actual.css | 50 ++++++++++++ .../test/fixtures/basic.warn.expect.css | 50 ++++++++++++ node_modules/postcss-unrgba/test/index.js | 89 ++++++++++++++++++++++ 16 files changed, 873 insertions(+) create mode 100644 node_modules/postcss-unrgba/test/fixtures/basic.actual.css create mode 100644 node_modules/postcss-unrgba/test/fixtures/basic.clone.actual.css create mode 100644 node_modules/postcss-unrgba/test/fixtures/basic.clone.expect.css create mode 100644 node_modules/postcss-unrgba/test/fixtures/basic.css create mode 100644 node_modules/postcss-unrgba/test/fixtures/basic.expect.css create mode 100644 node_modules/postcss-unrgba/test/fixtures/basic.filter.actual.css create mode 100644 node_modules/postcss-unrgba/test/fixtures/basic.filter.expect.css create mode 100644 node_modules/postcss-unrgba/test/fixtures/basic.filter.properties.actual.css create mode 100644 node_modules/postcss-unrgba/test/fixtures/basic.filter.properties.expect.css create mode 100644 node_modules/postcss-unrgba/test/fixtures/basic.properties.actual.css create mode 100644 node_modules/postcss-unrgba/test/fixtures/basic.properties.expect.css create mode 100644 node_modules/postcss-unrgba/test/fixtures/basic.replace.actual.css create mode 100644 node_modules/postcss-unrgba/test/fixtures/basic.replace.expect.css create mode 100644 node_modules/postcss-unrgba/test/fixtures/basic.warn.actual.css create mode 100644 node_modules/postcss-unrgba/test/fixtures/basic.warn.expect.css create mode 100644 node_modules/postcss-unrgba/test/index.js (limited to 'node_modules/postcss-unrgba/test') diff --git a/node_modules/postcss-unrgba/test/fixtures/basic.actual.css b/node_modules/postcss-unrgba/test/fixtures/basic.actual.css new file mode 100644 index 00000000..d3bafb5b --- /dev/null +++ b/node_modules/postcss-unrgba/test/fixtures/basic.actual.css @@ -0,0 +1,50 @@ +.color-1 { + color: #ffffff; +} + +.background-1 { + background: none; +} + +.background-2 { + background: rgb(255, 0, 0); +} + +.background-3 { + background: #ff0000; +} + +.background-4 { + background: #ff0000 none no-repeat; +} + +.background-5 { + background-color: #ff0000; +} + +.background-6 { + background: #ff0000; + background: rgba(255, 0, 0, 1); +} + +.border-1 { + border: 1px solid #ff0000; +} + +.border-2 { + border-top: 1px solid #0000ff; + border-right: 1px solid #00ff00; + border-bottom: 1px solid #ff0000; + border-left: 1px solid #ffff00; +} + +.border-3 { + border-top-color: #0000ff; + border-right-color: #00ff00; + border-bottom-color: #ff0000; + border-left-color: transparent; +} + +.box-shadow-1 { + box-shadow: 0 0 5px 0 rgba(0, 0, 0, .5); +} diff --git a/node_modules/postcss-unrgba/test/fixtures/basic.clone.actual.css b/node_modules/postcss-unrgba/test/fixtures/basic.clone.actual.css new file mode 100644 index 00000000..a9e1680f --- /dev/null +++ b/node_modules/postcss-unrgba/test/fixtures/basic.clone.actual.css @@ -0,0 +1,63 @@ +.color-1 { + color: #ffffff; + color: rgba(255, 255, 255, .75); +} + +.background-1 { + background: none; +} + +.background-2 { + background: rgb(255, 0, 0); +} + +.background-3 { + background: #ff0000; + background: rgba(255, 0, 0, 1); +} + +.background-4 { + background: #ff0000 none no-repeat; + background: rgba(255, 0, 0, .5) none no-repeat; +} + +.background-5 { + background-color: #ff0000; + background-color: rgba(255, 0, 0, .5); +} + +.background-6 { + background: #ff0000; + background: rgba(255, 0, 0, 1); +} + +.border-1 { + border: 1px solid #ff0000; + border: 1px solid rgba(255, 0, 0, 1); +} + +.border-2 { + border-top: 1px solid #0000ff; + border-top: 1px solid rgba(0, 0, 255, 1); + border-right: 1px solid #00ff00; + border-right: 1px solid rgba(0, 255, 0, 1); + border-bottom: 1px solid #ff0000; + border-bottom: 1px solid rgba(255, 0, 0, 1); + border-left: 1px solid #ffff00; + border-left: 1px solid rgba(255, 255, 0, 1); +} + +.border-3 { + border-top-color: #0000ff; + border-top-color: rgba(0, 0, 255, 1); + border-right-color: #00ff00; + border-right-color: rgba(0, 255, 0, 1); + border-bottom-color: #ff0000; + border-bottom-color: rgba(255, 0, 0, 1); + border-left-color: transparent; + border-left-color: rgba(255, 255, 0, 0); +} + +.box-shadow-1 { + box-shadow: 0 0 5px 0 rgba(0, 0, 0, .5); +} diff --git a/node_modules/postcss-unrgba/test/fixtures/basic.clone.expect.css b/node_modules/postcss-unrgba/test/fixtures/basic.clone.expect.css new file mode 100644 index 00000000..a9e1680f --- /dev/null +++ b/node_modules/postcss-unrgba/test/fixtures/basic.clone.expect.css @@ -0,0 +1,63 @@ +.color-1 { + color: #ffffff; + color: rgba(255, 255, 255, .75); +} + +.background-1 { + background: none; +} + +.background-2 { + background: rgb(255, 0, 0); +} + +.background-3 { + background: #ff0000; + background: rgba(255, 0, 0, 1); +} + +.background-4 { + background: #ff0000 none no-repeat; + background: rgba(255, 0, 0, .5) none no-repeat; +} + +.background-5 { + background-color: #ff0000; + background-color: rgba(255, 0, 0, .5); +} + +.background-6 { + background: #ff0000; + background: rgba(255, 0, 0, 1); +} + +.border-1 { + border: 1px solid #ff0000; + border: 1px solid rgba(255, 0, 0, 1); +} + +.border-2 { + border-top: 1px solid #0000ff; + border-top: 1px solid rgba(0, 0, 255, 1); + border-right: 1px solid #00ff00; + border-right: 1px solid rgba(0, 255, 0, 1); + border-bottom: 1px solid #ff0000; + border-bottom: 1px solid rgba(255, 0, 0, 1); + border-left: 1px solid #ffff00; + border-left: 1px solid rgba(255, 255, 0, 1); +} + +.border-3 { + border-top-color: #0000ff; + border-top-color: rgba(0, 0, 255, 1); + border-right-color: #00ff00; + border-right-color: rgba(0, 255, 0, 1); + border-bottom-color: #ff0000; + border-bottom-color: rgba(255, 0, 0, 1); + border-left-color: transparent; + border-left-color: rgba(255, 255, 0, 0); +} + +.box-shadow-1 { + box-shadow: 0 0 5px 0 rgba(0, 0, 0, .5); +} diff --git a/node_modules/postcss-unrgba/test/fixtures/basic.css b/node_modules/postcss-unrgba/test/fixtures/basic.css new file mode 100644 index 00000000..fc29e1ee --- /dev/null +++ b/node_modules/postcss-unrgba/test/fixtures/basic.css @@ -0,0 +1,50 @@ +.color-1 { + color: rgba(255, 255, 255, .75); +} + +.background-1 { + background: none; +} + +.background-2 { + background: rgb(255, 0, 0); +} + +.background-3 { + background: rgba(255, 0, 0, 1); +} + +.background-4 { + background: rgba(255, 0, 0, .5) none no-repeat; +} + +.background-5 { + background-color: rgba(255, 0, 0, .5); +} + +.background-6 { + background: #ff0000; + background: rgba(255, 0, 0, 1); +} + +.border-1 { + border: 1px solid rgba(255, 0, 0, 1); +} + +.border-2 { + border-top: 1px solid rgba(0, 0, 255, 1); + border-right: 1px solid rgba(0, 255, 0, 1); + border-bottom: 1px solid rgba(255, 0, 0, 1); + border-left: 1px solid rgba(255, 255, 0, 1); +} + +.border-3 { + border-top-color: rgba(0, 0, 255, 1); + border-right-color: rgba(0, 255, 0, 1); + border-bottom-color: rgba(255, 0, 0, 1); + border-left-color: rgba(255, 255, 0, 0); +} + +.box-shadow-1 { + box-shadow: 0 0 5px 0 rgba(0, 0, 0, .5); +} diff --git a/node_modules/postcss-unrgba/test/fixtures/basic.expect.css b/node_modules/postcss-unrgba/test/fixtures/basic.expect.css new file mode 100644 index 00000000..d3bafb5b --- /dev/null +++ b/node_modules/postcss-unrgba/test/fixtures/basic.expect.css @@ -0,0 +1,50 @@ +.color-1 { + color: #ffffff; +} + +.background-1 { + background: none; +} + +.background-2 { + background: rgb(255, 0, 0); +} + +.background-3 { + background: #ff0000; +} + +.background-4 { + background: #ff0000 none no-repeat; +} + +.background-5 { + background-color: #ff0000; +} + +.background-6 { + background: #ff0000; + background: rgba(255, 0, 0, 1); +} + +.border-1 { + border: 1px solid #ff0000; +} + +.border-2 { + border-top: 1px solid #0000ff; + border-right: 1px solid #00ff00; + border-bottom: 1px solid #ff0000; + border-left: 1px solid #ffff00; +} + +.border-3 { + border-top-color: #0000ff; + border-right-color: #00ff00; + border-bottom-color: #ff0000; + border-left-color: transparent; +} + +.box-shadow-1 { + box-shadow: 0 0 5px 0 rgba(0, 0, 0, .5); +} diff --git a/node_modules/postcss-unrgba/test/fixtures/basic.filter.actual.css b/node_modules/postcss-unrgba/test/fixtures/basic.filter.actual.css new file mode 100644 index 00000000..089e22ba --- /dev/null +++ b/node_modules/postcss-unrgba/test/fixtures/basic.filter.actual.css @@ -0,0 +1,53 @@ +.color-1 { + color: #ffffff; +} + +.background-1 { + background: none; +} + +.background-2 { + background: rgb(255, 0, 0); +} + +.background-3 { + background: #ff0000; + filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#ffff0000',endColorstr='#ffff0000'); +} + +.background-4 { + background: #ff0000 none no-repeat; + filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#80ff0000',endColorstr='#80ff0000'); +} + +.background-5 { + background-color: #ff0000; + filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#80ff0000',endColorstr='#80ff0000'); +} + +.background-6 { + background: #ff0000; + background: rgba(255, 0, 0, 1); +} + +.border-1 { + border: 1px solid #ff0000; +} + +.border-2 { + border-top: 1px solid #0000ff; + border-right: 1px solid #00ff00; + border-bottom: 1px solid #ff0000; + border-left: 1px solid #ffff00; +} + +.border-3 { + border-top-color: #0000ff; + border-right-color: #00ff00; + border-bottom-color: #ff0000; + border-left-color: transparent; +} + +.box-shadow-1 { + box-shadow: 0 0 5px 0 rgba(0, 0, 0, .5); +} diff --git a/node_modules/postcss-unrgba/test/fixtures/basic.filter.expect.css b/node_modules/postcss-unrgba/test/fixtures/basic.filter.expect.css new file mode 100644 index 00000000..089e22ba --- /dev/null +++ b/node_modules/postcss-unrgba/test/fixtures/basic.filter.expect.css @@ -0,0 +1,53 @@ +.color-1 { + color: #ffffff; +} + +.background-1 { + background: none; +} + +.background-2 { + background: rgb(255, 0, 0); +} + +.background-3 { + background: #ff0000; + filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#ffff0000',endColorstr='#ffff0000'); +} + +.background-4 { + background: #ff0000 none no-repeat; + filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#80ff0000',endColorstr='#80ff0000'); +} + +.background-5 { + background-color: #ff0000; + filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#80ff0000',endColorstr='#80ff0000'); +} + +.background-6 { + background: #ff0000; + background: rgba(255, 0, 0, 1); +} + +.border-1 { + border: 1px solid #ff0000; +} + +.border-2 { + border-top: 1px solid #0000ff; + border-right: 1px solid #00ff00; + border-bottom: 1px solid #ff0000; + border-left: 1px solid #ffff00; +} + +.border-3 { + border-top-color: #0000ff; + border-right-color: #00ff00; + border-bottom-color: #ff0000; + border-left-color: transparent; +} + +.box-shadow-1 { + box-shadow: 0 0 5px 0 rgba(0, 0, 0, .5); +} diff --git a/node_modules/postcss-unrgba/test/fixtures/basic.filter.properties.actual.css b/node_modules/postcss-unrgba/test/fixtures/basic.filter.properties.actual.css new file mode 100644 index 00000000..dd25a0e8 --- /dev/null +++ b/node_modules/postcss-unrgba/test/fixtures/basic.filter.properties.actual.css @@ -0,0 +1,51 @@ +.color-1 { + color: rgba(255, 255, 255, .75); +} + +.background-1 { + background: none; +} + +.background-2 { + background: rgb(255, 0, 0); +} + +.background-3 { + background: rgba(255, 0, 0, 1); +} + +.background-4 { + background: rgba(255, 0, 0, .5) none no-repeat; +} + +.background-5 { + background-color: #ff0000; + filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#80ff0000',endColorstr='#80ff0000'); +} + +.background-6 { + background: #ff0000; + background: rgba(255, 0, 0, 1); +} + +.border-1 { + border: 1px solid rgba(255, 0, 0, 1); +} + +.border-2 { + border-top: 1px solid rgba(0, 0, 255, 1); + border-right: 1px solid rgba(0, 255, 0, 1); + border-bottom: 1px solid rgba(255, 0, 0, 1); + border-left: 1px solid rgba(255, 255, 0, 1); +} + +.border-3 { + border-top-color: rgba(0, 0, 255, 1); + border-right-color: rgba(0, 255, 0, 1); + border-bottom-color: rgba(255, 0, 0, 1); + border-left-color: rgba(255, 255, 0, 0); +} + +.box-shadow-1 { + box-shadow: 0 0 5px 0 rgba(0, 0, 0, .5); +} diff --git a/node_modules/postcss-unrgba/test/fixtures/basic.filter.properties.expect.css b/node_modules/postcss-unrgba/test/fixtures/basic.filter.properties.expect.css new file mode 100644 index 00000000..dd25a0e8 --- /dev/null +++ b/node_modules/postcss-unrgba/test/fixtures/basic.filter.properties.expect.css @@ -0,0 +1,51 @@ +.color-1 { + color: rgba(255, 255, 255, .75); +} + +.background-1 { + background: none; +} + +.background-2 { + background: rgb(255, 0, 0); +} + +.background-3 { + background: rgba(255, 0, 0, 1); +} + +.background-4 { + background: rgba(255, 0, 0, .5) none no-repeat; +} + +.background-5 { + background-color: #ff0000; + filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#80ff0000',endColorstr='#80ff0000'); +} + +.background-6 { + background: #ff0000; + background: rgba(255, 0, 0, 1); +} + +.border-1 { + border: 1px solid rgba(255, 0, 0, 1); +} + +.border-2 { + border-top: 1px solid rgba(0, 0, 255, 1); + border-right: 1px solid rgba(0, 255, 0, 1); + border-bottom: 1px solid rgba(255, 0, 0, 1); + border-left: 1px solid rgba(255, 255, 0, 1); +} + +.border-3 { + border-top-color: rgba(0, 0, 255, 1); + border-right-color: rgba(0, 255, 0, 1); + border-bottom-color: rgba(255, 0, 0, 1); + border-left-color: rgba(255, 255, 0, 0); +} + +.box-shadow-1 { + box-shadow: 0 0 5px 0 rgba(0, 0, 0, .5); +} diff --git a/node_modules/postcss-unrgba/test/fixtures/basic.properties.actual.css b/node_modules/postcss-unrgba/test/fixtures/basic.properties.actual.css new file mode 100644 index 00000000..310ad6b4 --- /dev/null +++ b/node_modules/postcss-unrgba/test/fixtures/basic.properties.actual.css @@ -0,0 +1,50 @@ +.color-1 { + color: rgba(255, 255, 255, .75); +} + +.background-1 { + background: none; +} + +.background-2 { + background: rgb(255, 0, 0); +} + +.background-3 { + background: rgba(255, 0, 0, 1); +} + +.background-4 { + background: rgba(255, 0, 0, .5) none no-repeat; +} + +.background-5 { + background-color: #ff0000; +} + +.background-6 { + background: #ff0000; + background: rgba(255, 0, 0, 1); +} + +.border-1 { + border: 1px solid rgba(255, 0, 0, 1); +} + +.border-2 { + border-top: 1px solid rgba(0, 0, 255, 1); + border-right: 1px solid rgba(0, 255, 0, 1); + border-bottom: 1px solid rgba(255, 0, 0, 1); + border-left: 1px solid rgba(255, 255, 0, 1); +} + +.border-3 { + border-top-color: rgba(0, 0, 255, 1); + border-right-color: rgba(0, 255, 0, 1); + border-bottom-color: rgba(255, 0, 0, 1); + border-left-color: rgba(255, 255, 0, 0); +} + +.box-shadow-1 { + box-shadow: 0 0 5px 0 rgba(0, 0, 0, .5); +} diff --git a/node_modules/postcss-unrgba/test/fixtures/basic.properties.expect.css b/node_modules/postcss-unrgba/test/fixtures/basic.properties.expect.css new file mode 100644 index 00000000..310ad6b4 --- /dev/null +++ b/node_modules/postcss-unrgba/test/fixtures/basic.properties.expect.css @@ -0,0 +1,50 @@ +.color-1 { + color: rgba(255, 255, 255, .75); +} + +.background-1 { + background: none; +} + +.background-2 { + background: rgb(255, 0, 0); +} + +.background-3 { + background: rgba(255, 0, 0, 1); +} + +.background-4 { + background: rgba(255, 0, 0, .5) none no-repeat; +} + +.background-5 { + background-color: #ff0000; +} + +.background-6 { + background: #ff0000; + background: rgba(255, 0, 0, 1); +} + +.border-1 { + border: 1px solid rgba(255, 0, 0, 1); +} + +.border-2 { + border-top: 1px solid rgba(0, 0, 255, 1); + border-right: 1px solid rgba(0, 255, 0, 1); + border-bottom: 1px solid rgba(255, 0, 0, 1); + border-left: 1px solid rgba(255, 255, 0, 1); +} + +.border-3 { + border-top-color: rgba(0, 0, 255, 1); + border-right-color: rgba(0, 255, 0, 1); + border-bottom-color: rgba(255, 0, 0, 1); + border-left-color: rgba(255, 255, 0, 0); +} + +.box-shadow-1 { + box-shadow: 0 0 5px 0 rgba(0, 0, 0, .5); +} diff --git a/node_modules/postcss-unrgba/test/fixtures/basic.replace.actual.css b/node_modules/postcss-unrgba/test/fixtures/basic.replace.actual.css new file mode 100644 index 00000000..d3bafb5b --- /dev/null +++ b/node_modules/postcss-unrgba/test/fixtures/basic.replace.actual.css @@ -0,0 +1,50 @@ +.color-1 { + color: #ffffff; +} + +.background-1 { + background: none; +} + +.background-2 { + background: rgb(255, 0, 0); +} + +.background-3 { + background: #ff0000; +} + +.background-4 { + background: #ff0000 none no-repeat; +} + +.background-5 { + background-color: #ff0000; +} + +.background-6 { + background: #ff0000; + background: rgba(255, 0, 0, 1); +} + +.border-1 { + border: 1px solid #ff0000; +} + +.border-2 { + border-top: 1px solid #0000ff; + border-right: 1px solid #00ff00; + border-bottom: 1px solid #ff0000; + border-left: 1px solid #ffff00; +} + +.border-3 { + border-top-color: #0000ff; + border-right-color: #00ff00; + border-bottom-color: #ff0000; + border-left-color: transparent; +} + +.box-shadow-1 { + box-shadow: 0 0 5px 0 rgba(0, 0, 0, .5); +} diff --git a/node_modules/postcss-unrgba/test/fixtures/basic.replace.expect.css b/node_modules/postcss-unrgba/test/fixtures/basic.replace.expect.css new file mode 100644 index 00000000..d3bafb5b --- /dev/null +++ b/node_modules/postcss-unrgba/test/fixtures/basic.replace.expect.css @@ -0,0 +1,50 @@ +.color-1 { + color: #ffffff; +} + +.background-1 { + background: none; +} + +.background-2 { + background: rgb(255, 0, 0); +} + +.background-3 { + background: #ff0000; +} + +.background-4 { + background: #ff0000 none no-repeat; +} + +.background-5 { + background-color: #ff0000; +} + +.background-6 { + background: #ff0000; + background: rgba(255, 0, 0, 1); +} + +.border-1 { + border: 1px solid #ff0000; +} + +.border-2 { + border-top: 1px solid #0000ff; + border-right: 1px solid #00ff00; + border-bottom: 1px solid #ff0000; + border-left: 1px solid #ffff00; +} + +.border-3 { + border-top-color: #0000ff; + border-right-color: #00ff00; + border-bottom-color: #ff0000; + border-left-color: transparent; +} + +.box-shadow-1 { + box-shadow: 0 0 5px 0 rgba(0, 0, 0, .5); +} diff --git a/node_modules/postcss-unrgba/test/fixtures/basic.warn.actual.css b/node_modules/postcss-unrgba/test/fixtures/basic.warn.actual.css new file mode 100644 index 00000000..fc29e1ee --- /dev/null +++ b/node_modules/postcss-unrgba/test/fixtures/basic.warn.actual.css @@ -0,0 +1,50 @@ +.color-1 { + color: rgba(255, 255, 255, .75); +} + +.background-1 { + background: none; +} + +.background-2 { + background: rgb(255, 0, 0); +} + +.background-3 { + background: rgba(255, 0, 0, 1); +} + +.background-4 { + background: rgba(255, 0, 0, .5) none no-repeat; +} + +.background-5 { + background-color: rgba(255, 0, 0, .5); +} + +.background-6 { + background: #ff0000; + background: rgba(255, 0, 0, 1); +} + +.border-1 { + border: 1px solid rgba(255, 0, 0, 1); +} + +.border-2 { + border-top: 1px solid rgba(0, 0, 255, 1); + border-right: 1px solid rgba(0, 255, 0, 1); + border-bottom: 1px solid rgba(255, 0, 0, 1); + border-left: 1px solid rgba(255, 255, 0, 1); +} + +.border-3 { + border-top-color: rgba(0, 0, 255, 1); + border-right-color: rgba(0, 255, 0, 1); + border-bottom-color: rgba(255, 0, 0, 1); + border-left-color: rgba(255, 255, 0, 0); +} + +.box-shadow-1 { + box-shadow: 0 0 5px 0 rgba(0, 0, 0, .5); +} diff --git a/node_modules/postcss-unrgba/test/fixtures/basic.warn.expect.css b/node_modules/postcss-unrgba/test/fixtures/basic.warn.expect.css new file mode 100644 index 00000000..fc29e1ee --- /dev/null +++ b/node_modules/postcss-unrgba/test/fixtures/basic.warn.expect.css @@ -0,0 +1,50 @@ +.color-1 { + color: rgba(255, 255, 255, .75); +} + +.background-1 { + background: none; +} + +.background-2 { + background: rgb(255, 0, 0); +} + +.background-3 { + background: rgba(255, 0, 0, 1); +} + +.background-4 { + background: rgba(255, 0, 0, .5) none no-repeat; +} + +.background-5 { + background-color: rgba(255, 0, 0, .5); +} + +.background-6 { + background: #ff0000; + background: rgba(255, 0, 0, 1); +} + +.border-1 { + border: 1px solid rgba(255, 0, 0, 1); +} + +.border-2 { + border-top: 1px solid rgba(0, 0, 255, 1); + border-right: 1px solid rgba(0, 255, 0, 1); + border-bottom: 1px solid rgba(255, 0, 0, 1); + border-left: 1px solid rgba(255, 255, 0, 1); +} + +.border-3 { + border-top-color: rgba(0, 0, 255, 1); + border-right-color: rgba(0, 255, 0, 1); + border-bottom-color: rgba(255, 0, 0, 1); + border-left-color: rgba(255, 255, 0, 0); +} + +.box-shadow-1 { + box-shadow: 0 0 5px 0 rgba(0, 0, 0, .5); +} diff --git a/node_modules/postcss-unrgba/test/index.js b/node_modules/postcss-unrgba/test/index.js new file mode 100644 index 00000000..a5c7180c --- /dev/null +++ b/node_modules/postcss-unrgba/test/index.js @@ -0,0 +1,89 @@ +var tests = { + 'postcss-unrgba': { + 'basic': { + message: 'supports basic usage' + }, + 'basic:replace': { + message: 'supports "replace" method', + options: { method: 'replace' } + }, + 'basic:clone': { + message: 'supports "clone" method', + options: { method: 'clone' } + }, + 'basic:warn': { + message: 'supports "warn" method', + options: { method: 'warn' }, + warning: 13 + }, + 'basic:filter': { + message: 'supports "filter" option', + options: { filter: true } + }, + 'basic:properties': { + message: 'supports "properties" option', + options: { properties: ['background-color'] } + }, + 'basic:filter:properties': { + message: 'supports "properties" option with "filter" option', + options: { filter: true, properties: ['background-color'] } + } + } +}; + +var debug = true; +var dir = './test/fixtures/'; + +var fs = require('fs'); +var path = require('path'); +var plugin = require('../'); +var test = require('tape'); + +Object.keys(tests).forEach(function (name) { + var parts = tests[name]; + + test(name, function (t) { + var fixtures = Object.keys(parts); + + t.plan(fixtures.length * 2); + + fixtures.forEach(function (fixture) { + var message = parts[fixture].message; + var options = parts[fixture].options; + var warning = parts[fixture].warning || 0; + var warningMsg = message + ' (# of warnings)'; + + var baseName = fixture.split(':')[0]; + var testName = fixture.split(':').join('.'); + + var inputPath = path.resolve(dir + baseName + '.css'); + var expectPath = path.resolve(dir + testName + '.expect.css'); + var actualPath = path.resolve(dir + testName + '.actual.css'); + + var inputCSS = ''; + var expectCSS = ''; + + try { + inputCSS = fs.readFileSync(inputPath, 'utf8'); + } catch (error) { + fs.writeFileSync(inputPath, inputCSS); + } + + try { + expectCSS = fs.readFileSync(expectPath, 'utf8'); + } catch (error) { + fs.writeFileSync(expectPath, expectCSS); + } + + plugin.process(inputCSS, options).then(function (result) { + var actualCSS = result.css; + + if (debug) fs.writeFileSync(actualPath, actualCSS); + + t.equal(actualCSS, expectCSS, message); + + t.equal(result.warnings().length, warning, warningMsg); + }); + }); + }); +}); -- cgit v1.2.3