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

[React] Remove string index fallback for CSS properties #24911

Merged

Conversation

pelotom
Copy link
Contributor

@pelotom pelotom commented Apr 11, 2018

Resolves #24568.

With csstype 2.2, the property list should hopefully be complete enough that we can remove the string index from CSSProperties.

Please fill in this template.

  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code. (Compile and run.)
  • Add or edit tests to reflect the change. (Run with npm test.)
  • Follow the advice from the readme.
  • Avoid common mistakes.
  • Run npm run lint package-name (or tsc if no tslint.json is present).

Select one of these and delete the others:

If changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes: <>
  • Increase the version number in the header if appropriate.
  • If you are making substantial changes, consider adding a tslint.json containing { "extends": "dtslint/dt.json" }.

@pelotom pelotom force-pushed the react-closed-css-properties branch from 36ba488 to 8e9416d Compare April 11, 2018 15:56
@typescript-bot typescript-bot added Popular package This PR affects a popular package (as counted by NPM download counts). Awaiting reviewer feedback labels Apr 11, 2018
@typescript-bot
Copy link
Contributor

typescript-bot commented Apr 11, 2018

@pelotom Thank you for submitting this PR!

🔔 @asvetliakov @johnnyreilly @bbenezech @pzavolinsky @digiguru @ericanderson @morcerf @tkrotoff @DovydasNavickas @onigoetz @theruther4d @guilhermehubner @JoshuaKGoldberg @jrakotoharisoa @flaub @alelode @UJosue10 @dawnmist @Ogglas @santiagodoldan @brmenchl @snerks @Havret - please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead.

@typescript-bot
Copy link
Contributor

@pelotom The Travis CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks!

@johnnyreilly johnnyreilly merged commit fe3fcd7 into DefinitelyTyped:master Apr 11, 2018
@johnnyreilly
Copy link
Member

Thanks!

@pelotom pelotom deleted the react-closed-css-properties branch April 11, 2018 21:42
@frenic
Copy link
Contributor

frenic commented Apr 11, 2018

@johnnyreilly React supports CSS Custom Properties. What's our thoughts on this? Should we recommend module augmentation?

@pelotom
Copy link
Contributor Author

pelotom commented Apr 12, 2018

@frenic Good catch, I didn't know about that feature. Module augmentation seems like the right approach...

@pelotom
Copy link
Contributor Author

pelotom commented Apr 12, 2018

As a lightweight (if not type safe) alternative, you can always do this of course:

<div style={{ ['--my-variable' as any]: 'red' }}>
  ...
</div>

@abelino
Copy link

abelino commented Apr 12, 2018

We've also lost ability to use pseudo types. csstype exports a union of supported pseudos but seems like its not included in StyleRules. Is this intended?

https://github.com/frenic/csstype#pseudo-types

@pelotom
Copy link
Contributor Author

pelotom commented Apr 12, 2018

@abelino inline styles can't use pseudo types...

@frenic
Copy link
Contributor

frenic commented Apr 12, 2018

We've also lost ability to use pseudo types.

@abelino what @pelotom said with React inline styles OOTB. But if the types for a third party library relies on the index signature some how it could likely cause some problems.

@frenic Good catch, I didn't know about that feature. Module augmentation seems like the right approach...

@pelotom We should add a comment about that. I'll fix it.

@pelotom
Copy link
Contributor Author

pelotom commented Apr 12, 2018

@abelino re. @-rules, if you’re using Material UI that should be fixed by mui/material-ui#11007

@abelino
Copy link

abelino commented Apr 16, 2018

@pelotom thanks for that!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Popular package This PR affects a popular package (as counted by NPM download counts).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants