Skip to content

Commit c90f8e1

Browse files
authored
postcss-preset-env: v10.1 (#1513)
1 parent 3bb33c7 commit c90f8e1

39 files changed

+801
-36
lines changed

package-lock.json

Lines changed: 6 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/css-calc/test/additional/random.mjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,13 @@ assert.strictEqual(
130130
calc('random(10deg, 10px)'),
131131
'random(10deg, 10px)',
132132
);
133+
134+
assert.strictEqual(
135+
calc('random(0%, 100%)'),
136+
'47.16924%',
137+
);
138+
139+
assert.strictEqual(
140+
calc('random(0deg, 360deg)'),
141+
'173.25527deg',
142+
);

plugin-packs/postcss-preset-env/CHANGELOG.md

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,10 @@
11
# Changes to PostCSS Preset Env
22

3-
### Unreleased (patch)
4-
5-
- Updated [`@csstools/postcss-exponential-functions`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-exponential-functions) to [`2.0.5`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-exponential-functions/CHANGELOG.md#205) (patch)
6-
- Updated [`@csstools/postcss-media-minmax`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-media-minmax) to [`2.0.5`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-media-minmax/CHANGELOG.md#205) (patch)
7-
- Updated [`@csstools/postcss-stepped-value-functions`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-stepped-value-functions) to [`4.0.5`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-stepped-value-functions/CHANGELOG.md#405) (patch)
8-
- Updated [`@csstools/postcss-trigonometric-functions`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-trigonometric-functions) to [`4.0.5`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-trigonometric-functions/CHANGELOG.md#405) (patch)
9-
- Updated [`@csstools/postcss-color-function`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-function) to [`4.0.6`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-function/CHANGELOG.md#406) (patch)
10-
- Updated [`@csstools/postcss-color-mix-function`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-mix-function) to [`3.0.6`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-mix-function/CHANGELOG.md#306) (patch)
11-
- Updated [`@csstools/postcss-gamut-mapping`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-gamut-mapping) to [`2.0.6`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-gamut-mapping/CHANGELOG.md#206) (patch)
12-
- Updated [`@csstools/postcss-gradients-interpolation-method`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-gradients-interpolation-method) to [`5.0.6`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-gradients-interpolation-method/CHANGELOG.md#506) (patch)
13-
- Updated [`@csstools/postcss-hwb-function`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-hwb-function) to [`4.0.6`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-hwb-function/CHANGELOG.md#406) (patch)
14-
- Updated [`@csstools/postcss-oklab-function`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-oklab-function) to [`4.0.6`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-oklab-function/CHANGELOG.md#406) (patch)
15-
- Updated [`@csstools/postcss-relative-color-syntax`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-relative-color-syntax) to [`3.0.6`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-relative-color-syntax/CHANGELOG.md#306) (patch)
16-
- Updated [`postcss-color-functional-notation`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-functional-notation) to [`7.0.6`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-functional-notation/CHANGELOG.md#706) (patch)
17-
- Updated [`postcss-lab-function`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-lab-function) to [`7.0.6`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-lab-function/CHANGELOG.md#706) (patch)
3+
### Unreleased (minor)
4+
5+
- Added `@csstools/postcss-random-function` [Check the plugin README](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-random-function#readme) for usage details.
6+
- Added `@csstools/postcss-sign-functions` [Check the plugin README](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-sign-functions#readme) for usage details.
7+
- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`2.1.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#210) (minor)
188

199
### 10.0.9
2010

plugin-packs/postcss-preset-env/FEATURES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,11 @@ The `ID` listed is the key for PostCSS Preset Env configuration in your project.
5454
| [<img alt="Baseline Status" src="https://cssdb.org/images/badges-baseline/overflow-wrap-property.svg" height="18">](https://cssdb.org/#overflow-wrap-property) | `overflow-wrap-property` | `overflow-wrap` Property | [example](https://preset-env.cssdb.org/features/#overflow-wrap-property) | [docs](https://github.com/mattdimu/postcss-replace-overflow-wrap#readme) |
5555
| [<img alt="Baseline Status" src="https://cssdb.org/images/badges-baseline/place-properties.svg" height="18">](https://cssdb.org/#place-properties) | `place-properties` | Place Properties | [example](https://preset-env.cssdb.org/features/#place-properties) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-place#readme) |
5656
| [<img alt="Baseline Status" src="https://cssdb.org/images/badges-baseline/prefers-color-scheme-query.svg" height="18">](https://cssdb.org/#prefers-color-scheme-query) | `prefers-color-scheme-query` | `prefers-color-scheme` Media Query | [example](https://preset-env.cssdb.org/features/#prefers-color-scheme-query) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/css-prefers-color-scheme#readme) |
57+
| [<img alt="Baseline Status" src="https://cssdb.org/images/badges-baseline/random-function.svg" height="18">](https://cssdb.org/#random-function) | `random-function` | `random()` function | [example](https://preset-env.cssdb.org/features/#random-function) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-random-function#readme) |
5758
| [<img alt="Baseline Status" src="https://cssdb.org/images/badges-baseline/rebeccapurple-color.svg" height="18">](https://cssdb.org/#rebeccapurple-color) | `rebeccapurple-color` | `rebeccapurple` Color | [example](https://preset-env.cssdb.org/features/#rebeccapurple-color) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-rebeccapurple#readme) |
5859
| [<img alt="Baseline Status" src="https://cssdb.org/images/badges-baseline/relative-color-syntax.svg" height="18">](https://cssdb.org/#relative-color-syntax) | `relative-color-syntax` | Relative Colors | [example](https://preset-env.cssdb.org/features/#relative-color-syntax) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-relative-color-syntax#readme) |
5960
| [<img alt="Baseline Status" src="https://cssdb.org/images/badges-baseline/scope-pseudo-class.svg" height="18">](https://cssdb.org/#scope-pseudo-class) | `scope-pseudo-class` | `:scope()` Reference Element Pseudo-class | [example](https://preset-env.cssdb.org/features/#scope-pseudo-class) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-scope-pseudo-class#readme) |
61+
| [<img alt="Baseline Status" src="https://cssdb.org/images/badges-baseline/sign-functions.svg" height="18">](https://cssdb.org/#sign-functions) | `sign-functions` | `abs()` and `sign()` functions | [example](https://preset-env.cssdb.org/features/#sign-functions) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-sign-functions#readme) |
6062
| [<img alt="Baseline Status" src="https://cssdb.org/images/badges-baseline/stepped-value-functions.svg" height="18">](https://cssdb.org/#stepped-value-functions) | `stepped-value-functions` | `round()`, `mod()` and `rem()` functions | [example](https://preset-env.cssdb.org/features/#stepped-value-functions) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-stepped-value-functions#readme) |
6163
| [<img alt="Baseline Status" src="https://cssdb.org/images/badges-baseline/system-ui-font-family.svg" height="18">](https://cssdb.org/#system-ui-font-family) | `system-ui-font-family` | `system-ui` Font Family | [example](https://preset-env.cssdb.org/features/#system-ui-font-family) | [docs](https://github.com/JLHwung/postcss-font-family-system-ui#readme) |
6264
| [<img alt="Baseline Status" src="https://cssdb.org/images/badges-baseline/text-decoration-shorthand.svg" height="18">](https://cssdb.org/#text-decoration-shorthand) | `text-decoration-shorthand` | `text-decoration` shorthand | [example](https://preset-env.cssdb.org/features/#text-decoration-shorthand) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-text-decoration-shorthand#readme) |

plugin-packs/postcss-preset-env/dist/index.cjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

plugin-packs/postcss-preset-env/dist/index.d.ts

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,16 @@ import type { pluginOptions as pluginOptions_43 } from '@csstools/postcss-oklab-
4040
import type { pluginOptions as pluginOptions_44 } from 'postcss-overflow-shorthand';
4141
import type { pluginOptions as pluginOptions_45 } from 'postcss-place';
4242
import type { pluginOptions as pluginOptions_46 } from 'css-prefers-color-scheme';
43-
import type { pluginOptions as pluginOptions_47 } from 'postcss-color-rebeccapurple';
44-
import type { pluginOptions as pluginOptions_48 } from '@csstools/postcss-relative-color-syntax';
45-
import type { pluginOptions as pluginOptions_49 } from '@csstools/postcss-scope-pseudo-class';
43+
import type { pluginOptions as pluginOptions_47 } from '@csstools/postcss-random-function';
44+
import type { pluginOptions as pluginOptions_48 } from 'postcss-color-rebeccapurple';
45+
import type { pluginOptions as pluginOptions_49 } from '@csstools/postcss-relative-color-syntax';
4646
import type { pluginOptions as pluginOptions_5 } from '@csstools/postcss-cascade-layers';
47-
import type { pluginOptions as pluginOptions_50 } from '@csstools/postcss-stepped-value-functions';
48-
import type { pluginOptions as pluginOptions_51 } from '@csstools/postcss-text-decoration-shorthand';
49-
import type { pluginOptions as pluginOptions_52 } from '@csstools/postcss-trigonometric-functions';
50-
import type { pluginOptions as pluginOptions_53 } from '@csstools/postcss-unset-value';
47+
import type { pluginOptions as pluginOptions_50 } from '@csstools/postcss-scope-pseudo-class';
48+
import type { pluginOptions as pluginOptions_51 } from '@csstools/postcss-sign-functions';
49+
import type { pluginOptions as pluginOptions_52 } from '@csstools/postcss-stepped-value-functions';
50+
import type { pluginOptions as pluginOptions_53 } from '@csstools/postcss-text-decoration-shorthand';
51+
import type { pluginOptions as pluginOptions_54 } from '@csstools/postcss-trigonometric-functions';
52+
import type { pluginOptions as pluginOptions_55 } from '@csstools/postcss-unset-value';
5153
import type { pluginOptions as pluginOptions_6 } from 'postcss-attribute-case-insensitive';
5254
import type { pluginOptions as pluginOptions_7 } from '@csstools/postcss-color-function';
5355
import type { pluginOptions as pluginOptions_8 } from 'postcss-color-functional-notation';
@@ -249,22 +251,26 @@ export declare type pluginsOptions = {
249251
'place-properties'?: subPluginOptions<pluginOptions_45>;
250252
/** plugin options for "css-prefers-color-scheme" */
251253
'prefers-color-scheme-query'?: subPluginOptions<pluginOptions_46>;
254+
/** plugin options for "@csstools/postcss-random-function" */
255+
'random-function'?: subPluginOptions<pluginOptions_47>;
252256
/** plugin options for "postcss-color-rebeccapurple" */
253-
'rebeccapurple-color'?: subPluginOptions<pluginOptions_47>;
257+
'rebeccapurple-color'?: subPluginOptions<pluginOptions_48>;
254258
/** plugin options for "@csstools/postcss-relative-color-syntax" */
255-
'relative-color-syntax'?: subPluginOptions<pluginOptions_48>;
259+
'relative-color-syntax'?: subPluginOptions<pluginOptions_49>;
256260
/** plugin options for "@csstools/postcss-scope-pseudo-class" */
257-
'scope-pseudo-class'?: subPluginOptions<pluginOptions_49>;
261+
'scope-pseudo-class'?: subPluginOptions<pluginOptions_50>;
262+
/** plugin options for "@csstools/postcss-sign-functions" */
263+
'sign-functions'?: subPluginOptions<pluginOptions_51>;
258264
/** plugin options for "@csstools/postcss-stepped-value-functions" */
259-
'stepped-value-functions'?: subPluginOptions<pluginOptions_50>;
265+
'stepped-value-functions'?: subPluginOptions<pluginOptions_52>;
260266
/** plugin options for "postcss-system-ui-font-family" */
261267
'system-ui-font-family'?: subPluginOptions<postcssFontFamilySystemUIOptions>;
262268
/** plugin options for "@csstools/postcss-text-decoration-shorthand" */
263-
'text-decoration-shorthand'?: subPluginOptions<pluginOptions_51>;
269+
'text-decoration-shorthand'?: subPluginOptions<pluginOptions_53>;
264270
/** plugin options for "@csstools/postcss-trigonometric-functions" */
265-
'trigonometric-functions'?: subPluginOptions<pluginOptions_52>;
271+
'trigonometric-functions'?: subPluginOptions<pluginOptions_54>;
266272
/** plugin options for "@csstools/postcss-unset-value" */
267-
'unset-value'?: subPluginOptions<pluginOptions_53>;
273+
'unset-value'?: subPluginOptions<pluginOptions_55>;
268274
};
269275

270276
/** postcss-clamp plugin options */

plugin-packs/postcss-preset-env/dist/index.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

plugin-packs/postcss-preset-env/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,10 @@
7676
"@csstools/postcss-normalize-display-values": "^4.0.0",
7777
"@csstools/postcss-oklab-function": "^4.0.6",
7878
"@csstools/postcss-progressive-custom-properties": "^4.0.0",
79+
"@csstools/postcss-random-function": "^1.0.0",
7980
"@csstools/postcss-relative-color-syntax": "^3.0.6",
8081
"@csstools/postcss-scope-pseudo-class": "^4.0.1",
82+
"@csstools/postcss-sign-functions": "^1.0.0",
8183
"@csstools/postcss-stepped-value-functions": "^4.0.5",
8284
"@csstools/postcss-text-decoration-shorthand": "^4.0.1",
8385
"@csstools/postcss-trigonometric-functions": "^4.0.5",
@@ -87,7 +89,7 @@
8789
"css-blank-pseudo": "^7.0.1",
8890
"css-has-pseudo": "^7.0.1",
8991
"css-prefers-color-scheme": "^10.0.0",
90-
"cssdb": "^8.2.0",
92+
"cssdb": "^8.2.1",
9193
"postcss-attribute-case-insensitive": "^7.0.1",
9294
"postcss-clamp": "^4.1.0",
9395
"postcss-color-functional-notation": "^7.0.6",

plugin-packs/postcss-preset-env/scripts/plugins-data.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,16 @@
290290
"id": "text-decoration-shorthand",
291291
"importName": "postcssTextDecorationShorthand"
292292
},
293+
{
294+
"packageName": "@csstools/postcss-sign-functions",
295+
"id": "sign-functions",
296+
"importName": "postcssSignFunctions"
297+
},
298+
{
299+
"packageName": "@csstools/postcss-random-function",
300+
"id": "random-function",
301+
"importName": "postcssRandomFunction"
302+
},
293303
{
294304
"packageName": "@csstools/postcss-progressive-custom-properties",
295305
"id": "progressive-custom-properties",

plugin-packs/postcss-preset-env/src/lib/ids-by-execution-order.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ export default [
5353
'unset-value',
5454

5555
// Math functions.
56+
'random-function',
57+
'sign-functions',
5658
'stepped-value-functions',
5759
'trigonometric-functions',
5860
'exponential-functions',

plugin-packs/postcss-preset-env/src/plugins/plugins-by-id.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,11 @@ import postcssReplaceOverflowWrap from 'postcss-replace-overflow-wrap';
4949
import postcssPlace from 'postcss-place';
5050
import postcssPrefersColorScheme from 'css-prefers-color-scheme';
5151
import postcssProgressiveCustomProperties from '@csstools/postcss-progressive-custom-properties';
52+
import postcssRandomFunction from '@csstools/postcss-random-function';
5253
import postcssColorRebeccapurple from 'postcss-color-rebeccapurple';
5354
import postcssRelativeColorSyntax from '@csstools/postcss-relative-color-syntax';
5455
import postcssScopePseudoClass from '@csstools/postcss-scope-pseudo-class';
56+
import postcssSignFunctions from '@csstools/postcss-sign-functions';
5557
import postcssSteppedValueFunctions from '@csstools/postcss-stepped-value-functions';
5658
import postcssFontFamilySystemUI from '../patch/postcss-system-ui-font-family.mjs';
5759
import postcssTextDecorationShorthand from '@csstools/postcss-text-decoration-shorthand';
@@ -112,9 +114,11 @@ export const pluginsById = new Map(
112114
['place-properties', postcssPlace],
113115
['prefers-color-scheme-query', postcssPrefersColorScheme],
114116
['progressive-custom-properties', postcssProgressiveCustomProperties],
117+
['random-function', postcssRandomFunction],
115118
['rebeccapurple-color', postcssColorRebeccapurple],
116119
['relative-color-syntax', postcssRelativeColorSyntax],
117120
['scope-pseudo-class', postcssScopePseudoClass],
121+
['sign-functions', postcssSignFunctions],
118122
['stepped-value-functions', postcssSteppedValueFunctions],
119123
['system-ui-font-family', postcssFontFamilySystemUI],
120124
['text-decoration-shorthand', postcssTextDecorationShorthand],

plugin-packs/postcss-preset-env/src/plugins/plugins-data.mjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,16 @@ export default [
290290
'id': 'text-decoration-shorthand',
291291
'importName': 'postcssTextDecorationShorthand',
292292
},
293+
{
294+
'packageName': '@csstools/postcss-sign-functions',
295+
'id': 'sign-functions',
296+
'importName': 'postcssSignFunctions',
297+
},
298+
{
299+
'packageName': '@csstools/postcss-random-function',
300+
'id': 'random-function',
301+
'importName': 'postcssRandomFunction',
302+
},
293303
{
294304
'packageName': '@csstools/postcss-progressive-custom-properties',
295305
'id': 'progressive-custom-properties',

0 commit comments

Comments
 (0)