Socket
Socket
Sign inDemoInstall

@csstools/postcss-scope-pseudo-class

Package Overview
Dependencies
Maintainers
3
Versions
7
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


Version published
Weekly downloads
1M
increased by2.7%
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

FAQs

Package last updated on 15 Dec 2023

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