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

add theme override: menu item selected + hover #2598

Closed
wc-matteo opened this issue Mar 9, 2022 · 8 comments
Closed

add theme override: menu item selected + hover #2598

wc-matteo opened this issue Mar 9, 2022 · 8 comments
Labels
feature request New feature or request priority: low

Comments

@wc-matteo
Copy link

wc-matteo commented Mar 9, 2022

This function solves the problem (这个功能解决的问题)

To style the text/icon/etc when a menu item is selected differently than when it's not selected while the user is hovering on that item

Expected API (期望的 API)

add new theme override props like: itemTextColorActiveHover
(don't forget the inverted variant!)

@github-actions github-actions bot added the feature request New feature or request label Mar 9, 2022
@wc-matteo wc-matteo changed the title add theme override: menu item active + hover add theme override: menu item selected + hover Mar 9, 2022
@Talljack
Copy link
Contributor

The design is originally designed like this, which is more convenient for users to adjust. If you need to keep the hover and active colors the same, you can set these two variables to be the same.

@wc-matteo
Copy link
Author

unless I'm mistaken, right now there is now way (using theme override) to have a different hover text/icon/etc color ONLY for the selected menu item:

to give an example this is what I implemented using n-menu + custom css:

image

when the menu item is selected the hover text/icon/etc should be a dark color (cause the selected menu item bg is light), when it's not selected, the opposite (cause the menu item bg is dark).

BONUS

image

would be nice to have a configurable hover bg like this as well

@Talljack
Copy link
Contributor

image
Sorry, we understand the instance you said, but you set the itemColorActive variable to set the bg, and then you can set the color of the hover through the itemTextColorHover and itemIconColorHover variables, the effect is as above.

@wc-matteo
Copy link
Author

yes but I need 2 different hover colors! I need a hover color for when I have the active bg and another hover color for when I don't have the active bg.

@Talljack
Copy link
Contributor

yeah, maybe add new theme override props

@07akioni
Copy link
Collaborator

07akioni commented Mar 13, 2022

yes but I need 2 different hover colors! I need a hover color for when I have the active bg and another hover color for when I don't have the active bg.

This is really a tough problem. How to define the theme variable name. We need some time to think.

@wc-matteo
Copy link
Author

there already is itemXXXColorActive and itemXXXColorHover. You could add itemXXXColorActiveHover.

Also. it'd be nice to have the term actve be changed to selected. To better align it with the term used in the documentation and because active also represents another concept.

@07akioni
Copy link
Collaborator

there already is itemXXXColorActive and itemXXXColorHover. You could add itemXXXColorActiveHover.

Also. it'd be nice to have the term actve be changed to selected. To better align it with the term used in the documentation and because active also represents another concept.

Active in naive ui is named as pressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request priority: low
Projects
None yet
Development

No branches or pull requests

3 participants