@unocss/preset-attributify
Advanced tools
Comparing version 0.1.5 to 0.2.0
@@ -1,2 +0,2 @@ | ||
import { Extractor, Variant, Preset } from '@unocss/core'; | ||
import { Extractor, VariantFunction, Preset } from '@unocss/core'; | ||
@@ -35,3 +35,3 @@ interface AttributifyOptions { | ||
declare const variantAttributify: (options?: AttributifyOptions) => Variant; | ||
declare const variantAttributify: (options?: AttributifyOptions) => VariantFunction; | ||
@@ -38,0 +38,0 @@ declare const preset: (options?: AttributifyOptions | undefined) => Preset; |
@@ -70,19 +70,17 @@ var __create = Object.create; | ||
const prefix = (_a = options.prefix) != null ? _a : "un-"; | ||
return { | ||
match(input) { | ||
const match = (0, import_core2.isAttributifySelector)(input); | ||
if (!match) | ||
return; | ||
let name = match[1]; | ||
if (name.startsWith(prefix)) | ||
name = name.slice(prefix.length); | ||
else if (options.prefixedOnly) | ||
return; | ||
const content = match[2]; | ||
const [, variants = "", body = content] = content.match(variantsRE) || []; | ||
if (body === "~" || !body) | ||
return `${variants}${name}`; | ||
else | ||
return `${variants}${name}-${body}`; | ||
} | ||
return (input) => { | ||
const match = (0, import_core2.isAttributifySelector)(input); | ||
if (!match) | ||
return; | ||
let name = match[1]; | ||
if (name.startsWith(prefix)) | ||
name = name.slice(prefix.length); | ||
else if (options.prefixedOnly) | ||
return; | ||
const content = match[2]; | ||
const [, variants = "", body = content] = content.match(variantsRE) || []; | ||
if (body === "~" || !body) | ||
return `${variants}${name}`; | ||
else | ||
return `${variants}${name}-${body}`; | ||
}; | ||
@@ -89,0 +87,0 @@ }; |
{ | ||
"name": "@unocss/preset-attributify", | ||
"version": "0.1.5", | ||
"version": "0.2.0", | ||
"description": "", | ||
@@ -31,3 +31,3 @@ "keywords": [], | ||
"dependencies": { | ||
"@unocss/core": "0.1.5" | ||
"@unocss/core": "0.2.0" | ||
}, | ||
@@ -34,0 +34,0 @@ "scripts": { |
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
10627
214
+ Added@unocss/core@0.2.0(transitive)
- Removed@unocss/core@0.1.5(transitive)
Updated@unocss/core@0.2.0