
Security News
Next.js Patches Critical Middleware Vulnerability (CVE-2025-29927)
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.
@csstools/postcss-initial
Advanced tools
@csstools/postcss-initial is a PostCSS plugin that allows you to reset CSS properties to their initial values. This can be particularly useful for ensuring consistent styling across different browsers and user agents by explicitly setting properties to their default values.
Resetting CSS properties to their initial values
This feature allows you to reset all CSS properties of an element to their initial values using the `all: initial;` declaration. This can be useful for removing all inherited styles and starting with a clean slate.
/* Input CSS */
.element {
all: initial;
}
/* Output CSS */
.element {
all: initial;
}
Resetting specific CSS properties
You can reset specific CSS properties to their initial values. This is useful when you want to reset only certain properties without affecting others.
/* Input CSS */
.element {
color: initial;
font-size: initial;
}
/* Output CSS */
.element {
color: initial;
font-size: initial;
}
postcss-preset-env allows you to use future CSS features today by converting modern CSS into something most browsers can understand. It includes a variety of plugins, including those for resetting CSS properties, but it is more comprehensive and includes many other features.
postcss-normalize lets you use the parts of normalize.css or sanitize.css that you need from your browserslist. It is similar in that it helps to standardize styles across browsers, but it focuses on normalization rather than resetting to initial values.
npm install @csstools/postcss-initial --save-dev
PostCSS Initial fallback the initial
keyword following the CSS Cascade 4 Specification.
.foo {
border: initial;
}
/* becomes */
.foo {
border: medium none currentcolor;
border: initial;
}
See prior work by maximkoretskiy here postcss-initial To ensure long term maintenance and to provide the needed features this plugin was recreated based on maximkoretskiy's work.
Add PostCSS Initial to your project:
npm install postcss @csstools/postcss-initial --save-dev
Use it as a PostCSS plugin:
const postcss = require('postcss');
const postcssInitial = require('@csstools/postcss-initial');
postcss([
postcssInitial(/* pluginOptions */)
]).process(YOUR_CSS /*, processOptions */);
The preserve
option determines whether the original notation
is preserved. By default, it is preserved.
postcssInitial({ preserve: false })
.foo {
border: initial;
}
/* becomes */
.foo {
border: medium none currentcolor;
}
FAQs
PostCSS plugin to fallback initial keyword.
The npm package @csstools/postcss-initial receives a total of 1,038,967 weekly downloads. As such, @csstools/postcss-initial popularity was classified as popular.
We found that @csstools/postcss-initial demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 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
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.
Security News
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
Product
Socket, the leader in open source security, is now available on Google Cloud Marketplace for simplified procurement and enhanced protection against supply chain attacks.