Skip to content

Commit ac06c2e

Browse files
authored
postcss-preset-env: add postcss-content-alt-text (#1426)
1 parent d3710d2 commit ac06c2e

Some content is hidden

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

47 files changed

+579
-111
lines changed

cli/csstools-cli/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Changes to CSSTools CLI
22

3-
### Unreleased (patch)
3+
### Unreleased (minor)
44

5+
- 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.
56
- 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)
67
- 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)
78
- 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)

cli/csstools-cli/dist/cli.cjs

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

cli/csstools-cli/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"@csstools/postcss-cascade-layers": "^4.0.6",
4242
"@csstools/postcss-color-function": "^3.0.19",
4343
"@csstools/postcss-color-mix-function": "^2.0.19",
44+
"@csstools/postcss-content-alt-text": "^1.0.0",
4445
"@csstools/postcss-exponential-functions": "^1.0.9",
4546
"@csstools/postcss-font-format-keywords": "^3.0.2",
4647
"@csstools/postcss-gradients-interpolation-method": "^4.0.20",

cli/csstools-cli/src/cli.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import postcssColorFunctionalNotation from './plugins/postcss-color-functional-n
88
import postcssColorHexAlpha from './plugins/postcss-color-hex-alpha';
99
import postcssColorMixFunction from './plugins/postcss-color-mix-function';
1010
import postcssColorRebeccaPurple from './plugins/postcss-color-rebeccapurple';
11+
import postcssContentAltText from './plugins/postcss-content-alt-text';
1112
import postcssCustomMedia from './plugins/postcss-custom-media';
1213
import postcssCustomProperties from './plugins/postcss-custom-properties';
1314
import postcssCustomSelectors from './plugins/postcss-custom-selectors';
@@ -81,6 +82,9 @@ async function main(): Promise<void> {
8182
case 'postcss-color-rebeccapurple':
8283
await postcssColorRebeccaPurple();
8384
return;
85+
case 'postcss-content-alt-text':
86+
await postcssContentAltText();
87+
return;
8488
case 'postcss-custom-media':
8589
await postcssCustomMedia();
8690
return;
@@ -218,6 +222,7 @@ async function main(): Promise<void> {
218222
' postcss-color-hex-alpha',
219223
' postcss-color-mix-function',
220224
' postcss-color-rebeccapurple',
225+
' postcss-content-alt-text',
221226
' postcss-custom-media',
222227
' postcss-custom-properties',
223228
' postcss-custom-selectors',
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import plugin from '@csstools/postcss-content-alt-text';
2+
import { cli, helpTextLogger } from '@csstools/base-cli';
3+
4+
export default async function postcssContentAltText(): Promise<void> {
5+
await cli(
6+
plugin,
7+
['preserve', 'stripAltText', 'enableProgressiveCustomProperties'],
8+
helpTextLogger(
9+
'@csstools/cli postcss-content-alt-text',
10+
'PostCSS Content Alt Text',
11+
'Generate fallback values for content with alt text.',
12+
{
13+
preserve: true,
14+
stripAltText: false,
15+
enableProgressiveCustomProperties: true,
16+
},
17+
),
18+
false,
19+
);
20+
}

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.

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Changes to PostCSS Preset Env
22

3-
### Unreleased (patch)
3+
### Unreleased (minor)
44

5+
- 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.
6+
- 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)
57
- 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)
68
- 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)
79
- 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)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ The `ID` listed is the key for PostCSS Preset Env configuration in your project.
1414
| [<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) |
1515
| [<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) |
1616
| [<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) |
17+
| [<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) |
1718
| [<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) |
1819
| [<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) |
1920
| [<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.cjs

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

0 commit comments

Comments
 (0)