Re: [csswg-drafts] [selectors] decide on :blank (#1967)

To agree with @annevk's original sentiment here, I think we need to decide on a direction for `:whitespace-only` vs. `:blank` and move forward. This is a rather crucial feature for developers. Current workarounds largely rely on build tools to strip all whitespace to permit using the current implementation of `:empty`.

I agree with @Fast-Nick's point that changing the current implementation would be more confusing, not to mention that it would introduce a breaking change ([Don’t Break The Web](https://flbrack.com/posts/2023-02-15-dont-break-the-web/)).

However, I think most developers don't have a use case for `:empty` outside of what `:whitespace-only` provides, so this would solve those cases.

Developers set up their apps working a specific way, so having them suddenly switch when already live and functional could be annoying, but if this is a risk the CSSWG is willing to run, I believe that it would be net good long-term. We'll likely be writing `:empty` for decades to come, and having one API for that feature might be best, though I've argued against that in the past.

I've set up a few apps with this `:empty` vs. with-whitespace distinction, which I would have to refactor now, but those are edge cases at best. If this is obstructing development, I think browsers should move forward in implementing this the way the CSSWG resolved to [above](https://github.com/w3c/csswg-drafts/issues/1967#issuecomment-424788796).

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


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

Received on Thursday, 13 February 2025 17:45:51 UTC