Socket
Socket
Sign inDemoInstall

@csstools/postcss-unset-value

Package Overview
Dependencies
4
Maintainers
3
Versions
7
Alerts
File Explorer

Advanced tools

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.8M
increased by4.17%
Maintainers
3
Install size
19.7 kB
Created
Weekly downloads
 

Readme

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

Last updated on 15 Dec 2023

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc