summaryrefslogtreecommitdiff
path: root/node_modules/@csstools/postcss-stepped-value-functions
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2023-10-14 15:05:55 +0800
committerlittleblack111 <littleblack11111@gmail.com>2023-10-14 15:05:55 +0800
commitc06f7ee0a40255214c477e13d9b956a7e07c2900 (patch)
treef5982a568ef8fab865d0142e71c7494fea3e4c1b /node_modules/@csstools/postcss-stepped-value-functions
parent3fd9400d4dccc25aa29b5702216732e0b7542073 (diff)
postcss,(plugins): nanocss, postcss-preset-env
Diffstat (limited to 'node_modules/@csstools/postcss-stepped-value-functions')
-rw-r--r--node_modules/@csstools/postcss-stepped-value-functions/CHANGELOG.md66
-rw-r--r--node_modules/@csstools/postcss-stepped-value-functions/LICENSE.md18
-rw-r--r--node_modules/@csstools/postcss-stepped-value-functions/README.md120
-rw-r--r--node_modules/@csstools/postcss-stepped-value-functions/dist/calc.d.ts1
-rw-r--r--node_modules/@csstools/postcss-stepped-value-functions/dist/checks.d.ts2
-rw-r--r--node_modules/@csstools/postcss-stepped-value-functions/dist/index.cjs1
-rw-r--r--node_modules/@csstools/postcss-stepped-value-functions/dist/index.d.ts8
-rw-r--r--node_modules/@csstools/postcss-stepped-value-functions/dist/index.mjs1
-rw-r--r--node_modules/@csstools/postcss-stepped-value-functions/package.json90
9 files changed, 307 insertions, 0 deletions
diff --git a/node_modules/@csstools/postcss-stepped-value-functions/CHANGELOG.md b/node_modules/@csstools/postcss-stepped-value-functions/CHANGELOG.md
new file mode 100644
index 00000000..5f310e1a
--- /dev/null
+++ b/node_modules/@csstools/postcss-stepped-value-functions/CHANGELOG.md
@@ -0,0 +1,66 @@
+# Changes to PostCSS Stepped Value Functions
+
+### 3.0.2
+
+_September 24, 2023_
+
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#221) (patch)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#232) (patch)
+- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.1.4`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#114) (patch)
+
+### 3.0.1
+
+_July 24, 2023_
+
+- Use the latest utilities from `@csstools/css-tokenizer` to reduce the bundle size.
+- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#220) (minor)
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#231) (patch)
+- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.1.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#113) (patch)
+
+### 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/))
+- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#230) (minor)
+- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.1.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#112) (patch)
+
+### 2.1.1
+
+_April 10, 2023_
+
+- Updated `@csstools/css-tokenizer` to `2.1.1` (patch)
+- Updated `@csstools/css-parser-algorithms` to `2.1.1` (patch)
+- Updated `@csstools/css-calc` to `1.1.1` (patch)
+
+### 2.1.0
+
+_February 21, 2023_
+
+- Removed: warnings on `var()` or otherwise unconvertible values (doesn't affect the output, non-breaking)
+- Added: `@csstools/css-calc`
+- Added: unit conversions (`mod(735ms, 0.1s)`)
+
+### 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
+
+_May 2, 2022_
+
+- Initial version
diff --git a/node_modules/@csstools/postcss-stepped-value-functions/LICENSE.md b/node_modules/@csstools/postcss-stepped-value-functions/LICENSE.md
new file mode 100644
index 00000000..e8ae93b9
--- /dev/null
+++ b/node_modules/@csstools/postcss-stepped-value-functions/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-stepped-value-functions/README.md b/node_modules/@csstools/postcss-stepped-value-functions/README.md
new file mode 100644
index 00000000..54a2a1c5
--- /dev/null
+++ b/node_modules/@csstools/postcss-stepped-value-functions/README.md
@@ -0,0 +1,120 @@
+# PostCSS Stepped Value Functions [<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-stepped-value-functions.svg" height="20">][npm-url] [<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/stepped-value-functions.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]
+
+```bash
+npm install @csstools/postcss-stepped-value-functions --save-dev
+```
+
+[PostCSS Stepped Value Functions] lets you use `round`, `rem` and `mod` stepped value functions, following the [CSS Values 4].
+
+```pcss
+.test-functions {
+ padding: 8px mod(18px, 5px) 1px calc(rem(15px, 6px) + 50%);
+ transform: rotate(mod(-140deg, -90deg));
+ top: round(15px, 4px);
+ right: round(nearest, 15px, 4px);
+ bottom: round(up, 15px, 7px);
+ left: round(down, 15px, 4px);
+ width: round(to-zero, 15px, 4px);
+}
+
+/* becomes */
+
+.test-functions {
+ padding: 8px 3px 1px calc(3px + 50%);
+ transform: rotate(-50deg);
+ top: 16px;
+ right: 16px;
+ bottom: 21px;
+ left: 12px;
+ width: 12px;
+}
+```
+
+## Usage
+
+Add [PostCSS Stepped Value Functions] to your project:
+
+```bash
+npm install postcss @csstools/postcss-stepped-value-functions --save-dev
+```
+
+Use it as a [PostCSS] plugin:
+
+```js
+const postcss = require('postcss');
+const postcssSteppedValueFunctions = require('@csstools/postcss-stepped-value-functions');
+
+postcss([
+ postcssSteppedValueFunctions(/* pluginOptions */)
+]).process(YOUR_CSS /*, processOptions */);
+```
+
+[PostCSS Stepped Value Functions] 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)
+
+## ⚠️ About custom properties
+
+Given the dynamic nature of custom properties it's impossible to know what the variable value is, which means the plugin can't compute a final value for the stylesheet.
+
+Because of that, any usage that contains a `var` is skipped.
+
+## Options
+
+### preserve
+
+The `preserve` option determines whether the original notation
+is preserved. By default, it is not preserved.
+
+```js
+postcssSteppedValueFunctions({ preserve: true })
+```
+
+```pcss
+.test-functions {
+ padding: 8px mod(18px, 5px) 1px calc(rem(15px, 6px) + 50%);
+ transform: rotate(mod(-140deg, -90deg));
+ top: round(15px, 4px);
+ right: round(nearest, 15px, 4px);
+ bottom: round(up, 15px, 7px);
+ left: round(down, 15px, 4px);
+ width: round(to-zero, 15px, 4px);
+}
+
+/* becomes */
+
+.test-functions {
+ padding: 8px 3px 1px calc(3px + 50%);
+ padding: 8px mod(18px, 5px) 1px calc(rem(15px, 6px) + 50%);
+ transform: rotate(-50deg);
+ transform: rotate(mod(-140deg, -90deg));
+ top: 16px;
+ top: round(15px, 4px);
+ right: 16px;
+ right: round(nearest, 15px, 4px);
+ bottom: 21px;
+ bottom: round(up, 15px, 7px);
+ left: 12px;
+ left: round(down, 15px, 4px);
+ width: 12px;
+ width: round(to-zero, 15px, 4px);
+}
+```
+
+[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test
+[css-url]: https://cssdb.org/#stepped-value-functions
+[discord]: https://discord.gg/bUadyRwkJS
+[npm-url]: https://www.npmjs.com/package/@csstools/postcss-stepped-value-functions
+
+[PostCSS]: https://github.com/postcss/postcss
+[PostCSS Stepped Value Functions]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-stepped-value-functions
+[CSS Values 4]: https://www.w3.org/TR/css-values-4/#round-func
diff --git a/node_modules/@csstools/postcss-stepped-value-functions/dist/calc.d.ts b/node_modules/@csstools/postcss-stepped-value-functions/dist/calc.d.ts
new file mode 100644
index 00000000..5a1ee11e
--- /dev/null
+++ b/node_modules/@csstools/postcss-stepped-value-functions/dist/calc.d.ts
@@ -0,0 +1 @@
+export declare function calc(css: string): string;
diff --git a/node_modules/@csstools/postcss-stepped-value-functions/dist/checks.d.ts b/node_modules/@csstools/postcss-stepped-value-functions/dist/checks.d.ts
new file mode 100644
index 00000000..6623beb7
--- /dev/null
+++ b/node_modules/@csstools/postcss-stepped-value-functions/dist/checks.d.ts
@@ -0,0 +1,2 @@
+export declare const FUNCTION_NAME_REGEXP: RegExp;
+export declare const FUNCTION_CALL_REGEXP: RegExp;
diff --git a/node_modules/@csstools/postcss-stepped-value-functions/dist/index.cjs b/node_modules/@csstools/postcss-stepped-value-functions/dist/index.cjs
new file mode 100644
index 00000000..0ccad206
--- /dev/null
+++ b/node_modules/@csstools/postcss-stepped-value-functions/dist/index.cjs
@@ -0,0 +1 @@
+"use strict";var e=require("@csstools/css-calc"),s=require("@csstools/css-parser-algorithms"),o=require("@csstools/css-tokenizer");const n=["mod","rem","round"],t=new RegExp(`^(${n.join("|")})$`,"i"),r=new RegExp(`(${n.join("|")})\\(`,"i");function calc(n){const r=o.tokenize({css:n});return r.some((e=>e[0]===o.TokenType.Function&&t.test(e[4].value)))?s.stringify(e.calcFromComponentValues(s.parseCommaSeparatedListOfComponentValues(r),{precision:5,toCanonicalUnits:!0})):n}const creator=e=>{const s=Object.assign({preserve:!1,onInvalid:""},e);return{postcssPlugin:"postcss-stepped-value-functions",Declaration(e){if(!r.test(e.value))return;const o=calc(e.value);o!==e.value&&(e.cloneBefore({value:o}),s.preserve||e.remove())}}};creator.postcss=!0,module.exports=creator;
diff --git a/node_modules/@csstools/postcss-stepped-value-functions/dist/index.d.ts b/node_modules/@csstools/postcss-stepped-value-functions/dist/index.d.ts
new file mode 100644
index 00000000..c7772f76
--- /dev/null
+++ b/node_modules/@csstools/postcss-stepped-value-functions/dist/index.d.ts
@@ -0,0 +1,8 @@
+import type { PluginCreator } from 'postcss';
+/** postcss-stepped-value-functions plugin options */
+export type pluginOptions = {
+ /** Preserve the original notation. default: false */
+ preserve?: boolean;
+};
+declare const creator: PluginCreator<pluginOptions>;
+export default creator;
diff --git a/node_modules/@csstools/postcss-stepped-value-functions/dist/index.mjs b/node_modules/@csstools/postcss-stepped-value-functions/dist/index.mjs
new file mode 100644
index 00000000..2e8dbdf0
--- /dev/null
+++ b/node_modules/@csstools/postcss-stepped-value-functions/dist/index.mjs
@@ -0,0 +1 @@
+import{calcFromComponentValues as s}from"@csstools/css-calc";import{stringify as o,parseCommaSeparatedListOfComponentValues as e}from"@csstools/css-parser-algorithms";import{tokenize as t,TokenType as n}from"@csstools/css-tokenizer";const c=["mod","rem","round"],r=new RegExp(`^(${c.join("|")})$`,"i"),i=new RegExp(`(${c.join("|")})\\(`,"i");function calc(c){const i=t({css:c});return i.some((s=>s[0]===n.Function&&r.test(s[4].value)))?o(s(e(i),{precision:5,toCanonicalUnits:!0})):c}const creator=s=>{const o=Object.assign({preserve:!1,onInvalid:""},s);return{postcssPlugin:"postcss-stepped-value-functions",Declaration(s){if(!i.test(s.value))return;const e=calc(s.value);e!==s.value&&(s.cloneBefore({value:e}),o.preserve||s.remove())}}};creator.postcss=!0;export{creator as default};
diff --git a/node_modules/@csstools/postcss-stepped-value-functions/package.json b/node_modules/@csstools/postcss-stepped-value-functions/package.json
new file mode 100644
index 00000000..eab24b20
--- /dev/null
+++ b/node_modules/@csstools/postcss-stepped-value-functions/package.json
@@ -0,0 +1,90 @@
+{
+ "name": "@csstools/postcss-stepped-value-functions",
+ "description": "Use round, rem and mod functions in CSS",
+ "version": "3.0.2",
+ "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"
+ ],
+ "dependencies": {
+ "@csstools/css-calc": "^1.1.4",
+ "@csstools/css-parser-algorithms": "^2.3.2",
+ "@csstools/css-tokenizer": "^2.2.1"
+ },
+ "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-stepped-value-functions#readme",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/csstools/postcss-plugins.git",
+ "directory": "plugins/postcss-stepped-value-functions"
+ },
+ "bugs": "https://github.com/csstools/postcss-plugins/issues",
+ "keywords": [
+ "css",
+ "modulus",
+ "postcss-plugin",
+ "remainder",
+ "round",
+ "stepped"
+ ],
+ "csstools": {
+ "cssdbId": "stepped-value-functions",
+ "exportName": "postcssSteppedValueFunctions",
+ "humanReadableName": "PostCSS Stepped Value Functions",
+ "specUrl": "https://www.w3.org/TR/css-values-4/#round-func"
+ },
+ "volta": {
+ "extends": "../../package.json"
+ }
+}