🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

postcss-modules-scope

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-modules-scope

A CSS Modules transform to extract export statements from local-scope classes

3.2.1
latest
Version published
Weekly downloads
21M
5.85%
Maintainers
4
Weekly downloads
 
Created

What is postcss-modules-scope?

The postcss-modules-scope npm package is a PostCSS plugin that helps in locally scoping CSS by automatically renaming classes and other identifiers to be unique. This ensures that styles do not conflict across different parts of an application. It is commonly used in modular CSS architecture.

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

Local Scoping of CSS Classes

This feature automatically renames CSS classes to include a unique identifier, preventing class name collisions.

/* Input CSS */
.className {
  color: red;
}

/* Output CSS after processing with postcss-modules-scope */
._className_1a2b3c {
  color: red;
}

Renaming of Animation Names

This feature renames animation names with a unique identifier to avoid conflicts with other animations in the global scope.

/* Input CSS */
@keyframes myAnimation {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Output CSS after processing with postcss-modules-scope */
@keyframes myAnimation_1a2b3c {
  from { opacity: 0; }
  to { opacity: 1; }
}

Other packages similar to postcss-modules-scope

FAQs

Package last updated on 11 Nov 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