New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@unocss/extractor-arbitrary-variants

Package Overview
Dependencies
Maintainers
0
Versions
115
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@unocss/extractor-arbitrary-variants

Extractor arbitrary variants for utilities

66.1.0-beta.5
Source
npm
Version published
Weekly downloads
267K
-1.88%
Maintainers
0
Weekly downloads
 
Created

What is @unocss/extractor-arbitrary-variants?

@unocss/extractor-arbitrary-variants is a package designed to work with UnoCSS, a utility-first CSS framework. This package allows you to extract and apply arbitrary variants to your CSS classes, enabling more dynamic and flexible styling options.

What are @unocss/extractor-arbitrary-variants's main functionalities?

Arbitrary Variants Extraction

This feature allows you to extract arbitrary variants from a given string. In this example, the 'hover:bg-red-500' variant is extracted and logged.

import { extractorArbitraryVariants } from '@unocss/extractor-arbitrary-variants';

const variants = extractorArbitraryVariants('hover:bg-red-500');
console.log(variants); // Output: ['hover:bg-red-500']

Integration with UnoCSS

This feature demonstrates how to integrate the arbitrary variants extractor with UnoCSS. By adding the extractor to the UnoCSS configuration, you can enable the use of arbitrary variants in your project.

import { defineConfig } from 'unocss';
import { extractorArbitraryVariants } from '@unocss/extractor-arbitrary-variants';

export default defineConfig({
  extractors: [
    extractorArbitraryVariants(),
  ],
});

Other packages similar to @unocss/extractor-arbitrary-variants

Keywords

unocss

FAQs

Package last updated on 13 Mar 2025

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