Skip to content

[css-pseudo] Click or Tap Location #12172

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

Open
Crissov opened this issue May 7, 2025 · 0 comments
Open

[css-pseudo] Click or Tap Location #12172

Crissov opened this issue May 7, 2025 · 0 comments

Comments

@Crissov
Copy link
Contributor

Crissov commented May 7, 2025

As part of the highlight pseudo-elements I think it might be helpful to introduce an empty pseudo-element that was located at the point of a mouse click or area of a finger tap, e.g. ::hit. This would enable authors to add visual clues for when and where a pointer interaction has happened, which is especially helpful in presentations for other spectators, although some users also employ it as an accessibility hint for themselves. Unlike OS or app features, a CSS-native solution could interact with other Selectors, so a click on a button or link could be styled differently than one on a paragraph, for instance.

I believe it has been proposed, but not added yet to css-anchor, to make the mouse pointer position a predefined and dynamic anchor reference. Combined with :active, this might look like a possible alternative, but it would involve another element box, whereas a designated pseudo-element could be styled directly. On the other hand, ::hit could solve this if it could be an anchor element.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant