Skip to content

Migrate postcss-overflow-shorthand #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Contributing to PostCSS Overflow Shorthand
# Contributing to CSSTools Plugins

You want to help? You rock! Now, take a moment to be sure your contributions
make sense to everyone else.
Expand All @@ -20,13 +20,13 @@ scope and avoid unrelated commits.
1. To begin; [fork this project], clone your fork, and add our upstream.
```bash
# Clone your fork of the repo into the current directory
git clone git@github.com:YOUR_USER/postcss-overflow-shorthand.git
git clone https://github.com/<YOUR_USER>/postcss-plugins.git

# Navigate to the newly cloned directory
cd postcss-overflow-shorthand
cd postcss-plugins

# Assign the original repo to a remote called "upstream"
git remote add upstream git@github.com:jonathantneal/postcss-overflow-shorthand.git
git remote add upstream https://github.com/csstools/postcss-plugins.git

# Install the tools necessary for testing
npm install
Expand Down
15 changes: 0 additions & 15 deletions plugins/postcss-overflow-shorthand/.editorconfig

This file was deleted.

18 changes: 0 additions & 18 deletions plugins/postcss-overflow-shorthand/.github/workflows/test.yml

This file was deleted.

5 changes: 3 additions & 2 deletions plugins/postcss-overflow-shorthand/.gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
node_modules
index.*.*
dist
package-lock.json
yarn.lock
*.log*
*.result.css
.*
*.result.css.map
!.editorconfig
!.gitignore
!.rollup.js
!.tape.js
!.travis.yml
!.github
17 changes: 0 additions & 17 deletions plugins/postcss-overflow-shorthand/.rollup.js

This file was deleted.

2 changes: 1 addition & 1 deletion plugins/postcss-overflow-shorthand/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,6 @@ grunt.initConfig({
[PostCSS]: https://github.com/postcss/postcss
[PostCSS CLI]: https://github.com/postcss/postcss-cli
[PostCSS Loader]: https://github.com/postcss/postcss-loader
[PostCSS Overflow Shorthand]: https://github.com/jonathantneal/postcss-overflow-shorthand
[PostCSS Overflow Shorthand]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-overflow-shorthand
[React App Rewire PostCSS]: https://github.com/csstools/react-app-rewire-postcss
[React App Rewired]: https://github.com/timarney/react-app-rewired
6 changes: 3 additions & 3 deletions plugins/postcss-overflow-shorthand/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ html {
}
```

[cli-img]: https://github.com/csstools/postcss-overflow-shorthand/workflows/test/badge.svg
[cli-url]: https://github.com/csstools/postcss-overflow-shorthand/actions/workflows/test.yml?query=workflow/test
[cli-img]: https://github.com/csstools/postcss-plugins/workflows/test/badge.svg
[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test
[css-img]: https://cssdb.org/badge/overflow-property.svg
[css-url]: https://cssdb.org/#overflow-property
[git-img]: https://img.shields.io/badge/support-chat-blue.svg
Expand All @@ -87,4 +87,4 @@ html {
[Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss
[PostCSS]: https://github.com/postcss/postcss
[PostCSS Loader]: https://github.com/postcss/postcss-loader
[PostCSS Overflow Shorthand]: https://github.com/jonathantneal/postcss-overflow-shorthand
[PostCSS Overflow Shorthand]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-overflow-shorthand
67 changes: 27 additions & 40 deletions plugins/postcss-overflow-shorthand/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,54 +4,36 @@
"description": "Use the overflow shorthand in CSS",
"author": "Jonathan Neal <jonathantneal@hotmail.com>",
"license": "CC0-1.0",
"repository": "jonathantneal/postcss-overflow-shorthand",
"homepage": "https://github.com/jonathantneal/postcss-overflow-shorthand#readme",
"bugs": "https://github.com/jonathantneal/postcss-overflow-shorthand/issues",
"main": "index.cjs.js",
"module": "index.es.mjs",
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-overflow-shorthand#readme",
"bugs": "https://github.com/csstools/postcss-plugins/issues",
"main": "dist/index.cjs",
"module": "dist/index.mjs",
"files": [
"index.cjs.js",
"index.cjs.js.map",
"index.esm.mjs",
"index.esm.mjs.map"
"CHANGELOG.md",
"INSTALL.md",
"LICENSE.md",
"README.md",
"dist"
],
"bin": {
"postcss-overflow-shorthand": "dist/cli.mjs"
},
"scripts": {
"prepublishOnly": "npm test",
"pretest": "rollup -c .rollup.js --silent",
"test": "echo 'Running tests...'; npm run test:js && npm run test:tape",
"test:ec": "echint --ignore index.*.js test",
"test:js": "eslint *.js --cache --ignore-path .gitignore --quiet",
"test:tape": "postcss-tape"
"prepublishOnly": "npm run build && npm run test",
"lint": "eslint src/**/*.js",
"test": "postcss-tape",
"build": "rollup -c ../../rollup/default.js",
"stryker": "stryker run --logLevel error"
},
"engines": {
"node": ">=12"
},
"peerDependencies": {
"postcss": "^8.3"
"node": "^12 || ^14 || >=16"
},
"devDependencies": {
"@babel/core": "7.15.5",
"@babel/preset-env": "7.15.6",
"@rollup/plugin-babel": "5.3.0",
"eslint": "7.32.0",
"postcss": "8.3.6",
"postcss-tape": "6.0.1",
"pre-commit": "1.2.2",
"rollup": "2.56.3"
"postcss-tape": "6.0.1"
},
"eslintConfig": {
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 2020,
"impliedStrict": true,
"sourceType": "module"
},
"root": true
"peerDependencies": {
"postcss": "^8.3"
},
"keywords": [
"postcss",
Expand All @@ -61,5 +43,10 @@
"properties",
"shorthands",
"values"
]
],
"repository": {
"type": "git",
"url": "https://github.com/csstools/postcss-plugins.git",
"directory": "plugins/postcss-overflow-shorthand"
}
}
15 changes: 15 additions & 0 deletions plugins/postcss-overflow-shorthand/src/cli.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import plugin from './index';
import { cli, helpTextLogger } from '@csstools/base-cli';

cli(
plugin,
['preserve'],
helpTextLogger(
'postcss-overflow-shorthand',
'PostCSS Overflow Shorthand',
'Lets you use the `overflow` shorthand in CSS, following the CSS Overflow specification.',
{
preserve: true,
},
),
);
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ function onCSSDeclaration(postcssList, decl, preserve) {
// insert the overflow-* longhand declarations
decl.cloneBefore({
prop: `${decl.prop}-x`,
value: overflowX
value: overflowX,
});

decl.cloneBefore({
prop: `${decl.prop}-y`,
value: overflowY
value: overflowY,
});

// conditionally remove the original declaration
Expand All @@ -35,9 +35,9 @@ const creator = opts => {
onCSSDeclaration(list, decl, preserve);
}
},
}
};
};

creator.postcss = true
creator.postcss = true;

export default creator
export default creator;