🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

@csstools/postcss-nested-calc

Package Overview
Dependencies
Maintainers
3
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@csstools/postcss-nested-calc

Use nested calc() expressions in CSS

latest
Source
npmnpm
Version
5.0.0
Version published
Weekly downloads
4.5M
-19.29%
Maintainers
3
Weekly downloads
 
Created
Source

PostCSS Nested Calc PostCSS Logo

npm install @csstools/postcss-nested-calc --save-dev

PostCSS Nested Calc lets you use nested calc() expressions following the CSS Values and Units 4 specification.

.example {
	order: calc(1 + calc(2 * 2));
}

/* becomes */

.example {
	order: calc(1 + (2 * 2));
	order: calc(1 + calc(2 * 2));
}

Usage

Add PostCSS Nested Calc to your project:

npm install postcss @csstools/postcss-nested-calc --save-dev

Use it as a PostCSS plugin:

const postcss = require('postcss');
const postcssNestedCalc = require('@csstools/postcss-nested-calc');

postcss([
	postcssNestedCalc(/* pluginOptions */)
]).process(YOUR_CSS /*, processOptions */);

Options

preserve

The preserve option determines whether the original notation is preserved. By default the original values are preserved.

postcssNestedCalc({ preserve: false })
.example {
	order: calc(1 + calc(2 * 2));
}

/* becomes */

.example {
	order: calc(1 + (2 * 2));
}

Keywords

calc

FAQs

Package last updated on 14 Jan 2026

Did you know?

Socket

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.

Install

Related posts