@warp-ds/uno
Advanced tools
Comparing version 1.0.0-alpha.48 to 1.0.0-alpha.49
{ | ||
"name": "@warp-ds/uno", | ||
"repository": "git@github.com:warp-ds/drive.git", | ||
"version": "1.0.0-alpha.48", | ||
"version": "1.0.0-alpha.49", | ||
"type": "module", | ||
@@ -6,0 +6,0 @@ "exports": { |
@@ -1,13 +0,5 @@ | ||
import { handler as h, resolveBreakpoints, resolveVerticalBreakpoints } from '#utils'; | ||
import { handler as h, resolveBreakpoints, resolveVerticalBreakpoints, resolveArbitraryValues } from '#utils'; | ||
const sizeMapping = { h: 'height', w: 'width' }; | ||
const getPropName = (minmax, hw) => `${minmax || ''}${sizeMapping[hw]}`; | ||
const resolveArbitraryValues = (value, unit, context) => { | ||
if (unit === "rem") return h.rem(`${value}${unit}`); | ||
if (unit === "px" || context.theme.usingPixels) return h.px(value); | ||
if (value.startsWith('--')) { | ||
return `var(${value})`; | ||
} | ||
return h.rem(value) || value; | ||
}; | ||
@@ -14,0 +6,0 @@ function getSizeValue(minmax, hw, theme, prop) { |
@@ -1,2 +0,2 @@ | ||
import { textMap, lineHeightMap } from '#utils'; | ||
import { textMap, lineHeightMap, resolveArbitraryValues } from '#utils'; | ||
@@ -12,2 +12,3 @@ export const typography = [ | ||
], | ||
[/^leading-\[(.+)(rem|px)?\]/, ([, value, unit], context) => ({ 'line-height': resolveArbitraryValues(value, unit, context) })], | ||
]; |
@@ -221,1 +221,10 @@ import { toArray } from '@unocss/core'; | ||
} | ||
export function resolveArbitraryValues(value, unit, context) { | ||
if (unit === "rem") return h.rem(`${value}${unit}`); | ||
if (unit === "px" || context.theme.usingPixels) return h.px(value); | ||
if (value.startsWith('--')) { | ||
return `var(${value})`; | ||
} | ||
return h.rem(value) || value; | ||
}; |
Sorry, the diff of this file is too big to display
190151
5043