Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@unocss/rule-utils

Package Overview
Dependencies
Maintainers
0
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@unocss/rule-utils

Utilities for UnoCSS

  • 0.63.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
226K
decreased by-1.78%
Maintainers
0
Weekly downloads
 
Created

What is @unocss/rule-utils?

@unocss/rule-utils is a utility package designed to assist with the creation and management of rules in UnoCSS, a highly customizable and performant utility-first CSS framework.

What are @unocss/rule-utils's main functionalities?

Rule Creation

This feature allows you to create custom CSS rules easily. In the example, a rule for setting the background color to red is created.

const { createRule } = require('@unocss/rule-utils');

const rule = createRule('bg-red', { 'background-color': 'red' });
console.log(rule);

Rule Matching

This feature helps in matching a given rule with a specific pattern. The example checks if the rule matches the 'bg-red' pattern.

const { matchRule } = require('@unocss/rule-utils');

const rule = { 'background-color': 'red' };
const isMatch = matchRule('bg-red', rule);
console.log(isMatch);

Rule Parsing

This feature parses a rule string into a more usable format. The example parses the 'bg-red' rule string.

const { parseRule } = require('@unocss/rule-utils');

const ruleString = 'bg-red';
const parsedRule = parseRule(ruleString);
console.log(parsedRule);

Other packages similar to @unocss/rule-utils

FAQs

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

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