styled-components / xstyled

A utility-first CSS-in-JS framework built for React. 💅👩‍🎤⚡️
https://xstyled.dev
MIT License
2.27k stars 107 forks source link

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

Closed strozw closed 2 years ago

strozw commented 2 years ago

Summary

this PR is fix below issue by add string | number | false into ThemeNamespaceValue (https://github.com/gregberge/xstyled/pull/345/commits/7a430a9fc9b6218cab77cbb8acf437951092ab9a).

Fixes #344

and fix type-errors about theme value types in tests files.

Test plan

  1. npm install in project root
  2. type checking
    • [x] no errors to run npx tsc --noEmit -p ./packages/system
    • [x] no errors to run npx tsc --noEmit -p ./packages/styled-components
    • [x] no errors to run npx tsc --noEmit -p ./packages/emotion
  3. pass the tests (run npm test in project root)
strozw commented 2 years ago

@gregberge

thanks for your review.

Each prop has its own typing, maybe some are missing, but globally it is good.

Indeed, I think it should be safe for Typing to be more accurate and limited. This PR will be closed and I'll reconsider if we can contribute in another way.