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
Add types for all pseudoclasses/elements #191
base: 2.x
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: bf100ab The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
ab6ac9e
to
d3c203a
Compare
I just realized that
|
I tried to test this locally, and it looks like Here's an archive of the 3.0 version: https://github.com/appsforartists/jsxstyle/tree/pseudo-types-3 |
af96efe
to
2df12b8
Compare
rebased onto 2.x and works! |
Uses `type-fest` and `${ prefix }key` to teach the types about all possible pseudoprops (beyond the ones that were enumerated in the previous typing).
2df12b8
to
fa174ab
Compare
aafba0e
to
2a87cc2
Compare
And now CI is fixed too |
Sorry for the delay here, I took a look when this PR dropped but didn’t have a chance to write some thoughts down. The thoughts:
|
Thanks for taking a look! I like that removing pseudos would make accessibility easier; however, that's a breaking change (e.g. on a 3.x branch) Can I persuade you to merge this onto |
I just took a peek at your in-progress README. 3.x looks like a nice improvement! I'm particularly excited to have event handlers hoisted into props. |
I learned that Didn't push on Friday because inlining |
Uses
type-fest
and${ prefix }key
to teach the types about all possible pseudoprops (beyond the ones that were enumerated in the previous typing).My first pass at this added types for all of the prefix keys to
types.ts
, because I didn't want to cause any concerns about circular imports. Then, I realized./parseStyleProps
is already being imported, so I tried to refactor to instead define them there:That breaks the type in ways I'm not eager to diagnose, especially since you don't even know I'm writing this PR.
I do see some errors in
npm run test
, but they are the same with/without this PR.