diff options
Diffstat (limited to 'node_modules/@csstools/postcss-normalize-display-values')
8 files changed, 245 insertions, 0 deletions
diff --git a/node_modules/@csstools/postcss-normalize-display-values/CHANGELOG.md b/node_modules/@csstools/postcss-normalize-display-values/CHANGELOG.md new file mode 100644 index 00000000..a1c02e84 --- /dev/null +++ b/node_modules/@csstools/postcss-normalize-display-values/CHANGELOG.md @@ -0,0 +1,37 @@ +# Changes to PostCSS Normalize Display Values + +### 3.0.1 + +_September 18, 2023_ + +- Improve performance + +### 3.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/)) + +### 2.0.1 + +_January 28, 2023_ + +- Improve `types` declaration in `package.json` + +### 2.0.0 + +_January 24, 2023_ + +- Updated: Support for Node v14+ (major). + +### 1.0.1 + +_July 8, 2022_ + +- Fix case insensitive matching. + +### 1.0.0 + +_January 25, 2022_ + +- Initial version diff --git a/node_modules/@csstools/postcss-normalize-display-values/LICENSE.md b/node_modules/@csstools/postcss-normalize-display-values/LICENSE.md new file mode 100644 index 00000000..e8ae93b9 --- /dev/null +++ b/node_modules/@csstools/postcss-normalize-display-values/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-normalize-display-values/README.md b/node_modules/@csstools/postcss-normalize-display-values/README.md new file mode 100644 index 00000000..5af8725b --- /dev/null +++ b/node_modules/@csstools/postcss-normalize-display-values/README.md @@ -0,0 +1,86 @@ +# PostCSS Normalize Display Values [<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-normalize-display-values.svg" height="20">][npm-url] +[<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/display-two-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 Normalize Display Values] lets you specify definition of outer and inner displays types for an element. + +```pcss +.element { + display: inline flow-root; +} + +/* becomes */ + +.element { + display: inline-block; + display: inline flow-root; +} +``` + +_See prior work by [cssnano](https://github.com/cssnano) here [postcss-normalize-display-values](https://github.com/cssnano/cssnano/tree/master/packages/postcss-normalize-display-values) +To ensure long term maintenance and to provide the needed features this plugin was recreated based on cssnano's work._ + +## Usage + +Add [PostCSS Normalize Display Values] to your project: + +```bash +npm install postcss @csstools/postcss-normalize-display-values --save-dev +``` + +Use it as a [PostCSS] plugin: + +```js +const postcss = require('postcss'); +const postcssNormalizeDisplayValues = require('@csstools/postcss-normalize-display-values'); + +postcss([ + postcssNormalizeDisplayValues(/* pluginOptions */) +]).process(YOUR_CSS /*, processOptions */); +``` + +[PostCSS Normalize Display Values] runs in all Node environments, with special +instructions for: + +| [Node](INSTALL.md#node) | [PostCSS CLI](INSTALL.md#postcss-cli) | [Webpack](INSTALL.md#webpack) | [Gulp](INSTALL.md#gulp) | [Grunt](INSTALL.md#grunt) | +| --- | --- | --- | --- | --- | + +## Options + +### preserve + +The `preserve` option determines whether the original source +is preserved. By default, it is preserved. + +```js +postcssNormalizeDisplayValues({ preserve: false }) +``` + +```pcss +.element { + display: inline flow-root; +} + +/* becomes */ + +.element { + display: inline-block; +} +``` + +[postcss]: https://github.com/postcss/postcss + +[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test +[css-url]: https://cssdb.org/#display-two-values +[discord]: https://discord.gg/bUadyRwkJS +[npm-url]: https://www.npmjs.com/package/@csstools/postcss-normalize-display-values + +[CSS Fonts]: https://www.w3.org/TR/css-display-3/#the-display-properties +[Gulp PostCSS]: https://github.com/postcss/gulp-postcss +[Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss +[PostCSS]: https://github.com/postcss/postcss +[PostCSS Loader]: https://github.com/postcss/postcss-loader +[PostCSS Normalize Display Values]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-normalize-display-values diff --git a/node_modules/@csstools/postcss-normalize-display-values/dist/index.cjs b/node_modules/@csstools/postcss-normalize-display-values/dist/index.cjs new file mode 100644 index 00000000..cdd54eb4 --- /dev/null +++ b/node_modules/@csstools/postcss-normalize-display-values/dist/index.cjs @@ -0,0 +1 @@ +"use strict";var e=require("postcss-value-parser"),l=new Map([["block,flow","block"],["block,flow-root","flow-root"],["inline,flow","inline"],["inline,flow-root","inline-block"],["run-in,flow","run-in"],["list-item,block,flow","list-item"],["inline,flow,list-item","inline list-item"],["block,flex","flex"],["inline,flex","inline-flex"],["block,grid","grid"],["inline,grid","inline-grid"],["inline,ruby","ruby"],["block,table","table"],["inline,table","inline-table"],["table-cell,flow","table-cell"],["table-caption,flow","table-caption"],["ruby-base,flow","ruby-base"],["ruby-text,flow","ruby-text"]]);function transform(n){const{nodes:t}=e(n);if(1===t.length)return n;const o=t.filter((e=>"word"===e.type)).map((e=>e.value.toLowerCase()));if(o.length<=1)return n;const i=l.get(o.join(","));return i||n}const n=/^display$/i,creator=e=>{const l=!("preserve"in Object(e))||Boolean(null==e?void 0:e.preserve);return{postcssPlugin:"postcss-normalize-display-values",prepare(){const e=new Map;return{Declaration(t){if(!n.test(t.prop))return;const o=t.value;if(!o)return;if(e.has(o))return void(t.value!==e.get(o)&&(t.cloneBefore({value:e.get(o)}),l||t.remove()));const i=transform(o);e.set(o,i),t.value!==i&&(t.cloneBefore({value:i}),l||t.remove())}}}}};creator.postcss=!0,module.exports=creator; diff --git a/node_modules/@csstools/postcss-normalize-display-values/dist/index.d.ts b/node_modules/@csstools/postcss-normalize-display-values/dist/index.d.ts new file mode 100644 index 00000000..b0606a31 --- /dev/null +++ b/node_modules/@csstools/postcss-normalize-display-values/dist/index.d.ts @@ -0,0 +1,8 @@ +import type { PluginCreator } from 'postcss'; +/** postcss-normalize-display-values plugin options */ +export type pluginOptions = { + /** Preserve the original notation. default: true */ + preserve?: boolean; +}; +declare const creator: PluginCreator<pluginOptions>; +export default creator; diff --git a/node_modules/@csstools/postcss-normalize-display-values/dist/index.mjs b/node_modules/@csstools/postcss-normalize-display-values/dist/index.mjs new file mode 100644 index 00000000..bda81c6d --- /dev/null +++ b/node_modules/@csstools/postcss-normalize-display-values/dist/index.mjs @@ -0,0 +1 @@ +import e from"postcss-value-parser";var l=new Map([["block,flow","block"],["block,flow-root","flow-root"],["inline,flow","inline"],["inline,flow-root","inline-block"],["run-in,flow","run-in"],["list-item,block,flow","list-item"],["inline,flow,list-item","inline list-item"],["block,flex","flex"],["inline,flex","inline-flex"],["block,grid","grid"],["inline,grid","inline-grid"],["inline,ruby","ruby"],["block,table","table"],["inline,table","inline-table"],["table-cell,flow","table-cell"],["table-caption,flow","table-caption"],["ruby-base,flow","ruby-base"],["ruby-text,flow","ruby-text"]]);function transform(n){const{nodes:o}=e(n);if(1===o.length)return n;const t=o.filter((e=>"word"===e.type)).map((e=>e.value.toLowerCase()));if(t.length<=1)return n;const i=l.get(t.join(","));return i||n}const n=/^display$/i,creator=e=>{const l=!("preserve"in Object(e))||Boolean(null==e?void 0:e.preserve);return{postcssPlugin:"postcss-normalize-display-values",prepare(){const e=new Map;return{Declaration(o){if(!n.test(o.prop))return;const t=o.value;if(!t)return;if(e.has(t))return void(o.value!==e.get(t)&&(o.cloneBefore({value:e.get(t)}),l||o.remove()));const i=transform(t);e.set(t,i),o.value!==i&&(o.cloneBefore({value:i}),l||o.remove())}}}}};creator.postcss=!0;export{creator as default}; diff --git a/node_modules/@csstools/postcss-normalize-display-values/dist/mappings.d.ts b/node_modules/@csstools/postcss-normalize-display-values/dist/mappings.d.ts new file mode 100644 index 00000000..7ca13f69 --- /dev/null +++ b/node_modules/@csstools/postcss-normalize-display-values/dist/mappings.d.ts @@ -0,0 +1,5 @@ +/** + * Specification: https://www.w3.org/TR/css-display-3/#the-display-properties + */ +declare const _default: Map<string, string>; +export default _default; diff --git a/node_modules/@csstools/postcss-normalize-display-values/package.json b/node_modules/@csstools/postcss-normalize-display-values/package.json new file mode 100644 index 00000000..d2fa0fad --- /dev/null +++ b/node_modules/@csstools/postcss-normalize-display-values/package.json @@ -0,0 +1,89 @@ +{ + "name": "@csstools/postcss-normalize-display-values", + "description": "Use two values display syntax for inner and outer display types.", + "version": "3.0.1", + "author": "Jonathan Neal <jonathantneal@hotmail.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" + ], + "dependencies": { + "postcss-value-parser": "^4.2.0" + }, + "peerDependencies": { + "postcss": "^8.4" + }, + "devDependencies": { + "@csstools/postcss-tape": "*" + }, + "scripts": { + "build": "rollup -c ../../rollup/default.mjs", + "docs": "node ../../.github/bin/generate-docs/install.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" + }, + "repository": { + "type": "git", + "url": "https://github.com/csstools/postcss-plugins.git", + "directory": "plugins/postcss-normalize-display-values" + }, + "keywords": [ + "block", + "css", + "display", + "flex", + "flow", + "flow-root", + "grid", + "inline", + "inline-block", + "inline-flex", + "inline-grid", + "inline-table", + "list-item", + "postcss-plugin", + "ruby", + "ruby-base", + "ruby-text", + "run-in", + "table", + "table-caption", + "table-cell" + ], + "csstools": { + "exportName": "postcssNormalizeDisplayValues", + "humanReadableName": "PostCSS Normalize Display Values" + }, + "volta": { + "extends": "../../package.json" + } +} |
