Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix utility props value type about override the Theme interface #345

2 changes: 1 addition & 1 deletion packages/system/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ declare type SynthesizedPath<T extends {}> = {
export type ThemeNamespaceValue<
K extends string,
T extends ITheme,
> = SynthesizedPath<T[K]>
> = SynthesizedPath<T[K]> | number | string | false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the fix is correct. ThemeNamespaceValue means a value in the theme namespace, nothing else. However, I see what you want to fix, but I think it is not the right place to do it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your review.
Sure, my fix wasn't fit for name.

Read the code again and investigate the appropriate corrections.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1st, I reverted prev changes, and changed SystemProp insted of ThemeNamespaeceValue for fix utility props. I think this type name means utility props, but what do you think?

2nd, above changes is not cover same problem about each themeGetter. so I changed ThemeGetter for it.

3rd, the first change on SystemProps found an issue where col and row props didn't support false, so we fixed each one.


export interface ThemeGetter<T = any> {
(value: T, defaultValue?: CSSScalar): (props: Props<Theme>) => CSSScalar
Expand Down