Skip to content

Commit b936373

Browse files
jonathantnealromainmenke
authored andcommitted
8.0.9
1 parent 61e3cf8 commit b936373

File tree

10 files changed

+41
-12
lines changed

10 files changed

+41
-12
lines changed

plugins/postcss-custom-properties/.rollup.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ export default {
44
input: 'index.js',
55
output: [
66
{ file: 'index.cjs.js', format: 'cjs', sourcemap: true },
7-
{ file: 'index.es.mjs', format: 'es', sourcemap: true }
7+
{ file: 'index.esm.mjs', format: 'esm', sourcemap: true }
88
],
99
plugins: [
1010
babel({
1111
plugins: [
1212
'@babel/plugin-syntax-dynamic-import'
1313
],
1414
presets: [
15-
['@babel/env', { modules: false, targets: { node: 6 } }]
15+
['@babel/env', { targets: { node: 6 } }]
1616
]
1717
})
1818
]

plugins/postcss-custom-properties/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changes to PostCSS Custom Properties
22

3+
### 8.0.9 (November 5, 2018)
4+
5+
- Fixed: Issue with duplicate custom property usage within a declaration
6+
37
### 8.0.8 (October 2, 2018)
48

59
- Fixed: Issue with nested fallbacks

plugins/postcss-custom-properties/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ See example exports written to [CSS](test/export-properties.css),
179179
[JS](test/export-properties.js), [MJS](test/export-properties.mjs), and
180180
[JSON](test/export-properties.json).
181181

182-
[cli-img]: https://img.shields.io/travis/postcss/postcss-custom-properties.svg
182+
[cli-img]: https://img.shields.io/travis/postcss/postcss-custom-properties/master.svg
183183
[cli-url]: https://travis-ci.org/postcss/postcss-custom-properties
184184
[css-img]: https://cssdb.org/badge/custom-properties.svg
185185
[css-url]: https://cssdb.org/#custom-properties

plugins/postcss-custom-properties/lib/transform-value-ast.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ export default function transformValueAST(root, customProperties) {
88

99
if (name in customProperties) {
1010
// conditionally replace a known custom property
11-
child.replaceWith(...asClonedArrayWithBeforeSpacing(customProperties[name], child.raws.before));
11+
const nodes = asClonedArrayWithBeforeSpacing(customProperties[name], child.raws.before);
1212

13-
retransformValueAST(root, customProperties, name);
13+
child.replaceWith(...nodes);
14+
15+
retransformValueAST({ nodes }, customProperties, name);
1416
} else if (fallbacks.length) {
1517
// conditionally replace a custom property with a fallback
1618
const index = root.nodes.indexOf(child);
@@ -24,7 +26,7 @@ export default function transformValueAST(root, customProperties) {
2426
} else {
2527
transformValueAST(child, customProperties);
2628
}
27-
})
29+
});
2830
}
2931

3032
return root;

plugins/postcss-custom-properties/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "postcss-custom-properties",
3-
"version": "8.0.8",
3+
"version": "8.0.9",
44
"description": "Use Custom Properties Queries in CSS",
55
"author": "Jonathan Neal <jonathantneal@hotmail.com>",
66
"contributors": [
@@ -11,12 +11,12 @@
1111
"homepage": "https://github.com/postcss/postcss-custom-properties#readme",
1212
"bugs": "https://github.com/postcss/postcss-custom-properties/issues",
1313
"main": "index.cjs.js",
14-
"module": "index.es.mjs",
14+
"module": "index.esm.mjs",
1515
"files": [
1616
"index.cjs.js",
1717
"index.cjs.js.map",
18-
"index.es.mjs",
19-
"index.es.mjs.map"
18+
"index.esm.mjs",
19+
"index.esm.mjs.map"
2020
],
2121
"scripts": {
2222
"prepublishOnly": "npm test",
@@ -37,11 +37,11 @@
3737
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
3838
"@babel/preset-env": "^7.1.0",
3939
"babel-eslint": "^10.0.1",
40-
"eslint": "^5.6.1",
40+
"eslint": "^5.8.0",
4141
"eslint-config-dev": "^2.0.0",
4242
"postcss-tape": "^2.2.0",
4343
"pre-commit": "^1.2.2",
44-
"rollup": "^0.66.2",
44+
"rollup": "^0.67.0",
4545
"rollup-plugin-babel": "^4.0.3"
4646
},
4747
"eslintConfig": {

plugins/postcss-custom-properties/test/basic.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,7 @@ html {
4242
.text--calc {
4343
width: calc((100% - var(--xxx, 1px)) + var(--yyy, 10px));
4444
}
45+
46+
.test--linear-gradient {
47+
background-image: linear-gradient(to right, var(--color, transparent) 0%, var(--color, transparent) 100%);
48+
}

plugins/postcss-custom-properties/test/basic.expect.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,8 @@ html {
4949
width: calc((100% - 1px) + 10px);
5050
width: calc((100% - var(--xxx, 1px)) + var(--yyy, 10px));
5151
}
52+
53+
.test--linear-gradient {
54+
background-image: linear-gradient(to right, rgb(255, 0, 0) 0%, rgb(255, 0, 0) 100%);
55+
background-image: linear-gradient(to right, var(--color, transparent) 0%, var(--color, transparent) 100%);
56+
}

plugins/postcss-custom-properties/test/basic.import-is-empty.expect.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,8 @@ html {
4949
width: calc((100% - 1px) + 10px);
5050
width: calc((100% - var(--xxx, 1px)) + var(--yyy, 10px));
5151
}
52+
53+
.test--linear-gradient {
54+
background-image: linear-gradient(to right, rgb(255, 0, 0) 0%, rgb(255, 0, 0) 100%);
55+
background-image: linear-gradient(to right, var(--color, transparent) 0%, var(--color, transparent) 100%);
56+
}

plugins/postcss-custom-properties/test/basic.import.expect.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,8 @@ html {
5050
width: calc((100% - 1px) + 10px);
5151
width: calc((100% - var(--xxx, 1px)) + var(--yyy, 10px));
5252
}
53+
54+
.test--linear-gradient {
55+
background-image: linear-gradient(to right, rgb(255, 0, 0) 0%, rgb(255, 0, 0) 100%);
56+
background-image: linear-gradient(to right, var(--color, transparent) 0%, var(--color, transparent) 100%);
57+
}

plugins/postcss-custom-properties/test/basic.preserve.expect.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,7 @@
3434
.text--calc {
3535
width: calc((100% - 1px) + 10px);
3636
}
37+
38+
.test--linear-gradient {
39+
background-image: linear-gradient(to right, rgb(255, 0, 0) 0%, rgb(255, 0, 0) 100%);
40+
}

0 commit comments

Comments
 (0)