Re: [csswg-drafts] Proposal for a user interaction :drag pseudo-class (#11584)

A common use case is hiding the dragged element([source node](https://html.spec.whatwg.org/multipage/dnd.html#source-node)) during drag and drop(DnD).
This could be done with the `:dragged` pseudo-class.

Timing-wise, I think this class should match at least after the drag-image has been calculated.
From the spec, I'm not sure exactly when that calculation occurs, but from a quick test it looks like it happens between `dragstart` and `pointercancel`.

---

**Note:**  
Currently, UAs **freeze** the `:active` and `:hover` states during drag and drop, instead of clearing them at or after `pointercancel`.
As a result, the source node matches `:active` and usually matches `:hover` **except when the pointer is not on the source node when DnD starts**.

https://github.com/w3c/pointerevents/issues/555

-- 
GitHub Notification of comment by sb3nder
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11584#issuecomment-3720592749 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 7 January 2026 20:08:41 UTC