Socket
Socket
Sign inDemoInstall

@csstools/postcss-relative-color-syntax

Package Overview
Dependencies
Maintainers
0
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@csstools/postcss-relative-color-syntax

Use the relative color syntax in CSS


Version published
Weekly downloads
965K
decreased by-0.29%
Maintainers
0
Weekly downloads
 
Created

What is @csstools/postcss-relative-color-syntax?

@csstools/postcss-relative-color-syntax is a PostCSS plugin that allows you to use relative color syntax in your CSS. This can simplify color manipulations and make your stylesheets more maintainable by enabling relative color adjustments directly in your CSS.

What are @csstools/postcss-relative-color-syntax's main functionalities?

Relative Color Syntax

This feature allows you to use relative color syntax to mix colors directly in your CSS. The example shows how to mix white and black to get a gray background color.

/* Input CSS */
body {
  background-color: color-mix(in srgb, white 50%, black);
}

/* Output CSS */
body {
  background-color: #808080;
}

Color Adjustments

This feature allows you to adjust colors based on contrast. The example shows how to set a button's background color to blue while ensuring it contrasts well with both white and black.

/* Input CSS */
button {
  background-color: color-contrast(white vs black, blue);
}

/* Output CSS */
button {
  background-color: #0000ff;
}

Other packages similar to @csstools/postcss-relative-color-syntax

Keywords

FAQs

Package last updated on 03 Aug 2024

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