paypal / glamorous

DEPRECATED: 💄 Maintainable CSS with React
https://glamorous.rocks
MIT License
3.64k stars 208 forks source link

TypeScript: Add recursive array type to CSS prop #383

Closed quicksnap closed 6 years ago

quicksnap commented 6 years ago

What:

Fixes the type definitions for css prop. The css prop actually accepts either an object or an array of nested objects/arrays.

Why: TypeScript support

How: Leverage recursive types described in this comment: https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540

Checklist:

The build fails due to previous failure. I have PR #382 that fixes this.

quicksnap commented 6 years ago

Example of how the current typings would fail:

<Div css={[ { fontSize: 40 }, [ { fontSize: 50 } ] ]} /> Would throw a TS error

Ailrun commented 6 years ago

@quicksnap Could you rebase (or merge, or whatever to sync with master) this PR?

quicksnap commented 6 years ago

Done. Hopefully all passes now? =)

quicksnap commented 6 years ago

In order to automate release, should I adjust my commit message or something?

kentcdodds commented 6 years ago

When you click "Squash and merge" you'll see this which allows you to change the commit message of the squashed commit:

screen shot 2018-02-16 at 2 37 53 pm
codecov-io commented 6 years ago

Codecov Report

Merging #383 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #383   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          10     10           
  Lines         182    182           
  Branches       52     52           
=====================================
  Hits          182    182

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a2dcedf...c3b1db9. Read the comment docs.