-
Notifications
You must be signed in to change notification settings - Fork 208
Use csstype for standardized CSS typings #411
Conversation
zoomAndPan?: string | ||
} | ||
export interface SVGPropertiesCompleteSingle | ||
extends CSS.SvgProperties<number | string> {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be CSS.SvgPropertiesFallback
?
It seems like it would need to be in order to allow using arrays to set fallback values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does look like it was not supporting array until now, though i'm pretty sure that glamor supports it...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have used CSS.SvgPropertiesFallback
if I were writing these typings from scratch, but to minimize breakage I was trying to keep as many of the existing exports intact as possible. So this is accomplishing what CSS.SvgPropertiesFallback
would:
type SVGPropertiesComplete = SingleOrArray<
SVGPropertiesCompleteSingle,
keyof SVGPropertiesCompleteSingle
>
I'm not sure what all the test failures are about, but these:
should be resolved by frenic/csstype#8. In the meantime, it allows a |
I think you should update negative tests and snapshots. |
Codecov Report
@@ Coverage Diff @@
## master #411 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 10 10
Lines 177 177
Branches 50 50
=====================================
Hits 177 177 Continue to review full report at Codecov.
|
@@ -38,13 +38,7 @@ test/should-fail.test.tsx(100,24): error TS2551: Property 'colors' does not exis | |||
test/should-fail.test.tsx(111,3): error TS2344: Type 'PropsWithoutTheme' does not satisfy the constraint '{ theme: any; }'. | |||
Property 'theme' is missing in type 'PropsWithoutTheme'. | |||
test/should-fail.test.tsx(119,3): error TS2345: Argument of type 'StatelessComponent<object>' is not assignable to parameter of type '\\"tspan\\"'. | |||
test/should-fail.test.tsx(134,3): error TS2345: Argument of type '(props: { theme: any; } & ExampleComponentProps & object) => { display: \\"none\\" | \\"hidden\\"; }' is not assignable to parameter of type 'StyleArgument<CSSProperties, { theme: any; } & ExampleComponentProps & object>'. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those are in should-fail tests, so I think you should remove relevant tests too. I mean, line 134 in test/should-fail.test.tsx.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests will be valid again once frenic/csstype#8 is fixed. Would it make sense to just add comments to the effect that the lines are only temporarily not being flagged with errors, pending that PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pelotom Oh, sorry. I though frenic/csstype#8 (comment) says that 'string
is valid', but it does not... Sorry for giving confusion.
Looks OK for me. |
Thanks folks! This is great to remove so much code! |
Resolves #408. See that issue for details and rationale.