svelte icon indicating copy to clipboard operation
svelte copied to clipboard

fix `::selection` in chrome

Open jimmywarting opened this issue 2 years ago • 5 comments

Describe the bug

I'm tiered of re-writing and reporting the same issue to multiple services about the use of root variables inside of ::selection So i'm just going to link to same github issue that explains it:

https://github.com/primer/css/pull/2472 https://www.azabani.com/2022/09/01/meet-the-css-highlight-pseudos.html#accessing-global-constants

it's very annoying to not be able to select anything.

Reproduction

always in chrome with exp flag.

Logs

No response

System Info

chrome

Severity

annoyance

jimmywarting avatar Jul 04 '23 15:07 jimmywarting

sorry i dont get how does ::selection relates to svelte? do you have a reproduction in Svelte that explains the issue you are facing?

tanhauhau avatar Jul 06 '23 00:07 tanhauhau

it have not something to do with svelte but the sveltes own website. that makes use of ::selection on https://svelte.dev/

jimmywarting avatar Jul 06 '23 11:07 jimmywarting

eg: https://svelte.dev/_app/immutable/assets/TryTerminal.b09557f2.css

::selection {
  background: var(--sk-selection-color)
}

the variable is not found...

jimmywarting avatar Jul 06 '23 11:07 jimmywarting

It works for me though 🤔 Can you post a video or screenshot? Also, whats your OS

PuruVJ avatar Jul 06 '23 11:07 PuruVJ

Note that https://github.com/primer/css/issues/2411 is currently only reproducible with Chrome's chrome://flags/#enable-experimental-web-platform-features enabled.

jimmywarting avatar Jul 06 '23 12:07 jimmywarting

I have no idea what's being reported here. I enabled that flag, and I can still select text on https://svelte.dev (including in the terminal widget) just fine.

The linked issue does not explain what your concern is. I'm sure you'd rather not repeat yourself, but maintainers would rather not reverse engineer vague bug reports from unrelated repos. Please clarify what the problem is, or we have no choice but to close this.

Rich-Harris avatar Apr 03 '24 16:04 Rich-Harris