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

Variant for slot doesn't work #44272

Open
1 task done
twawszczak opened this issue Oct 30, 2024 · 0 comments
Open
1 task done

Variant for slot doesn't work #44272

twawszczak opened this issue Oct 30, 2024 · 0 comments
Assignees
Labels
customization: theme Centered around the theming features status: waiting for maintainer These issues haven't been looked at yet by a maintainer

Comments

@twawszczak
Copy link

twawszczak commented Oct 30, 2024

Search keywords

variants, slots, props, evaluation

Latest version

  • I have tested the latest version

Steps to reproduce

Link to live example: https://stackblitz.com/edit/github-nynfvf?file=src%2Fthene.ts

Steps:

  1. Customize theme with components => MuiSelect => styleOverrides
  2. Define a variant for root and icon slots, both with props: props: { size: 'small' }

Current behavior

Variant for root is recognized and applied, for icon - it's not

Expected behavior

As far as I understand, also a variant for a slot should work.

Context

I tried for the icon a hardcoded props evaluation:

props: () => true

and it works. I also debugged size prop evaluation with:

props: ({ size }) => console.log(size)

and initially it has correct value small but immediately during next evaluation it's undefined What's surprising for me, it behaves exactly the same for root, but doesn't break variant's styling for root 🤔

Your environment

No response

@twawszczak twawszczak added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Oct 30, 2024
@zannager zannager added the customization: theme Centered around the theming features label Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customization: theme Centered around the theming features status: waiting for maintainer These issues haven't been looked at yet by a maintainer
Projects
None yet
Development

No branches or pull requests

3 participants