Re: [csswg-drafts] [selectors] New pseudo-class that matches the current URL fragment (#6942)

Just to add a voice here, at present `:target` is more or less useless for apps that dynamically render and update their content. Not only does `:target` match nothing at pageload (since as you mentioned, the element isn't present in the document at that time), it also can't be updated to match anything.

Perhaps an alternative would be to add a JS API to allow a page to set the current `:target`? Perhaps including scrolling to that element.

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


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

Received on Monday, 7 February 2022 17:37:03 UTC