Skip to content
This repository was archived by the owner on Feb 18, 2022. It is now read-only.

Update to postcss 8 #15

Merged
merged 3 commits into from
Jan 12, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Update to postcss 8
goto-bus-stop committed Sep 19, 2020

Verified

This commit was signed with the committer’s verified signature.
commit 852ab92bc78cd27778dbbfd90b2b4e78b135c297
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -29,15 +29,15 @@
"node": ">=10.0.0"
},
"dependencies": {
"postcss": "^7.0.27",
"postcss-values-parser": "^3.2.0"
"postcss-values-parser": "^4.0.0"
},
"devDependencies": {
"@babel/core": "^7.9.0",
"@babel/preset-env": "^7.9.5",
"babel-eslint": "^10.1.0",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated but if you would like to do a bit clean up before a major bump, I suggest replacing babel-eslint by @babel/eslint-parser.

"eslint": "^6.8.0",
"postcss-tape": "^5.0.2",
"postcss": "^8.0.5",
"postcss-tape": "^6.0.0",
"pre-commit": "^1.2.2",
"rollup": "^2.7.2",
"rollup-plugin-babel": "^4.4.0"
12 changes: 6 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import postcss from 'postcss'
import onCSSDeclaration from './onCSSDeclaration'
import options from './options'

/** Transform 4 & 8 character hex color notation in CSS. */
const postcssPlugin = postcss.plugin('postcss-color-hex-alpha', /** @type {PostCSSPluginInitializer} */ opts => {
export default function postcssColorHexAlpha(/** @type {PostCSSPluginInitializer} */ opts) {
options.preserve = 'preserve' in Object(opts) ? Boolean(opts.preserve) : false

return root => {
root.walkDecls(onCSSDeclaration)
return {
postcssPlugin: 'postcss-color-hex-alpha',
Declaration: onCSSDeclaration
}
})
}

export default postcssPlugin
postcssColorHexAlpha.postcss = true