Security News
NVD Backlog Tops 20,000 CVEs Awaiting Analysis as NIST Prepares System Updates
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
@csstools/postcss-content-alt-text
Advanced tools
Generate fallback values for content with alt text
npm install @csstools/postcss-content-alt-text --save-dev
PostCSS Content Alt Text generates fallback values for content
with alt text following the CSS Generated Content Module.
.foo {
content: url(tree.jpg) / "A beautiful tree in a dark forest";
}
.bar {
content: ">" / "";
}
/* becomes */
.foo {
content: url(tree.jpg) "A beautiful tree in a dark forest";
content: url(tree.jpg) / "A beautiful tree in a dark forest";
}
.bar {
content: ">" ;
content: ">" / "";
}
Add PostCSS Content Alt Text to your project:
npm install postcss @csstools/postcss-content-alt-text --save-dev
Use it as a PostCSS plugin:
const postcss = require('postcss');
const postcssContentAltText = require('@csstools/postcss-content-alt-text');
postcss([
postcssContentAltText(/* pluginOptions */)
]).process(YOUR_CSS /*, processOptions */);
The preserve
option determines whether the original notation
is preserved. By default, it is preserved.
postcssContentAltText({ preserve: false })
.foo {
content: url(tree.jpg) / "A beautiful tree in a dark forest";
}
.bar {
content: ">" / "";
}
/* becomes */
.foo {
content: url(tree.jpg) "A beautiful tree in a dark forest";
}
.bar {
content: ">" ;
}
The stripAltText
option determines whether the alt text is removed from the value.
By default, it is not removed.
Instead it is added to the content
value itself to ensure content is accessible.
Only set this to true
if you are sure the alt text is not needed.
postcssContentAltText({ stripAltText: true })
.foo {
content: url(tree.jpg) / "A beautiful tree in a dark forest";
}
.bar {
content: ">" / "";
}
/* becomes */
.foo {
content: url(tree.jpg) ;
content: url(tree.jpg) / "A beautiful tree in a dark forest";
}
.bar {
content: ">" ;
content: ">" / "";
}
FAQs
Generate fallback values for content with alt text
The npm package @csstools/postcss-content-alt-text receives a total of 443,795 weekly downloads. As such, @csstools/postcss-content-alt-text popularity was classified as popular.
We found that @csstools/postcss-content-alt-text demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.