Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
@csstools/postcss-content-alt-text
Advanced tools
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";
}
/* becomes */
.foo {
content: url(tree.jpg) "A beautiful tree in a dark forest";
content: url(tree.jpg) / "A beautiful tree in a dark forest";
}
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 */);
PostCSS Content Alt Text runs in all Node environments, with special instructions for:
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";
}
/* becomes */
.foo {
content: url(tree.jpg) "A beautiful tree in a dark forest";
}
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";
}
/* becomes */
.foo {
content: url(tree.jpg) ;
content: url(tree.jpg) / "A beautiful tree in a dark forest";
}
FAQs
Generate fallback values for content with alt text
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
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.