Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

postcss-modules-values

Package Overview
Dependencies
Maintainers
4
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-modules-values

PostCSS plugin for CSS Modules to pass arbitrary values between your module files

  • 4.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
17M
increased by6.48%
Maintainers
4
Weekly downloads
 
Created

What is postcss-modules-values?

The postcss-modules-values package is a PostCSS plugin that allows you to define and use custom values (variables) within your CSS modules. This can help you manage and reuse values like colors, sizes, and other design tokens across your stylesheets.

What are postcss-modules-values's main functionalities?

Define Custom Values

This feature allows you to define custom values in one CSS file and import them into another. This helps in maintaining consistency and reusability of design tokens across different stylesheets.

/* variables.css */
@value primaryColor: #3498db;
@value padding: 10px;

/* styles.css */
@value primaryColor, padding from './variables.css';

.button {
  background-color: primaryColor;
  padding: padding;
}

Scoped Values

Scoped values allow you to import and use values in a specific scope, ensuring that the values are only available where they are needed. This helps in avoiding global namespace pollution.

/* variables.css */
@value primaryColor: #3498db;

/* component.css */
@value primaryColor from './variables.css';

.header {
  color: primaryColor;
}

Nested Values

Nested values allow you to group related values together, making it easier to manage and use them in a structured way. This is particularly useful for organizing design tokens.

/* variables.css */
@value colors: {
  primary: #3498db,
  secondary: #2ecc71
};

/* styles.css */
@value colors from './variables.css';

.button {
  background-color: colors.primary;
}

Other packages similar to postcss-modules-values

Keywords

FAQs

Package last updated on 13 Oct 2020

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