diff --git a/style/func/func.ts b/style/func/func.ts index f1ee5544104..6dd7410cf57 100644 --- a/style/func/func.ts +++ b/style/func/func.ts @@ -70,9 +70,9 @@ namespace $ { } static clamp( - min: $mol_style_unit< any >, - mid: $mol_style_unit< any >, - max: $mol_style_unit< any >, + min: $mol_style_unit_str< any >, + mid: $mol_style_unit_str< any >, + max: $mol_style_unit_str< any >, ) { return new $mol_style_func( 'clamp', @@ -99,7 +99,7 @@ namespace $ { } static linear( - ...breakpoints : Array]> + ...breakpoints : Array]> ){ return new $mol_style_func( "linear", @@ -126,23 +126,23 @@ namespace $ { return new $mol_style_func( 'steps', [ value, step_position ] ) } - static blur(value?: $mol_style_unit<$mol_style_unit_length>){ + static blur(value?: $mol_style_unit_str<$mol_style_unit_length>){ return new $mol_style_func( 'blur', value ?? "" ); } - static brightness(value?: number | $mol_style_unit<'%'>){ + static brightness(value?: number | $mol_style_unit_str<'%'>){ return new $mol_style_func( 'brightness', value ?? "" ); } - static contrast(value?: number | $mol_style_unit<'%'>){ + static contrast(value?: number | $mol_style_unit_str<'%'>){ return new $mol_style_func( 'contrast', value ?? "" ); } static drop_shadow( color: $mol_style_properties_color, - x_offset: $mol_style_unit<$mol_style_unit_length>, - y_offset: $mol_style_unit<$mol_style_unit_length>, - blur_radius?: $mol_style_unit<$mol_style_unit_length> + x_offset: $mol_style_unit_str<$mol_style_unit_length>, + y_offset: $mol_style_unit_str<$mol_style_unit_length>, + blur_radius?: $mol_style_unit_str<$mol_style_unit_length> ) { return new $mol_style_func( "drop-shadow", @@ -152,27 +152,27 @@ namespace $ { ); } - static grayscale(value?: number | $mol_style_unit<'%'>){ + static grayscale(value?: number | $mol_style_unit_str<'%'>){ return new $mol_style_func( 'grayscale', value ?? "" ); } - static hue_rotate(value?: 0 | $mol_style_unit<$mol_style_unit_angle>){ + static hue_rotate(value?: 0 | $mol_style_unit_str<$mol_style_unit_angle>){ return new $mol_style_func( 'hue-rotate', value ?? "") } - static invert(value?: number | $mol_style_unit<'%'>){ + static invert(value?: number | $mol_style_unit_str<'%'>){ return new $mol_style_func( 'invert', value ?? "" ); } - static opacity(value?: number | $mol_style_unit<'%'>){ + static opacity(value?: number | $mol_style_unit_str<'%'>){ return new $mol_style_func( 'opacity', value ?? "" ); } - static sepia(value?: number | $mol_style_unit<'%'>){ + static sepia(value?: number | $mol_style_unit_str<'%'>){ return new $mol_style_func( 'sepia', value ?? "" ); } - static saturate(value?: number | $mol_style_unit<'%'>){ + static saturate(value?: number | $mol_style_unit_str<'%'>){ return new $mol_style_func( 'saturate', value ?? "" ); } diff --git a/style/unit/unit.ts b/style/unit/unit.ts index fb9ae6f6cc0..eda68019d1f 100644 --- a/style/unit/unit.ts +++ b/style/unit/unit.ts @@ -11,6 +11,7 @@ namespace $ { export type $mol_style_unit_time = 's' | 'ms' export type $mol_style_unit_any = $mol_style_unit_length | $mol_style_unit_angle | $mol_style_unit_time + export type $mol_style_unit_str< Quanity extends $mol_style_unit_any > = `${number}${Quanity}` /** * CSS Units