
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
postcss-active-view-transition-type
Advanced tools
PostCSS plugin that rewrites :active-view-transition-type(<type>) pseudo class selectors to :root.<type> selectors. To be used with mayStartViewTransition from @vtbag/utensil-drawer.
When used with mayStartViewTransition() from @vtbag/utensil-drawer, this PostCSS plugin adds a polyfill for the view transition types defined by Level 2 of the View Transition API, letting you use them even when the browser lacks native support.
When used with mayStartViewTransition() from @vtbag/utensil-drawer, this PostCSS plugin adds a polyfill for the view transition types defined in Level 2 of the View Transition API, letting you use them even when the browser lacks native support.
This plugin makes it possible to use view transition types with browser versions that support Level 1 of the View Transition API, only, and do not natively support view transition types.
Latest changes: Reduces the number of rules copied when setting mode to append. See the CHANGELOG.
The plugin replaces :active-view-transition-type(x) pseudo class selectors with :root:where(.vtbag-vtt-x), i.e. selectors that check for a CSS class named vtbag-vtt-x on the root element. The vtbag-vtt- prefix is added to avoid name clashes with regular CSS classes. Starting from version 0.0.5, the :where() pseudo class makes sure that the replacement keeps the specificity of the original selector.
To automatically insert those CSS classes during same-document view transitions, replace calls to document.startViewTransition() with calls to mayStartViewTransition() from the Bag's Utensil Drawer and add the useTypesPolyfill: "always" (or "auto") extension.
The plugin can operate in two different modes:
useTypesPolyfill: "always".useTypesPolyfill: "auto", where the polyfill executes only in browsers that do not support view transition types.To rewrite rules in place, call the plugin without parameters or use this options object: { mode: 'in-place'}.
postcss([
require('postcss-active-view-transition-type')
])
/* Input example */
:active-view-transition-type(toggle-view) {
#element {
view-transition-name: element;
}
}
/* Output example */
:root:where(.vtbag-vtt-toggle-view) {
#element {
view-transition-name: element;
}
}
/* Input example */
:active-view-transition {
#element {
view-transition-name: element;
}
}
/* Output example */
:root:where(.vtbag-vtt-0) {
#element {
view-transition-name: element;
}
}
To append the rewritten rules to the original stylesheet, call the plugin with this options object: { mode: 'append' }.
postcss([
require('postcss-active-view-transition-type')({ mode:'append' })
])
/* Input example */
:active-view-transition-type(toggle-view) {
#element {
view-transition-name: element;
}
}
/* Output example */
:active-view-transition-type(toggle-view) {
#element {
view-transition-name: element;
}
}
:root:where(.vtbag-vtt-toggle-view) {
#element {
view-transition-name: element;
}
}
/* Input example */
:active-view-transition {
#element {
view-transition-name: element;
}
}
/* Output example */
:active-view-transition {
#element {
view-transition-name: element;
}
}
:root.where(.vtbag-vtt-0) {
#element {
view-transition-name: element;
}
}
See PostCSS docs for examples for your environment.
FAQs
PostCSS plugin that rewrites :active-view-transition-type(<type>) pseudo class selectors to :root.<type> selectors. To be used with mayStartViewTransition from @vtbag/utensil-drawer.
We found that postcss-active-view-transition-type demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.