Skip to content

Commit 2a18295

Browse files
authored
Add postcss-custom-functions to postcss-preset-env (#1934)
1 parent c55aafa commit 2a18295

197 files changed

Lines changed: 3906 additions & 435 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

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

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

3+
### Unreleased (minor)
4+
5+
- Added `@csstools/postcss-custom-functions` [Check the plugin README](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-custom-functions#readme) for usage details.
6+
37
### 11.5.5
48

59
_October 1, 2026_

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ The `ID` listed is the key for PostCSS Preset Env configuration in your project.
2020
| [<img alt="Baseline Status" src="https://cssdb.org/images/badges-baseline/container-rule-prelude-list.svg" height="18">](https://cssdb.org/#container-rule-prelude-list) | `container-rule-prelude-list` | `@container` prelude list | [example](https://preset-env.cssdb.org/features/#container-rule-prelude-list) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-container-rule-prelude-list#readme) |
2121
| [<img alt="Baseline Status" src="https://cssdb.org/images/badges-baseline/content-alt-text.svg" height="18">](https://cssdb.org/#content-alt-text) | `content-alt-text` | Alt text for `content` | [example](https://preset-env.cssdb.org/features/#content-alt-text) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-content-alt-text#readme) |
2222
| [<img alt="Baseline Status" src="https://cssdb.org/images/badges-baseline/contrast-color-function.svg" height="18">](https://cssdb.org/#contrast-color-function) | `contrast-color-function` | `contrast-color()` Function | [example](https://preset-env.cssdb.org/features/#contrast-color-function) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-contrast-color-function#readme) |
23+
| | `custom-functions` | | | |
2324
| [<img alt="Baseline Status" src="https://cssdb.org/images/badges-baseline/custom-media-queries.svg" height="18">](https://cssdb.org/#custom-media-queries) | `custom-media-queries` | Custom Media Queries | [example](https://preset-env.cssdb.org/features/#custom-media-queries) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-custom-media#readme) |
2425
| [<img alt="Baseline Status" src="https://cssdb.org/images/badges-baseline/custom-properties.svg" height="18">](https://cssdb.org/#custom-properties) | `custom-properties` | Custom Properties | [example](https://preset-env.cssdb.org/features/#custom-properties) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-custom-properties#readme) |
2526
| [<img alt="Baseline Status" src="https://cssdb.org/images/badges-baseline/custom-selectors.svg" height="18">](https://cssdb.org/#custom-selectors) | `custom-selectors` | Custom Selectors | [example](https://preset-env.cssdb.org/features/#custom-selectors) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-custom-selectors#readme) |

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

Lines changed: 111 additions & 108 deletions
Large diffs are not rendered by default.

‎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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"@csstools/postcss-container-rule-prelude-list": "^1.0.3",
5555
"@csstools/postcss-content-alt-text": "^3.0.6",
5656
"@csstools/postcss-contrast-color-function": "^3.0.14",
57+
"@csstools/postcss-custom-functions": "^1.0.0",
5758
"@csstools/postcss-exponential-functions": "^3.0.8",
5859
"@csstools/postcss-fit-tolerance-property": "^1.0.1",
5960
"@csstools/postcss-font-format-keywords": "^5.0.0",

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,11 @@
364364
"id": "property-rule-optional-descriptors",
365365
"importName": "postcssPropertyRuleOptionalDescriptors"
366366
},
367+
{
368+
"packageName": "@csstools/postcss-custom-functions",
369+
"id": "custom-functions",
370+
"importName": "postcssCustomFunctions"
371+
},
367372
{
368373
"packageName": "@csstools/postcss-progressive-custom-properties",
369374
"id": "progressive-custom-properties",

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// ids ordered by required execution, then alphabetically
22
export default [
33
'mixins',
4+
'custom-functions',
45

56
'custom-media-queries',
67
'environment-variables', // run environment-variables here to access transpiled custom media params and properties
@@ -81,6 +82,6 @@ export default [
8182

8283
'cascade-layers',
8384

84-
'progressive-custom-properties',
8585
'gamut-mapping',
86+
'progressive-custom-properties',
8687
];

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import postcssColorMixVariadicFunctionArguments from '@csstools/postcss-color-mi
1414
import postcssContainerRulePreludeList from '@csstools/postcss-container-rule-prelude-list';
1515
import postcssContentAltText from '@csstools/postcss-content-alt-text';
1616
import postcssContrastColorFunction from '@csstools/postcss-contrast-color-function';
17+
import postcssCustomFunctions from '@csstools/postcss-custom-functions';
1718
import postcssCustomMedia from 'postcss-custom-media';
1819
import postcssCustomProperties from 'postcss-custom-properties';
1920
import postcssCustomSelectors from 'postcss-custom-selectors';
@@ -92,6 +93,7 @@ export const pluginsById = new Map(
9293
['container-rule-prelude-list', postcssContainerRulePreludeList],
9394
['content-alt-text', postcssContentAltText],
9495
['contrast-color-function', postcssContrastColorFunction],
96+
['custom-functions', postcssCustomFunctions],
9597
['custom-media-queries', postcssCustomMedia],
9698
['custom-properties', postcssCustomProperties],
9799
['custom-selectors', postcssCustomSelectors],

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,11 @@ export default [
364364
'id': 'property-rule-optional-descriptors',
365365
'importName': 'postcssPropertyRuleOptionalDescriptors',
366366
},
367+
{
368+
'packageName': '@csstools/postcss-custom-functions',
369+
'id': 'custom-functions',
370+
'importName': 'postcssCustomFunctions',
371+
},
367372
{
368373
'packageName': '@csstools/postcss-progressive-custom-properties',
369374
'id': 'progressive-custom-properties',

‎plugin-packs/postcss-preset-env/src/plugins/plugins-options.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import type { pluginOptions as postcssColorMixVariadicFunctionArgumentsOptions }
1414
import type { pluginOptions as postcssContainerRulePreludeListOptions } from '@csstools/postcss-container-rule-prelude-list';
1515
import type { pluginOptions as postcssContentAltTextOptions } from '@csstools/postcss-content-alt-text';
1616
import type { pluginOptions as postcssContrastColorFunctionOptions } from '@csstools/postcss-contrast-color-function';
17+
import type { pluginOptions as postcssCustomFunctionsOptions } from '@csstools/postcss-custom-functions';
1718
import type { pluginOptions as postcssCustomMediaOptions } from 'postcss-custom-media';
1819
import type { pluginOptions as postcssCustomPropertiesOptions } from 'postcss-custom-properties';
1920
import type { pluginOptions as postcssCustomSelectorsOptions } from 'postcss-custom-selectors';
@@ -107,6 +108,8 @@ export type pluginsOptions = {
107108
'content-alt-text'?: subPluginOptions<postcssContentAltTextOptions>
108109
/** plugin options for "@csstools/postcss-contrast-color-function" */
109110
'contrast-color-function'?: subPluginOptions<postcssContrastColorFunctionOptions>
111+
/** plugin options for "@csstools/postcss-custom-functions" */
112+
'custom-functions'?: subPluginOptions<postcssCustomFunctionsOptions>
110113
/** plugin options for "postcss-custom-media" */
111114
'custom-media-queries'?: subPluginOptions<postcssCustomMediaOptions>
112115
/** plugin options for "postcss-custom-properties" */

0 commit comments

Comments
 (0)