Skip to content

Commit 88d4d3e

Browse files
committed
downgrade postcss-custom-properties to a version that actually works as intended
1 parent 94ff41b commit 88d4d3e

File tree

3 files changed

+76
-15
lines changed

3 files changed

+76
-15
lines changed

gulp.d/tasks/build.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const postcss = require('gulp-postcss')
1414
const postcssCalc = require('postcss-calc')
1515
const postcssImport = require('postcss-import')
1616
const postcssUrl = require('postcss-url')
17-
const postcssVar = require('postcss-custom-properties')
17+
const postcssVars = require('postcss-custom-properties')
1818
const { Transform } = require('node:stream')
1919
const map = (transform) => new Transform({ objectMode: true, transform })
2020
const through = () => map((file, enc, next) => next(null, file))
@@ -48,8 +48,9 @@ module.exports = (src, dest, preview) => () => {
4848
},
4949
},
5050
]),
51-
// NOTE importFrom is for supplemental CSS files
52-
postcssVar({ disableDeprecationNotice: true, importFrom: path.join(src, 'css', 'vars.css'), preserve: true }),
51+
// NOTE importFrom makes vars available to all top-level stylesheets without having to redeclare the variables
52+
// use preserve: false to resolve var() declarations (this option is broken for postcss-custom-properties >= 12.0)
53+
postcssVars({ disableDeprecationNotice: true, importFrom: path.join(src, 'css', 'vars.css'), preserve: true }),
5354
preview ? postcssCalc : () => {},
5455
autoprefixer,
5556
preview

package-lock.json

Lines changed: 71 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"merge-stream": "~2.0",
5151
"postcss": "~8.4",
5252
"postcss-calc": "~8.2",
53-
"postcss-custom-properties": "~12.1",
53+
"postcss-custom-properties": "~11.0",
5454
"postcss-import": "~15.0",
5555
"postcss-url": "~10.1",
5656
"prettier-eslint": "~12.0",

0 commit comments

Comments
 (0)