Skip to content

Commit

Permalink
downgrade postcss-custom-properties to a version that actually works …
Browse files Browse the repository at this point in the history
…as intended
  • Loading branch information
mojavelinux committed Nov 21, 2023
1 parent 94ff41b commit 88d4d3e
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 15 deletions.
7 changes: 4 additions & 3 deletions gulp.d/tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const postcss = require('gulp-postcss')
const postcssCalc = require('postcss-calc')
const postcssImport = require('postcss-import')
const postcssUrl = require('postcss-url')
const postcssVar = require('postcss-custom-properties')
const postcssVars = require('postcss-custom-properties')
const { Transform } = require('node:stream')
const map = (transform) => new Transform({ objectMode: true, transform })
const through = () => map((file, enc, next) => next(null, file))
Expand Down Expand Up @@ -48,8 +48,9 @@ module.exports = (src, dest, preview) => () => {
},
},
]),
// NOTE importFrom is for supplemental CSS files
postcssVar({ disableDeprecationNotice: true, importFrom: path.join(src, 'css', 'vars.css'), preserve: true }),
// NOTE importFrom makes vars available to all top-level stylesheets without having to redeclare the variables
// use preserve: false to resolve var() declarations (this option is broken for postcss-custom-properties >= 12.0)
postcssVars({ disableDeprecationNotice: true, importFrom: path.join(src, 'css', 'vars.css'), preserve: true }),
preview ? postcssCalc : () => {},
autoprefixer,
preview
Expand Down
82 changes: 71 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"merge-stream": "~2.0",
"postcss": "~8.4",
"postcss-calc": "~8.2",
"postcss-custom-properties": "~12.1",
"postcss-custom-properties": "~11.0",
"postcss-import": "~15.0",
"postcss-url": "~10.1",
"prettier-eslint": "~12.0",
Expand Down

0 comments on commit 88d4d3e

Please sign in to comment.