Socket
Socket
Sign inDemoInstall

@unocss/rule-utils

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@unocss/rule-utils

Utilities for UnoCSS


Version published
Weekly downloads
164K
decreased by-14.69%
Maintainers
1
Weekly downloads
 
Created

Package description

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

Readme

Source

@unocss/rule-utils

The utilities for creating rules/presets for UnoCSS.

License

MIT License © 2021-PRESENT Anthony Fu

FAQs

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc