aidenybai / million

Optimize React performance and make your React 70% faster in minutes, not months.
https://million.dev
MIT License
15.89k stars 558 forks source link

Error rendering String Css custom properties (Css variables) in styles property #975

Closed lcoronelp closed 3 months ago

lcoronelp commented 4 months ago

What version of million are you using?

3.0.3

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

yarn

What operating system are you using?

Linux

What browser are you using?

Chrome

Describe the Bug

If I define a div within a component optimized by million.js (when loads inside a < slot >) that contains CSS custom properties in styles, it only inserts it into the HTML if the custom property is numeric (when loads inside a ).

If it is string, it does not add it.

Whereas in a component not optimized by million, it works perfectly.

What's the expected result?

In the example https://codesandbox.io/p/devbox/cx79w2, both boxes should have a yellow background.

Link to Minimal Reproducible Example

https://codesandbox.io/p/devbox/cx79w2

Participation

github-actions[bot] commented 4 months ago

Thanks for opening this issue! A maintainer will review it soon.

aeyll-11 commented 4 months ago

@lcoronelp Hi, i hope you are doing well. I dont know what exactly happened but removing the paragraph render the yellow in your case. Paragraph not removed. screen2

Paragraph removed screen1

lcoronelp commented 4 months ago

@aeyll-11, thank you for the comment!

Also, if the paragraph is removed, then the <slot> element doesn't load.

I think this is because it has only one child, and one of two things happens:

But in any case, the problem persist :(

tobySolutions commented 4 months ago

Thanks for bringing this up @lcoronelp, I think @Aslemammad could be able to help here. I saw your reproduction and I was able to help with this.

I'm guessing it could likely be a slots issue and we just so happen to have fixed that already ( we have an experimental solution).

github-actions[bot] commented 3 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days.