@warp-ds/uno
Advanced tools
Comparing version 1.4.0-next.1 to 1.4.0-next.2
{ | ||
"name": "@warp-ds/uno", | ||
"repository": "git@github.com:warp-ds/drive.git", | ||
"version": "1.4.0-next.1", | ||
"version": "1.4.0-next.2", | ||
"type": "module", | ||
@@ -6,0 +6,0 @@ "exports": { |
import { directionMap, handler as h } from '#utils'; | ||
import { escapeSelector } from "@unocss/core"; | ||
const handleBorder = ([, direction = '', cssvar = '']) => | ||
directionMap[direction.substring(1)]?.map( | ||
(dir) => [`border${dir}-color`, h.semanticToken(`border${cssvar}`)], | ||
); | ||
const handleDivide = ([_selector, direction = '', cssvar = '']) => | ||
`.${escapeSelector(_selector)}>*+*{${ | ||
directionMap[direction.substring(1)]?.map((dir) => | ||
`border${dir}-color: ${h.semanticToken(`border${cssvar}`)};`, | ||
).join('') | ||
}}`; | ||
export const semanticRules = [ | ||
[/^s-bg$/, () => ({ 'background-color': h.semanticToken('background') })], | ||
[/^s-bg-(.+)$/, ([, cssvar]) => ({ 'background-color': h.semanticToken(`background-${cssvar}`) })], | ||
[/^s-text$/, () => ({ color: h.semanticToken('text') })], | ||
[/^s-text-(.+)$/, ([, cssvar]) => ({ color: h.semanticToken(`text-${cssvar}`) })], | ||
[/^s-icon$/, () => ({ color: h.semanticToken('icon') })], | ||
[/^s-icon-(.+)$/, ([, cssvar]) => ({ color: h.semanticToken(`icon-${cssvar}`) })], | ||
[/^s-border$/, ([, cssvar]) => ({ 'border-color': h.semanticToken('border') })], | ||
[/^s-border-(.+)$/, ([, cssvar]) => ({ 'border-color': h.semanticToken(`border-${cssvar}`) })], | ||
[/^s-border-([lrtbxy])$/, ([, direction]) => directionMap[direction]?.map( | ||
(dir) => [`border${dir}-color`, h.semanticToken('border')], | ||
)], | ||
[/^s-border-([lrtbxy])-(.+)$/, ([, direction, cssvar]) => directionMap[direction]?.map( | ||
(dir) => [`border${dir}-color`, h.semanticToken(`border-${cssvar}`)], | ||
)], | ||
[/^s-outline$/, () => ({ 'outline-color': h.semanticToken('border') })], | ||
[/^s-outline-(.+)$/, ([, cssvar]) => ({ 'outline-color': h.semanticToken(`border-${cssvar}`) })], | ||
[/^s-divide$/, ([_selector]) => `.${escapeSelector(_selector)}>*+*{border-color: ${h.semanticToken('border')};}`], | ||
[/^s-divide-(.+)$/, ([_selector, cssvar]) => `.${escapeSelector(_selector)}>*+*{border-color: ${h.semanticToken(`border-${cssvar}`)};}`], | ||
[/^s-bg(-.+)?$/, ([, cssvar = '']) => ({ 'background-color': h.semanticToken(`background${cssvar}`) })], | ||
[/^s-text(-.+)?$/, ([, cssvar = '']) => ({ color: h.semanticToken(`text${cssvar}`) })], | ||
[/^s-icon(-.+)?$/, ([, cssvar = '']) => ({ color: h.semanticToken(`icon${cssvar}`) })], | ||
[/^s-border(-[lrtbxy])?(-.+)?$/, handleBorder], | ||
[/^s-outline(-.+)?$/, ([, cssvar = '']) => ({ 'outline-color': h.semanticToken(`border${cssvar}`) })], | ||
[/^s-divide(-[xy])?(-.+)?$/, handleDivide], | ||
]; |
Sorry, the diff of this file is too big to display
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
199187
5258