Socket
Socket
Sign inDemoInstall

@unocss/transformer-directives

Package Overview
Dependencies
Maintainers
2
Versions
245
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@unocss/transformer-directives

UnoCSS transformer for `@apply` directive


Version published
Weekly downloads
180K
increased by4.54%
Maintainers
2
Weekly downloads
 
Created

What is @unocss/transformer-directives?

@unocss/transformer-directives is a transformer for UnoCSS that allows you to use CSS directives within your stylesheets. It provides a way to use utility-first CSS directly in your stylesheets, making it easier to manage and apply styles dynamically.

What are @unocss/transformer-directives's main functionalities?

Using @apply directive

The @apply directive allows you to apply multiple utility classes to a single CSS rule. This makes it easier to manage and reuse styles across your project.

/* styles.css */
.button {
  @apply bg-blue-500 text-white font-bold py-2 px-4 rounded;
}

Using @screen directive

The @screen directive allows you to apply styles based on breakpoints. This is useful for creating responsive designs that adapt to different screen sizes.

/* styles.css */
@screen md {
  .container {
    @apply p-4;
  }
}

Using @variants directive

The @variants directive allows you to apply styles based on different states like hover, focus, etc. This is useful for creating interactive elements that change styles based on user interactions.

/* styles.css */
@variants hover, focus {
  .button {
    @apply bg-blue-700;
  }
}

Other packages similar to @unocss/transformer-directives

Keywords

FAQs

Package last updated on 16 Jul 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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc