cloudflare-apps / smart-underline

Readable and beautiful underlines for every website.

Home Page:https://www.cloudflare.com/apps/smart-underline

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Underline masks don't respect `user-select` CSS

krilnon opened this issue · comments

This is a super tiny behavior, but if you have CSS like:

a:hover {
    -webkit-user-select: none;
}

... and then you hover over an underlined link with some text selected, there's this weird artifacting:

user-select

Hey @krilnon this is a great catch. We treat these cases as yet another grouping within renderStyles and issue specific styles for ::selection (or abort) whenever a SmartUnderline location or its children do not allow selection. Unfortunately though in the default case (SmartUnderline.init({ location: '' })) this would require running getComputedStyle on every element of the page, which I think is probably too expensive for the gains we would get here. Thanks again for reporting but I’m going to close this as wont fix.

No worries; thanks for taking a look!