@unocss/core
Advanced tools
Comparing version 0.1.0-beta.2 to 0.1.0
@@ -21,6 +21,24 @@ declare type Awaitable<T> = T | Promise<T>; | ||
declare type Variant = { | ||
/** | ||
* The entry function to match and rewrite the selector for futher processing. | ||
*/ | ||
match: (input: string, theme: Theme) => string | undefined; | ||
/** | ||
* Rewrite the output selector. Often be used to append pesudo classes or parents. | ||
*/ | ||
selector?: (input: string, theme: Theme) => string | undefined; | ||
/** | ||
* Rewrite the output css body. The input come in [key,value][] pairs. | ||
*/ | ||
rewrite?: (input: CSSEntries, theme: Theme) => CSSEntries | undefined; | ||
/** | ||
* Provide media query to the output css. | ||
*/ | ||
mediaQuery?: (selector: string, theme: Theme) => string | undefined; | ||
/** | ||
* Allows this variant to be used more than once in matching a single rule | ||
* | ||
* @default false | ||
*/ | ||
multiPass?: boolean; | ||
}; | ||
@@ -27,0 +45,0 @@ interface Theme { |
@@ -377,3 +377,3 @@ var __defProp = Object.defineProperty; | ||
// src/extractors/split.ts | ||
var extractorSplit = (code) => new Set(code.split(/[\s'"`;>=]/g).filter(isValidSelector)); | ||
var extractorSplit = (code) => new Set(code.split(/[\s'"`;>=]+/g).filter(isValidSelector)); | ||
@@ -559,2 +559,4 @@ // src/config.ts | ||
for (const v of this.config.variants) { | ||
if (!v.multiPass && variants.includes(v)) | ||
continue; | ||
const result = v.match(processed, this.config.theme); | ||
@@ -561,0 +563,0 @@ if (result && result !== processed) { |
{ | ||
"name": "@unocss/core", | ||
"version": "0.1.0-beta.2", | ||
"version": "0.1.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
50080
1557