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

@csstools/postcss-scope-pseudo-class

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-scope-pseudo-class

The Reference Element Pseudo-class: :scope

4.0.1
latest
Source
npm
Version published
Weekly downloads
1.6M
-2.55%
Maintainers
3
Weekly downloads
 
Created

What is @csstools/postcss-scope-pseudo-class?

@csstools/postcss-scope-pseudo-class is a PostCSS plugin that allows you to scope CSS pseudo-classes to specific elements. This can be particularly useful for ensuring that styles are applied only within certain contexts, avoiding unintended side effects.

What are @csstools/postcss-scope-pseudo-class's main functionalities?

Scoping :hover pseudo-class

This feature allows you to scope the :hover pseudo-class to a specific element. In the example, the :hover pseudo-class is scoped to the .scope element, ensuring that the styles are only applied when .scope is hovered.

/* Input CSS */
.scope:hover .element {
  color: red;
}

/* Output CSS */
.scope:hover .scope .element {
  color: red;
}

Scoping :focus pseudo-class

This feature allows you to scope the :focus pseudo-class to a specific element. In the example, the :focus pseudo-class is scoped to the .scope element, ensuring that the styles are only applied when .scope is focused.

/* Input CSS */
.scope:focus .element {
  color: blue;
}

/* Output CSS */
.scope:focus .scope .element {
  color: blue;
}

Scoping :active pseudo-class

This feature allows you to scope the :active pseudo-class to a specific element. In the example, the :active pseudo-class is scoped to the .scope element, ensuring that the styles are only applied when .scope is active.

/* Input CSS */
.scope:active .element {
  color: green;
}

/* Output CSS */
.scope:active .scope .element {
  color: green;
}

Other packages similar to @csstools/postcss-scope-pseudo-class

Keywords

postcss-plugin

FAQs

Package last updated on 23 Oct 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