You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
type Unit = `${number}${`ch`|`em`|`px`|`rem`|`vh`|`vw`|`%`}`;
type CSSFunction = `${string}(--${string | number})`; // like `var(--some-var)` or `calc(100% - 220px)`
type StandardLonghandPropertiesValue = Unit | CSSFunction;
at least.
Can't think of other edge cases, but this sort of typing is tough... Even CSSFunction could be spoofed wrong.
I'd like to make sure the user will be able to provide only a valid strings to a component with this props:
but it allows to provide any string or number:
I've noticed that it could work when I remove
| (string & {});
from this interface:Now I'm able to pass
0
as a type param to theStandardLonghandProperties
interface:As a solution for the issue with
px
,rem
etc I suggest using Template Literal Types:The text was updated successfully, but these errors were encountered: