Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@unocss/rule-utils
Advanced tools
@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.
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);
PostCSS is a tool for transforming CSS with JavaScript plugins. It offers a wide range of functionalities for CSS processing, including rule creation and manipulation, similar to @unocss/rule-utils, but with a broader scope.
Stylelint is a modern linter that helps you avoid errors and enforce conventions in your styles. It provides functionalities for rule matching and validation, similar to @unocss/rule-utils, but focuses more on linting and enforcing style rules.
CSSTree is a tool for working with CSS, including parsing, generating, and analyzing CSS. It offers functionalities for rule parsing and manipulation, similar to @unocss/rule-utils, but with a focus on detailed CSS analysis and transformation.
The utilities for creating rules/presets for UnoCSS.
MIT License © 2021-PRESENT Anthony Fu
FAQs
Utilities for UnoCSS
We found that @unocss/rule-utils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.