Skip to content

Commit

Permalink
chore: adjust postcss-disable-css-vars
Browse files Browse the repository at this point in the history
  • Loading branch information
awmleer committed May 29, 2022
1 parent 8eb12cb commit 00f4463
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 15 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -81,7 +81,7 @@
"less": "^4.1.2",
"lorem-ipsum": "^2.0.4",
"mockdate": "^3.0.5",
"postcss": "^8.4.14",
"postcss": "^7.0.0",
"postcss-px-multiple": "^0.1.5",
"postcss-pxtorem": "^6.0.0",
"prettier": "^2.6.2",
Expand Down
20 changes: 19 additions & 1 deletion scripts/postcss-disable-css-vars.js
@@ -1,12 +1,30 @@
import postcss from 'postcss'

module.exports = postcss.plugin('postcss-dark-theme-class', (opts = {}) => {
module.exports = postcss.plugin('postcss-disable-css-vars', (opts = {}) => {
return (root, result) => {
root.walkDecls(decl => {
if (decl.source.input.file?.includes('/.dumi/theme/')) return
// Transform each property declaration here
if (decl.value.includes('--')) {
decl.value = ''
}
})
}
})

// module.exports = (opts = {}) => {
// return {
// postcssPlugin: 'postcss-disable-css-vars',
// Once: (root, result) => {
// root.walkDecls(decl => {
// if (decl.source.input.file?.includes('/.dumi/theme/')) return
// // Transform each property declaration here
// if (decl.value.includes('--')) {
// decl.value = ''
// }
// })
// },
// }
// }
//
// module.exports.postcss = true
15 changes: 2 additions & 13 deletions yarn.lock
Expand Up @@ -4435,7 +4435,7 @@ __metadata:
lodash: ^4.17.21
lorem-ipsum: ^2.0.4
mockdate: ^3.0.5
postcss: ^8.4.14
postcss: ^7.0.0
postcss-px-multiple: ^0.1.5
postcss-pxtorem: ^6.0.0
prettier: ^2.6.2
Expand Down Expand Up @@ -11768,7 +11768,7 @@ __metadata:
languageName: node
linkType: hard

"nanoid@npm:^3.3.3, nanoid@npm:^3.3.4":
"nanoid@npm:^3.3.3":
version: 3.3.4
resolution: "nanoid@npm:3.3.4"
bin:
Expand Down Expand Up @@ -13185,17 +13185,6 @@ __metadata:
languageName: node
linkType: hard

"postcss@npm:^8.4.14":
version: 8.4.14
resolution: "postcss@npm:8.4.14"
dependencies:
nanoid: ^3.3.4
picocolors: ^1.0.0
source-map-js: ^1.0.2
checksum: fe58766ff32e4becf65a7d57678995cfd239df6deed2fe0557f038b47c94e4132e7e5f68b5aa820c13adfec32e523b693efaeb65798efb995ce49ccd83953816
languageName: node
linkType: hard

"prelude-ls@npm:^1.2.1":
version: 1.2.1
resolution: "prelude-ls@npm:1.2.1"
Expand Down

0 comments on commit 00f4463

Please sign in to comment.