I'm working on a styled-system like library where the CSS values are configured by the user, so we don't know them upfront. I have a type that looks like this:
type ValueOrConditionObject<T> = T | { [key in keyof Breakpoints]?: T };
type Color = ValueOrCondition<Properties['color']>
I kept noticing that aberrant keys were showing up in the object, when I was just expecting to see keyof Breakpoints. I then realized that you can see this on the properties themselves:
I have a feeling that this is caused by the string & {} part of the type, but I'm not positive. I tried to extract out the values using PropertyValue, but that led me to the issue outlined in #152
Demonstration of bug here: https://codesandbox.io/s/csstype-autocomplete-bugs-tciq55?file=/src/property-object-keys.ts
I'm working on a styled-system like library where the CSS values are configured by the user, so we don't know them upfront. I have a type that looks like this:
I kept noticing that aberrant keys were showing up in the object, when I was just expecting to see
keyof Breakpoints
. I then realized that you can see this on the properties themselves:I have a feeling that this is caused by the
string & {}
part of the type, but I'm not positive. I tried to extract out the values using PropertyValue, but that led me to the issue outlined in #152