Socket
Socket
Sign inDemoInstall

@csstools/postcss-unset-value

Package Overview
Dependencies
Maintainers
3
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@csstools/postcss-unset-value

Use the unset keyword in CSS.


Version published
Weekly downloads
3.6M
decreased by-2.09%
Maintainers
3
Weekly downloads
 
Created
Source

PostCSS Unset Value PostCSS Logo

npm version CSS Standard Status Build Status Discord

PostCSS Unset Value lets you use the unset keyword, following the CSS Cascading and Inheritance specification.

.color {
	color: unset;
}

.border-color {
	border-color: unset;
}

.margin {
	margin: unset;
}


/* becomes */
.color {
	color: inherit;
}

.border-color {
	border-color: initial;
}

.margin {
	margin: initial;
}

Usage

Add PostCSS Unset Value to your project:

npm install postcss @csstools/postcss-unset-value --save-dev

Use it as a PostCSS plugin:

const postcss = require('postcss');
const postcssUnsetValue = require('@csstools/postcss-unset-value');

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

PostCSS Unset Value runs in all Node environments, with special instructions for:

NodePostCSS CLIWebpackGulpGrunt

Options

preserve

The preserve option determines whether the original source is preserved. By default, it is not preserved.

postcssUnsetValue({ preserve: true })
.color {
	color: unset;
}

.border-color {
	border-color: unset;
}

.margin {
	margin: unset;
}

/* becomes */

.color {
	color: inherit;
	color: unset;
}

.border-color {
	border-color: initial;
	border-color: unset;
}

.margin {
	margin: initial;
	margin: unset;
}

Keywords

FAQs

Package last updated on 15 Dec 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc