Socket
Socket
Sign inDemoInstall

@unocss/rule-utils

Package Overview
Dependencies
3
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @unocss/rule-utils

Utilities for UnoCSS


Version published
Weekly downloads
265K
decreased by-24.38%
Maintainers
1
Install size
611 kB
Created
Weekly downloads
 

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

Last updated on 01 Apr 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc