[List] Improve hover/select/focus UI display#21930
Conversation
|
@material-ui/core: parsed: +0.12% , gzip: +0.04% |
|
@joshwooding What's missing from the pull request? |
Nothing :) Had something I wanted to double-check but it was fine. |
|
The logic looks really close to what we have on Pagination and TreeView. I think that we can scale it to all the other components now :) |
mnajdova
left a comment
There was a problem hiding this comment.
It's much more clear now what the there states represents. Do we want to add a combination of focusedVisible + hover? It won't be a problem as we cannot have a conflict, but just something to consider maybe? That way the combination of selectors will always be predictable when the opacity is calculated (we are doing it for selected + other states, why not between hover and other states too).
From what I recall during the initial implementation of the states styles (for the new MD specs), we made as many simplifications as possible in order to simplify overrides and the logic itself. We have ignored a bunch of possible states. Later on, we realized that it was important to differentiate the opacity style of "focus visible" vs. "hover" because they had significant different use cases (with focus visible, you need more contrast than a hover. But at the same time, focus visible is too much contrast for a hover), so we added coverage for it. Regarding the combinatory of the two states. Is the added complexity worth it? |
Probably not. My point was, to me it was not clear why we would combine some states and not others, and where is this documented and how can we make sure it will be consistent across the components. On the other hand if I know that I always need to combine state, then we could be more confident that the consistency will be kept. Combination of opacity does not have to be the answer for this, but it would be useful, at least for me if we have some form of documentation or guide on how do we combine states. Or if we don't combine all of them, than maybe it would be better to directly define in the theme the combinations that we support instead of doing calculation sometimes, but not always. Anyway all this is probably just for my clarification and should not block this PR if the colors used now are by design. |
Closes #5186
Related to #19343