Skip to content

logical-resize #792

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
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
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/css-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ body:
- PostCSS Lab Function
- PostCSS Logical
- PostCSS Logical Float and Clear
- PostCSS Logical Resize
- PostCSS Logical Viewport Units
- PostCSS Media Queries Aspect-Ratio Number Values
- PostCSS Media Query Ranges
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/plugin-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ body:
- PostCSS Lab Function
- PostCSS Logical
- PostCSS Logical Float and Clear
- PostCSS Logical Resize
- PostCSS Logical Viewport Units
- PostCSS Media Queries Aspect-Ratio Number Values
- PostCSS Media Query Ranges
Expand Down
4 changes: 4 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@
- plugins/postcss-logical-float-and-clear/**
- experimental/postcss-logical-float-and-clear/**

"plugins/postcss-logical-resize":
- plugins/postcss-logical-resize/**
- experimental/postcss-logical-resize/**

"plugins/postcss-logical-viewport-units":
- plugins/postcss-logical-viewport-units/**
- experimental/postcss-logical-viewport-units/**
Expand Down
27 changes: 27 additions & 0 deletions package-lock.json

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

25 changes: 0 additions & 25 deletions plugins/postcss-logical-float-and-clear/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
- [PostCSS CLI](#postcss-cli)
- [PostCSS Load Config](#postcss-load-config)
- [Webpack](#webpack)
- [Create React App](#create-react-app)
- [Next.js](#nextjs)
- [Gulp](#gulp)
- [Grunt](#grunt)
Expand Down Expand Up @@ -142,28 +141,6 @@ module.exports = {
};
```

## Create React App

Add [React App Rewired] and [React App Rewire PostCSS] to your project:

```bash
npm install react-app-rewired react-app-rewire-postcss @csstools/postcss-logical-float-and-clear --save-dev
```

Use [React App Rewire PostCSS] and [PostCSS Logical Float And Clear] in your
`config-overrides.js` file:

```js
const reactAppRewirePostcss = require('react-app-rewire-postcss');
const postcssLogicalFloatAndClear = require('@csstools/postcss-logical-float-and-clear');

module.exports = config => reactAppRewirePostcss(config, {
plugins: () => [
postcssLogicalFloatAndClear(/* pluginOptions */)
]
});
```

## Next.js

Read the instructions on how to [customize the PostCSS configuration in Next.js](https://nextjs.org/docs/advanced-features/customizing-postcss-config)
Expand Down Expand Up @@ -255,6 +232,4 @@ grunt.initConfig({
[PostCSS CLI]: https://github.com/postcss/postcss-cli
[PostCSS Loader]: https://github.com/postcss/postcss-loader
[PostCSS Logical Float And Clear]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-logical-float-and-clear
[React App Rewire PostCSS]: https://github.com/csstools/react-app-rewire-postcss
[React App Rewired]: https://github.com/timarney/react-app-rewired
[Next.js]: https://nextjs.org
3 changes: 1 addition & 2 deletions plugins/postcss-logical-float-and-clear/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ instructions for:
- [PostCSS CLI](INSTALL.md#postcss-cli)
- [PostCSS Load Config](INSTALL.md#postcss-load-config)
- [Webpack](INSTALL.md#webpack)
- [Create React App](INSTALL.md#create-react-app)
- [Next.js](INSTALL.md#nextjs)
- [Gulp](INSTALL.md#gulp)
- [Grunt](INSTALL.md#grunt)
Expand Down Expand Up @@ -84,7 +83,7 @@ Each direction must be one of the following:
- `left-to-right`
- `right-to-left`

Please do not that transformations won't run if `inlineDirection` becomes vertical.
Please do note that transformations won't run if `inlineDirection` becomes vertical.

[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test
[css-url]: https://cssdb.org/#float-clear-logical-values
Expand Down
14 changes: 10 additions & 4 deletions plugins/postcss-logical-float-and-clear/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,25 @@
"lint:eslint": "eslint ./src --ext .js --ext .ts --ext .mjs --no-error-on-unmatched-pattern",
"lint:package-json": "node ../../.github/bin/format-package-json.mjs",
"prepublishOnly": "npm run clean && npm run build && npm run test",
"stryker": "stryker run --logLevel error",
"test": "node .tape.mjs && npm run test:exports",
"test:exports": "node ./test/_import.mjs && node ./test/_require.cjs",
"test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs"
},
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-logical-float-and-clear#readme",
"repository": {
"type": "git",
"url": "https://github.com/csstools/postcss-plugins.git",
"directory": "plugins/postcss-logical-float-and-clear"
},
"bugs": "https://github.com/csstools/postcss-plugins/issues",
"keywords": [
"block",
"clear",
"css",
"float",
"inline",
"logical",
"postcss",
"postcss-plugin"
],
"csstools": {
Expand All @@ -70,7 +78,5 @@
},
"volta": {
"extends": "../../package.json"
},
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-logical-float-and-clear#readme",
"bugs": "https://github.com/csstools/postcss-plugins/issues"
}
}
6 changes: 6 additions & 0 deletions plugins/postcss-logical-resize/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
package-lock.json
yarn.lock
*.result.css
*.result.css.map
*.result.html
1 change: 1 addition & 0 deletions plugins/postcss-logical-resize/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18.8.0
44 changes: 44 additions & 0 deletions plugins/postcss-logical-resize/.tape.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import postcssTape from '../../packages/postcss-tape/dist/index.mjs';
import plugin from '@csstools/postcss-logical-resize';

postcssTape(plugin)({
'basic': {
message: 'basic test with default setting',
},
'basic:rtl': {
message: 'basic test with rtl',
options: {
inlineDirection: 'right-to-left'
},
},
'basic:bt': {
message: 'basic test with bt',
options: {
blockDirection: 'bottom-to-top'
},
},
'basic:rtl-and-bt': {
message: 'basic test with rtl and bt',
options: {
blockDirection: 'bottom-to-top',
inlineDirection: 'right-to-left'
},
},
'basic:chinese': {
message: 'basic test with rtl and bt',
options: {
blockDirection: 'right-to-left',
inlineDirection: 'top-to-bottom'
},
},
'examples/example': {
message: 'minimal example',
},
'examples/example:chinese': {
message: 'minimal example',
options: {
blockDirection: 'right-to-left',
inlineDirection: 'top-to-bottom'
}
},
});
5 changes: 5 additions & 0 deletions plugins/postcss-logical-resize/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changes to PostCSS Logical Resize

### 1.0.0 (Unreleased)

- Initial version
Loading