kazzkiq / CodeFlask

A micro code-editor for awesome web pages.
https://kazzkiq.github.io/CodeFlask/
MIT License
1.07k stars 120 forks source link

Improve "select all" visuals #140

Closed thdoan closed 4 months ago

thdoan commented 4 months ago

When you select all text, it doesn't look very good:

image

I think this has to do with how the component is designed, with two layers of text on top of each other. Can this be improved?

FIameCaster commented 4 months ago

Shameless plug, but since CodeFlask hasn't been maintained for years, you should consider using Prism code editor instead. It's maintained and offers slightly better performance, more features, a smaller bundle size and many optional extensions.

If you want to stick with CodeFlask, this is an easy fix. Just make the color on the textarea's selection transparent. This works since the syntax highlighted code has a higher z-index.

.codeflask__textarea::selection {
    background: hsl(210, 100%, 85%);
    color: transparent;
}