system-props / system-props

Responsive, theme-based style props for building design systems with React. Written in TypeScript.

Home Page:https://system-props.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Responsive object style

vinihvc opened this issue · comments

I'm testing your library, and in the object syntax the base property "_" is getting an error

image

It only works when map the "_"

image

but that's not good because it creates media query

It's working, but the typescript reports an error.

PS: Array style is working without error.

Example: https://codesandbox.io/s/charming-chaum-fnyd2?file=/src/App.tsx

Thanks for the report, this is one of the smaller edge cases when I developed types that I wasn't sure how to resolve. Currently the types accept any breakpoint theme value or 'all'

https://github.com/system-props/system-props/blob/main/system-props/src/types/system-props.ts#L228-230

Curious what you think the solution should be here. The types could expand to accept other common aliases for this, like '_' and 'initial'. I don't think we want to accept any value (though in theory that's true, any non-breakpoint value would be the same as 'all', but I don't think that's a good UX)