Adding unsupported CSS props to theme #1458
-
I'm trying to add a CSS prop
What is the correct way to use unsuported props? Is it something like extending Styled System? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
As a "smart fix", you could use TypeScript declaration merging to add As a quick fix, you can spread an object with unsupported properties onto
This seems like a valid bug though. Shouldn't we update our types to include |
Beta Was this translation helpful? Give feedback.
-
The following seems to work for me, can you guys please post a repro?
For other css props that are not supported by csstype, the solution from @hasparus should work |
Beta Was this translation helpful? Give feedback.
-
Ha! An award for careful reading. I trusted the title and didn't read the error :P @macakraca your problem is not with Theme UI. Your problem is with TypeScript. TypeScript not having a full type inference. I wrote about it in the docs. There's a solution for you there: |
Beta Was this translation helpful? Give feedback.
Ha! An award for careful reading. I trusted the title and didn't read the error :P
@macakraca your problem is not with Theme UI. Your problem is with TypeScript. TypeScript not having a full type inference.
I wrote about it in the docs. There's a solution for you there:
https://dev.theme-ui.com/guides/typescript/#union-types-are-not-inferred-without-explicit-annotation