diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2023-10-14 15:05:55 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2023-10-14 15:05:55 +0800 |
| commit | c06f7ee0a40255214c477e13d9b956a7e07c2900 (patch) | |
| tree | f5982a568ef8fab865d0142e71c7494fea3e4c1b /node_modules/@csstools/postcss-logical-float-and-clear | |
| parent | 3fd9400d4dccc25aa29b5702216732e0b7542073 (diff) | |
postcss,(plugins): nanocss, postcss-preset-env
Diffstat (limited to 'node_modules/@csstools/postcss-logical-float-and-clear')
10 files changed, 252 insertions, 0 deletions
diff --git a/node_modules/@csstools/postcss-logical-float-and-clear/CHANGELOG.md b/node_modules/@csstools/postcss-logical-float-and-clear/CHANGELOG.md new file mode 100644 index 00000000..b11158f8 --- /dev/null +++ b/node_modules/@csstools/postcss-logical-float-and-clear/CHANGELOG.md @@ -0,0 +1,19 @@ +# Changes to PostCSS Logical Float And Clear + +### 2.0.0 + +_July 3, 2023_ + +- Change license to `MIT-0` ([read more about this change in the blog post](https://preset-env.cssdb.org/blog/license-change/)) + +### 1.0.1 + +_January 28, 2023_ + +- Improve `types` declaration in `package.json` + +### 1.0.0 + +_January 19, 2023_ + +- Initial version diff --git a/node_modules/@csstools/postcss-logical-float-and-clear/LICENSE.md b/node_modules/@csstools/postcss-logical-float-and-clear/LICENSE.md new file mode 100644 index 00000000..e8ae93b9 --- /dev/null +++ b/node_modules/@csstools/postcss-logical-float-and-clear/LICENSE.md @@ -0,0 +1,18 @@ +MIT No Attribution (MIT-0) + +Copyright © CSSTools Contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the “Software”), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@csstools/postcss-logical-float-and-clear/README.md b/node_modules/@csstools/postcss-logical-float-and-clear/README.md new file mode 100644 index 00000000..268c3085 --- /dev/null +++ b/node_modules/@csstools/postcss-logical-float-and-clear/README.md @@ -0,0 +1,95 @@ +# PostCSS Logical Float And Clear [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">][PostCSS] + +[<img alt="npm version" src="https://img.shields.io/npm/v/@csstools/postcss-logical-float-and-clear.svg" height="20">][npm-url] [<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/float-clear-logical-values.svg" height="20">][css-url] [<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/workflows/test/badge.svg" height="20">][cli-url] [<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord] + +[PostCSS Logical Float And Clear] lets you use logical, rather than physical, direction and dimension mappings in CSS, following the [CSS Logical Properties and Values] specification. + +```pcss +.element { + clear: inline-start; + float: inline-end; +} + +/* becomes */ + +.element { + clear: left; + float: right; +} +``` + +## Usage + +Add [PostCSS Logical Float And Clear] to your project: + +```bash +npm install postcss @csstools/postcss-logical-float-and-clear --save-dev +``` + +Use it as a [PostCSS] plugin: + +```js +const postcss = require('postcss'); +const postcssLogicalFloatAndClear = require('@csstools/postcss-logical-float-and-clear'); + +postcss([ + postcssLogicalFloatAndClear(/* pluginOptions */) +]).process(YOUR_CSS /*, processOptions */); +``` + +[PostCSS Logical Float And Clear] runs in all Node environments, with special +instructions for: + +- [Node](INSTALL.md#node) +- [PostCSS CLI](INSTALL.md#postcss-cli) +- [PostCSS Load Config](INSTALL.md#postcss-load-config) +- [Webpack](INSTALL.md#webpack) +- [Next.js](INSTALL.md#nextjs) +- [Gulp](INSTALL.md#gulp) +- [Grunt](INSTALL.md#grunt) + +## Options + +### inlineDirection + +The `inlineDirection` option allows you to specify the direction of the inline axe. The default value is `left-to-right` respectively which would match any latin language. + +You might want to tweak these value if you are using a different writing system, such as Arabic, Hebrew or Chinese for example. + +```js +postcssLogicalFloatAndClear({ + inlineDirection: 'right-to-left' +}) +``` + +```pcss +.element { + clear: inline-start; + float: inline-end; +} + +/* becomes */ + +.element { + clear: right; + float: left; +} +``` + +Each direction must be one of the following: + +- `top-to-bottom` +- `bottom-to-top` +- `left-to-right` +- `right-to-left` + +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 +[discord]: https://discord.gg/bUadyRwkJS +[npm-url]: https://www.npmjs.com/package/@csstools/postcss-logical-float-and-clear + +[PostCSS]: https://github.com/postcss/postcss +[PostCSS Logical Float And Clear]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-logical-float-and-clear +[CSS Logical Properties and Values]: https://www.w3.org/TR/css-logical-1/#float-clear diff --git a/node_modules/@csstools/postcss-logical-float-and-clear/dist/index.cjs b/node_modules/@csstools/postcss-logical-float-and-clear/dist/index.cjs new file mode 100644 index 00000000..c073727d --- /dev/null +++ b/node_modules/@csstools/postcss-logical-float-and-clear/dist/index.cjs @@ -0,0 +1 @@ +"use strict";const t="inline-start",o="inline-end";var e,i;function directionFlowToAxes(t){switch(t){case e.TopToBottom:return[i.Top,i.Bottom];case e.BottomToTop:return[i.Bottom,i.Top];case e.RightToLeft:return[i.Right,i.Left];case e.LeftToRight:return[i.Left,i.Right]}}function cloneDeclaration(t,o,e){t.parent&&t.parent.some((t=>"decl"==t.type&&t.prop===e&&t.value===o))||t.cloneBefore({value:o,prop:e})}!function(t){t.TopToBottom="top-to-bottom",t.BottomToTop="bottom-to-top",t.RightToLeft="right-to-left",t.LeftToRight="left-to-right"}(e||(e={})),function(t){t.Top="top",t.Right="right",t.Bottom="bottom",t.Left="left"}(i||(i={}));const creator=i=>{const n=Object.assign({inlineDirection:e.LeftToRight},i),c=Object.values(e);if(!c.includes(n.inlineDirection))throw new Error(`[postcss-logical-float-and-clear] "inlineDirection" must be one of ${c.join(", ")}`);if(![e.LeftToRight,e.RightToLeft].includes(n.inlineDirection))return{postcssPlugin:"postcss-logical-float-and-clear",Once(){}};const[r,l]=directionFlowToAxes(n.inlineDirection),makeTransform=e=>{const i=e.value.toLowerCase();if(![t,o].includes(i))return;cloneDeclaration(e,i===t?r:l,e.prop),e.remove()};return{postcssPlugin:"postcss-logical-float-and-clear",Declaration:{float:makeTransform,clear:makeTransform}}};creator.postcss=!0,module.exports=creator; diff --git a/node_modules/@csstools/postcss-logical-float-and-clear/dist/index.d.ts b/node_modules/@csstools/postcss-logical-float-and-clear/dist/index.d.ts new file mode 100644 index 00000000..8faa333f --- /dev/null +++ b/node_modules/@csstools/postcss-logical-float-and-clear/dist/index.d.ts @@ -0,0 +1,9 @@ +import type { PluginCreator } from 'postcss'; +import { DirectionFlow } from './lib/types'; +/** postcss-logical-float-and-clear plugin options */ +export type pluginOptions = { + /** Sets the direction for inline. default: left-to-right */ + inlineDirection?: DirectionFlow; +}; +declare const creator: PluginCreator<pluginOptions>; +export default creator; diff --git a/node_modules/@csstools/postcss-logical-float-and-clear/dist/index.mjs b/node_modules/@csstools/postcss-logical-float-and-clear/dist/index.mjs new file mode 100644 index 00000000..f05b6578 --- /dev/null +++ b/node_modules/@csstools/postcss-logical-float-and-clear/dist/index.mjs @@ -0,0 +1 @@ +const t="inline-start",o="inline-end";var e,n;function directionFlowToAxes(t){switch(t){case e.TopToBottom:return[n.Top,n.Bottom];case e.BottomToTop:return[n.Bottom,n.Top];case e.RightToLeft:return[n.Right,n.Left];case e.LeftToRight:return[n.Left,n.Right]}}function cloneDeclaration(t,o,e){t.parent&&t.parent.some((t=>"decl"==t.type&&t.prop===e&&t.value===o))||t.cloneBefore({value:o,prop:e})}!function(t){t.TopToBottom="top-to-bottom",t.BottomToTop="bottom-to-top",t.RightToLeft="right-to-left",t.LeftToRight="left-to-right"}(e||(e={})),function(t){t.Top="top",t.Right="right",t.Bottom="bottom",t.Left="left"}(n||(n={}));const creator=n=>{const i=Object.assign({inlineDirection:e.LeftToRight},n),c=Object.values(e);if(!c.includes(i.inlineDirection))throw new Error(`[postcss-logical-float-and-clear] "inlineDirection" must be one of ${c.join(", ")}`);if(![e.LeftToRight,e.RightToLeft].includes(i.inlineDirection))return{postcssPlugin:"postcss-logical-float-and-clear",Once(){}};const[r,l]=directionFlowToAxes(i.inlineDirection),makeTransform=e=>{const n=e.value.toLowerCase();if(![t,o].includes(n))return;cloneDeclaration(e,n===t?r:l,e.prop),e.remove()};return{postcssPlugin:"postcss-logical-float-and-clear",Declaration:{float:makeTransform,clear:makeTransform}}};creator.postcss=!0;export{creator as default}; diff --git a/node_modules/@csstools/postcss-logical-float-and-clear/dist/lib/clone-declaration.d.ts b/node_modules/@csstools/postcss-logical-float-and-clear/dist/lib/clone-declaration.d.ts new file mode 100644 index 00000000..1503bf6f --- /dev/null +++ b/node_modules/@csstools/postcss-logical-float-and-clear/dist/lib/clone-declaration.d.ts @@ -0,0 +1,2 @@ +import type { Declaration } from 'postcss'; +export declare function cloneDeclaration(declaration: Declaration, value: string, prop: string): void; diff --git a/node_modules/@csstools/postcss-logical-float-and-clear/dist/lib/types.d.ts b/node_modules/@csstools/postcss-logical-float-and-clear/dist/lib/types.d.ts new file mode 100644 index 00000000..2b3c47f9 --- /dev/null +++ b/node_modules/@csstools/postcss-logical-float-and-clear/dist/lib/types.d.ts @@ -0,0 +1,18 @@ +export declare const DirectionValues: { + BlockStart: string; + BlockEnd: string; + InlineStart: string; + InlineEnd: string; +}; +export declare enum DirectionFlow { + TopToBottom = "top-to-bottom", + BottomToTop = "bottom-to-top", + RightToLeft = "right-to-left", + LeftToRight = "left-to-right" +} +export declare enum Axes { + Top = "top", + Right = "right", + Bottom = "bottom", + Left = "left" +} diff --git a/node_modules/@csstools/postcss-logical-float-and-clear/dist/utils/direction-flow-to-axes.d.ts b/node_modules/@csstools/postcss-logical-float-and-clear/dist/utils/direction-flow-to-axes.d.ts new file mode 100644 index 00000000..2652d71d --- /dev/null +++ b/node_modules/@csstools/postcss-logical-float-and-clear/dist/utils/direction-flow-to-axes.d.ts @@ -0,0 +1,2 @@ +import { DirectionFlow, Axes } from '../lib/types'; +export declare function directionFlowToAxes(directionFlow: DirectionFlow): [Axes, Axes]; diff --git a/node_modules/@csstools/postcss-logical-float-and-clear/package.json b/node_modules/@csstools/postcss-logical-float-and-clear/package.json new file mode 100644 index 00000000..5738faeb --- /dev/null +++ b/node_modules/@csstools/postcss-logical-float-and-clear/package.json @@ -0,0 +1,87 @@ +{ + "name": "@csstools/postcss-logical-float-and-clear", + "description": "Use flow-relative (inline-start and inline-end) values for float and clear", + "version": "2.0.0", + "contributors": [ + { + "name": "Antonio Laguna", + "email": "antonio@laguna.es", + "url": "https://antonio.laguna.es" + }, + { + "name": "Romain Menke", + "email": "romainmenke@gmail.com" + } + ], + "license": "MIT-0", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "engines": { + "node": "^14 || ^16 || >=18" + }, + "main": "dist/index.cjs", + "module": "dist/index.mjs", + "types": "dist/index.d.ts", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.mjs", + "require": "./dist/index.cjs", + "default": "./dist/index.mjs" + } + }, + "files": [ + "CHANGELOG.md", + "LICENSE.md", + "README.md", + "dist" + ], + "peerDependencies": { + "postcss": "^8.4" + }, + "devDependencies": { + "@csstools/postcss-tape": "*" + }, + "scripts": { + "build": "rollup -c ../../rollup/default.mjs", + "docs": "node ../../.github/bin/generate-docs/install.mjs && node ../../.github/bin/generate-docs/readme.mjs", + "lint": "node ../../.github/bin/format-package-json.mjs", + "prepublishOnly": "npm run build && npm run test", + "test": "node .tape.mjs && 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": { + "cssdbId": "float-clear-logical-values", + "exportName": "postcssLogicalFloatAndClear", + "humanReadableName": "PostCSS Logical Float And Clear", + "specUrl": "https://www.w3.org/TR/css-logical-1/#float-clear" + }, + "volta": { + "extends": "../../package.json" + } +} |
