frenic / csstype

Strict TypeScript and Flow types for style based on MDN data
MIT License
1.73k stars 72 forks source link

How to add "!important" on zIndex? #142

Closed khandar-william closed 2 years ago

khandar-william commented 3 years ago

Hi, one of our library dependency uses csstype to provide typings. On the field zIndex I notice you decide to use

export type Globals = "-moz-initial" | "inherit" | "initial" | "revert" | "unset";
export type ZIndex = Globals | "auto" | (number & {});

but what if I need to set zIndex: '100 !important'? currently I got a typing error and I must forcefully ignore it with zIndex: ('100 !important') as any

is there a better way to use !important with zIndex?

frenic commented 2 years ago

In v3.0.10 union string is applied to all properties that has number so this should be resolved without the need to asset the value.