Skip to content

Commit

Permalink
postcss-preset-env: add postcss-content-alt-text (#1426)
Browse files Browse the repository at this point in the history
  • Loading branch information
romainmenke committed Jul 7, 2024
1 parent d3710d2 commit ac06c2e
Show file tree
Hide file tree
Showing 47 changed files with 579 additions and 111 deletions.
3 changes: 2 additions & 1 deletion cli/csstools-cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Changes to CSSTools CLI

### Unreleased (patch)
### Unreleased (minor)

- Added `@csstools/postcss-content-alt-text` [Check the plugin README](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-content-alt-text#readme) for usage details.
- Updated [`@csstools/postcss-color-function`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-function) to [`3.0.19`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-function/CHANGELOG.md#3019) (patch)
- Updated [`@csstools/postcss-color-mix-function`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-mix-function) to [`2.0.19`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-mix-function/CHANGELOG.md#2019) (patch)
- Updated [`@csstools/postcss-gradients-interpolation-method`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-gradients-interpolation-method) to [`4.0.20`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-gradients-interpolation-method/CHANGELOG.md#4020) (patch)
Expand Down
2 changes: 1 addition & 1 deletion cli/csstools-cli/dist/cli.cjs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions cli/csstools-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"@csstools/postcss-cascade-layers": "^4.0.6",
"@csstools/postcss-color-function": "^3.0.19",
"@csstools/postcss-color-mix-function": "^2.0.19",
"@csstools/postcss-content-alt-text": "^1.0.0",
"@csstools/postcss-exponential-functions": "^1.0.9",
"@csstools/postcss-font-format-keywords": "^3.0.2",
"@csstools/postcss-gradients-interpolation-method": "^4.0.20",
Expand Down
5 changes: 5 additions & 0 deletions cli/csstools-cli/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import postcssColorFunctionalNotation from './plugins/postcss-color-functional-n
import postcssColorHexAlpha from './plugins/postcss-color-hex-alpha';
import postcssColorMixFunction from './plugins/postcss-color-mix-function';
import postcssColorRebeccaPurple from './plugins/postcss-color-rebeccapurple';
import postcssContentAltText from './plugins/postcss-content-alt-text';
import postcssCustomMedia from './plugins/postcss-custom-media';
import postcssCustomProperties from './plugins/postcss-custom-properties';
import postcssCustomSelectors from './plugins/postcss-custom-selectors';
Expand Down Expand Up @@ -81,6 +82,9 @@ async function main(): Promise<void> {
case 'postcss-color-rebeccapurple':
await postcssColorRebeccaPurple();
return;
case 'postcss-content-alt-text':
await postcssContentAltText();
return;
case 'postcss-custom-media':
await postcssCustomMedia();
return;
Expand Down Expand Up @@ -218,6 +222,7 @@ async function main(): Promise<void> {
' postcss-color-hex-alpha',
' postcss-color-mix-function',
' postcss-color-rebeccapurple',
' postcss-content-alt-text',
' postcss-custom-media',
' postcss-custom-properties',
' postcss-custom-selectors',
Expand Down
20 changes: 20 additions & 0 deletions cli/csstools-cli/src/plugins/postcss-content-alt-text.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import plugin from '@csstools/postcss-content-alt-text';
import { cli, helpTextLogger } from '@csstools/base-cli';

export default async function postcssContentAltText(): Promise<void> {
await cli(
plugin,
['preserve', 'stripAltText', 'enableProgressiveCustomProperties'],
helpTextLogger(
'@csstools/cli postcss-content-alt-text',
'PostCSS Content Alt Text',
'Generate fallback values for content with alt text.',
{
preserve: true,
stripAltText: false,
enableProgressiveCustomProperties: true,
},
),
false,
);
}
10 changes: 6 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion plugin-packs/postcss-preset-env/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Changes to PostCSS Preset Env

### Unreleased (patch)
### Unreleased (minor)

- Added `@csstools/postcss-content-alt-text` [Check the plugin README](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-content-alt-text#readme) for usage details.
- Updated [`cssdb`](https://github.com/csstools/cssdb) to [`8.1.0`](https://github.com/csstools/cssdb/blob/main/CHANGELOG.md#810-jul-7-2024) (minor)
- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.3.0`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#330) (minor)
- Updated [`@csstools/postcss-color-function`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-function) to [`3.0.19`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-function/CHANGELOG.md#3019) (patch)
- Updated [`@csstools/postcss-color-mix-function`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-mix-function) to [`2.0.19`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-mix-function/CHANGELOG.md#2019) (patch)
Expand Down
1 change: 1 addition & 0 deletions plugin-packs/postcss-preset-env/FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ The `ID` listed is the key for PostCSS Preset Env configuration in your project.
| [<img alt="Baseline Status" src="https://cssdb.org/images/badges-baseline/color-function.svg" height="18">](https://cssdb.org/#color-function) | `color-function` | `color()` Function | [example](https://preset-env.cssdb.org/features/#color-function) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-function#readme) |
| [<img alt="Baseline Status" src="https://cssdb.org/images/badges-baseline/color-functional-notation.svg" height="18">](https://cssdb.org/#color-functional-notation) | `color-functional-notation` | Color Functional Notation | [example](https://preset-env.cssdb.org/features/#color-functional-notation) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-functional-notation#readme) |
| [<img alt="Baseline Status" src="https://cssdb.org/images/badges-baseline/color-mix.svg" height="18">](https://cssdb.org/#color-mix) | `color-mix` | `color-mix()` Function | [example](https://preset-env.cssdb.org/features/#color-mix) | [docs](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-mix-function#readme) |
| [<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) |
| [<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) |
| [<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) |
| [<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) |
Expand Down
2 changes: 1 addition & 1 deletion plugin-packs/postcss-preset-env/dist/index.cjs

Large diffs are not rendered by default.

Loading

0 comments on commit ac06c2e

Please sign in to comment.