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

TS autocomplete for inline style props is a bit slow #187

Closed
binhxn opened this issue Sep 5, 2020 · 4 comments
Closed

TS autocomplete for inline style props is a bit slow #187

binhxn opened this issue Sep 5, 2020 · 4 comments
Labels
typescript TypeScript related

Comments

@binhxn
Copy link

binhxn commented Sep 5, 2020

Bug report

Describe the bug

Maybe this is more of a clarification than it is a bug. When adding styles to a styled component and referencing tokens from the config file, autocomplete has been great and fast.

However, when attempting to override the current styles by using the inline css prop, autocomplete is a bit slow. This behavior also occurs on non-style props as well (i.e. onClick and other event handlers).

To Reproduce

  1. Create styled component using the styled function
  2. Add CSS property referencing token in config file
  3. With newly created styled component, override previous styles with css prop
  4. Notice slow autocomplete on Styled component (on newly created CRA project)

Expected behavior

Expected fast or same autocomplete speed when referencing tokens through both styled function and inline css props

Screen recording

stiches-autocomplete-slow

System information

  • OS: macOS Catalina - v10.15.6
  • Version of Node.js: v14.4.0
@binhxn binhxn changed the title TS Autocomplete for inline style props is a bit slow TS autocomplete for inline style props is a bit slow Sep 6, 2020
@peduarte peduarte added the typescript TypeScript related label Sep 18, 2020
@peduarte peduarte added this to the Release v1 milestone Oct 14, 2020
@peduarte peduarte removed this from the v1 🚀 milestone Feb 9, 2021
@peduarte
Copy link
Contributor

We've published a pre-release of Stitches beta 🚀

Core:

npm install @stitches/core@0.1.0-canary.0

React:

npm install @stitches/react@0.1.0-canary.0

This issue should have been resolved in the beta version. We'd appreciate it if you could verify it.

⚠️ Please refer to this migration guide as there are some breaking changes.

@binhxn
Copy link
Author

binhxn commented Feb 12, 2021

Hello @peduarte

So it seems autocomplete speed has improved, which is great! However, I spotted two new issues.

  1. Previously, the value of my CSS property (in this case, backgroundColor) would autocomplete and map to my available theme values. Now, it does not; it looks like autocomplete returns with raw CSS colors, but not colors from the theme. I also tried abstracting the styles and passing it to the component consuming the styled component, but no luck.
  2. When trying to apply native event handlers, such as onClick, my styled component does not capture that during autocomplete. It looks like it's not recognized.

Here's a screen recording for more context:

stitches-typescript-autocomplete-bugs.mov

Thoughts on this? Please let me know if I'm using Stitches incorrectly in any way.

@peduarte
Copy link
Contributor

Thanks!
Cc @jonathantneal @hadihallak

@peduarte
Copy link
Contributor

Closing in favour of #393 and https://github.com/modulz/stitches/issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typescript TypeScript related
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants