Skip to content

Commit

Permalink
👽 Replace root.walkDecls with Declaration to work with PostCSS 8 corr…
Browse files Browse the repository at this point in the history
…ectly
  • Loading branch information
Winston committed Sep 16, 2020
1 parent 867e92d commit 3379972
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const postcss = require('postcss')
const R = require('ramda')

const {
Expand Down Expand Up @@ -31,17 +30,15 @@ module.exports = ({

return {
postcssPlugin: 'postcss-sparrow',
Root (root, result) {
Declaration (decl) {
R.map(
(transformation) => root.walkDecls((decl) => {
const result = R.when(
R.pipe(
R.prop('parent'),
getNodesBySelectors(transformation)
),
R.juxt(transformation.callbacks)
)(decl)
})
(transformation) => R.when(
R.pipe(
R.prop('parent'),
getNodesBySelectors(transformation)
),
R.juxt(transformation.callbacks)
)(decl)
)(validatedTransformations)
}
}
Expand Down

0 comments on commit 3379972

Please sign in to comment.