feat(preset-mini): add default mouse media as alternative to @hover#3233
feat(preset-mini): add default mouse media as alternative to @hover#3233antfu merged 1 commit intounocss:mainfrom
Conversation
✅ Deploy Preview for unocss ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
Would that make sense to be /cc @LittleSound I remember you were working on a similar things, wonder if you have any feedback on this? |
Responding to hover events on mobile webpages can be quite tricky. To overcome this, I usually write |
Due to how tagged pseudo works (
group-x, etc), it is difficult to weave@hoversupport.This PR copy one of
media-xvariant default theme (mouse) from preset-wind so we can usemedia-mousevariant in preset-mini to add the@hovermedia query without adding the:hoverpseudo. Note thatmedia-xis separate fromgroup-x, so to combine you may need to, well, combine the syntax (see test) or use shortcut. I personally think that this combination is better served via shortcut to keep the atomicity of the variant.Reference:
unocss/packages/preset-wind/src/theme.ts
Line 193 in 5dcc8ce
This should help #3076 with only preset-mini.