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

[docs] Fix alpha usage #43194

Merged
merged 1 commit into from
Aug 6, 2024
Merged

[docs] Fix alpha usage #43194

merged 1 commit into from
Aug 6, 2024

Conversation

siriwatknp
Copy link
Member

alpha() will throw an error if the input is a CSS variable. The usage is incorrect and the reason that the code does not throw error is because the documentation pages are not using CSS variables yet.

@siriwatknp siriwatknp added the docs Improvements or additions to the documentation label Aug 6, 2024
@siriwatknp siriwatknp requested a review from a team August 6, 2024 07:04
@mui-bot
Copy link

mui-bot commented Aug 6, 2024

Netlify deploy preview

https://deploy-preview-43194--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against fdc88d6

Copy link
Member

@alexfauquette alexfauquette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it work with CSS Variable after this PR?

I remembered that at the beginning of CSS vars provider, we had to do stuff like `rgba(${theme.vars.palette.primary.mainChannel} / 0.02)`

@siriwatknp
Copy link
Member Author

siriwatknp commented Aug 6, 2024

Would it work with CSS Variable after this PR?

Yes, it will work.

I remembered that at the beginning of CSS vars provider, we had to do stuff like `rgba(${theme.vars.palette.primary.mainChannel} / 0.02)`

I see. It is different use case, in my change, the color like grey[50] does not change between mode but in your example, the rgba(…) is required because primary.mainChannel is different between modes.

We can replace the usage of alpha() with color-mix() in a separate PR to improve the performance (no runtime-JS) but it's not in scope of this PR.

@siriwatknp siriwatknp merged commit 07431e5 into mui:next Aug 6, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants