{"name":"@csstools/postcss-content-alt-text","description":"Generate fallback values for content with alt text","version":"1.0.0","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"},"type":"module","main":"dist/index.cjs","module":"dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.mjs"},"require":{"default":"./dist/index.cjs"}}},"dependencies":{"@csstools/css-parser-algorithms":"^2.7.1","@csstools/css-tokenizer":"^2.4.1","@csstools/postcss-progressive-custom-properties":"^3.3.0","@csstools/utilities":"^1.0.0"},"peerDependencies":{"postcss":"^8.4"},"scripts":{},"homepage":"https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-content-alt-text#readme","repository":{"type":"git","url":"git+https://github.com/csstools/postcss-plugins.git","directory":"plugins/postcss-content-alt-text"},"bugs":{"url":"https://github.com/csstools/postcss-plugins/issues"},"keywords":["accessibility","alt","content","css","csswg","fallback","postcss-plugin","w3c"],"_id":"@csstools/postcss-content-alt-text@1.0.0","gitHead":"094527efb5d3e223038165241af86013f4f21658","types":"./dist/index.d.ts","_nodeVersion":"22.1.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-SkHdj7EMM/57GVvSxSELpUg7zb5eAndBeuvGwFzYtU06/QXJ/h9fuK7wO5suteJzGhm3GDF/EWPCdWV2h1IGHQ==","shasum":"f69f74cd7ff679a912a444a274f67b9e0ce67127","tarball":"http://registry-npm.ywwl.com/@csstools/postcss-content-alt-text/download/@csstools/postcss-content-alt-text-1.0.0.tgz","fileCount":7,"unpackedSize":9289,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDMxrW/XkS84jTVk/8UCW6IXDNBrX5uy1rrvt0XCJM6GQIgcv1IP2gxfIIiJpZTuwF27LdmikhjUq/esQcKLeftx+A="}],"size":3533,"noattachment":false,"key":"/@csstools/postcss-content-alt-text/-/@csstools/postcss-content-alt-text-1.0.0.tgz"},"_npmUser":{"name":"romainmenke","email":"romainmenke@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/postcss-content-alt-text_1.0.0_1720359692032_0.5506214815133073"},"_hasShrinkwrap":false,"readme":"# PostCSS Content Alt Text [<img src=\"https://postcss.github.io/postcss/logo.svg\" alt=\"PostCSS Logo\" width=\"90\" height=\"90\" align=\"right\">][PostCSS]\n\n[<img alt=\"npm version\" src=\"https://img.shields.io/npm/v/@csstools/postcss-content-alt-text.svg\" height=\"20\">][npm-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]<br><br>[<img alt=\"Baseline Status\" src=\"https://cssdb.org/images/badges-baseline/content-alt-text.svg\" height=\"20\">][css-url] [<img alt=\"CSS Standard Status\" src=\"https://cssdb.org/images/badges/content-alt-text.svg\" height=\"20\">][css-url] \n\n```bash\nnpm install @csstools/postcss-content-alt-text --save-dev\n```\n\n[PostCSS Content Alt Text] generates fallback values for `content` with alt text following the [CSS Generated Content Module].\n\n```pcss\n.foo {\n\tcontent: url(tree.jpg) / \"A beautiful tree in a dark forest\";\n}\n\n/* becomes */\n\n.foo {\n\tcontent: url(tree.jpg)  \"A beautiful tree in a dark forest\";\n\tcontent: url(tree.jpg) / \"A beautiful tree in a dark forest\";\n}\n```\n\n## Usage\n\nAdd [PostCSS Content Alt Text] to your project:\n\n```bash\nnpm install postcss @csstools/postcss-content-alt-text --save-dev\n```\n\nUse it as a [PostCSS] plugin:\n\n```js\nconst postcss = require('postcss');\nconst postcssContentAltText = require('@csstools/postcss-content-alt-text');\n\npostcss([\n\tpostcssContentAltText(/* pluginOptions */)\n]).process(YOUR_CSS /*, processOptions */);\n```\n\n[PostCSS Content Alt Text] runs in all Node environments, with special\ninstructions for:\n\n- [Node](INSTALL.md#node)\n- [PostCSS CLI](INSTALL.md#postcss-cli)\n- [PostCSS Load Config](INSTALL.md#postcss-load-config)\n- [Webpack](INSTALL.md#webpack)\n- [Next.js](INSTALL.md#nextjs)\n- [Gulp](INSTALL.md#gulp)\n- [Grunt](INSTALL.md#grunt)\n\n## Options\n\n### preserve\n\nThe `preserve` option determines whether the original notation\nis preserved. By default, it is preserved.\n\n```js\npostcssContentAltText({ preserve: false })\n```\n\n```pcss\n.foo {\n\tcontent: url(tree.jpg) / \"A beautiful tree in a dark forest\";\n}\n\n/* becomes */\n\n.foo {\n\tcontent: url(tree.jpg)  \"A beautiful tree in a dark forest\";\n}\n```\n\n### stripAltText\n\nThe `stripAltText` option determines whether the alt text is removed from the value.  \nBy default, it is not removed.  \nInstead it is added to the `content` value itself to ensure content is accessible.\n\nOnly set this to `true` if you are sure the alt text is not needed.\n\n```js\npostcssContentAltText({ stripAltText: true })\n```\n\n```pcss\n.foo {\n\tcontent: url(tree.jpg) / \"A beautiful tree in a dark forest\";\n}\n\n/* becomes */\n\n.foo {\n\tcontent: url(tree.jpg) ;\n\tcontent: url(tree.jpg) / \"A beautiful tree in a dark forest\";\n}\n```\n\n[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test\n[css-url]: https://cssdb.org/#content-alt-text\n[discord]: https://discord.gg/bUadyRwkJS\n[npm-url]: https://www.npmjs.com/package/@csstools/postcss-content-alt-text\n\n[PostCSS]: https://github.com/postcss/postcss\n[PostCSS Content Alt Text]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-content-alt-text\n[CSS Generated Content Module]: https://drafts.csswg.org/css-content/#content-property\n","publish_time":1720359692205,"maintainers":[{"name":"romainmenke","email":"romainmenke@gmail.com"},{"name":"alaguna","email":"sombragriselros@gmail.com"},{"name":"jonathantneal","email":"jonathantneal@hotmail.com"}],"_cnpm_publish_time":1720359692205,"dist-tags":{"latest":"3.0.9"}}