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

Apply states in LVHA order (hover then active) #4617

Open
johnsicili opened this issue Dec 18, 2024 · 6 comments
Open

Apply states in LVHA order (hover then active) #4617

johnsicili opened this issue Dec 18, 2024 · 6 comments
Assignees
Labels
area:styles Style Panel is the CSS panel on the right prio:2 Always look for prio:1 issues first before working on prio:2 type:feat Features and enhancements

Comments

@johnsicili
Copy link
Contributor

I want active styles to have a higher specificity than hover. This way I can apply lets say scale on :hover and :active, press the button, and the button to change. Currently no change happens because :hover scale is overriding :active scale.

MDN

Styles defined by the :active pseudo-class will be overridden by any subsequent link-related pseudo-class (:link, :hover, or :visited) that has at least equal specificity. To style links appropriately, put the :active rule after all other link-related rules, as defined by the LVHA-order: :link — :visited — :hover — :active.

@johnsicili johnsicili added area:styles Style Panel is the CSS panel on the right type:feat Features and enhancements prio:2 Always look for prio:1 issues first before working on prio:2 labels Dec 18, 2024
@kof
Copy link
Member

kof commented Dec 18, 2024

Can you show an example of this where it makes sense?

@johnsicili
Copy link
Contributor Author

When adding the same property to both active and hover, active won't ever show like this:

hoveractive.mp4

Summary: link has scale big on hover and scale small on active. There is no indication the link is active though.

@kof
Copy link
Member

kof commented Dec 18, 2024

I am not sure there is a common consensus what should be applied in this case, in css it's just whatever wins depending on specificity. Maybe we should be able to do it depending on what was defined last ... which is still very implicit.

I think we are missing important UI where this can be made visible. What's WF's take on this?

@johnsicili
Copy link
Contributor Author

Can you show an example of where it makes sense to have :hover > :active?

@kof
Copy link
Member

kof commented Dec 18, 2024

Honestly haven't thought about it, but my first reaction is that when I hover something, I should be able to see the effect, even if element is already active. I might be wrong.

@kof
Copy link
Member

kof commented Dec 19, 2024

alright, lets do this, because figuring out customization for this is right now too complex and this order makes sense:

  1. link/visited
  2. hover
  3. focus
  4. active

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:styles Style Panel is the CSS panel on the right prio:2 Always look for prio:1 issues first before working on prio:2 type:feat Features and enhancements
Projects
None yet
Development

No branches or pull requests

3 participants