h16nning / typora-gitbook-theme

This is a Typora theme is inspired by gitbook.com. Most of the user interface has been overhauled. It contains three variants: two light variants and one dark theme.
GNU General Public License v3.0
305 stars 51 forks source link

Minor Display Issue When Selecting Texts #13

Closed Yuxin-Ren-SZ closed 3 years ago

Yuxin-Ren-SZ commented 3 years ago

image

Hi! As I circled out in the picture that when selecting a part of text containning highlighted text, the background of beginning of each line and the end of each line is not properly hightlighted.

h16nning commented 3 years ago

Hi @Williams-Ren, unfortunately the options for styling selected text in CSS are extremely limited (to be exact it is only possible to modify the background color, text color and the text shadow). Most of its attributes are determined by the browser engine (for Typora that is Chromium on Windows and Linux and WebKit on macOS).

Chromium seems to handle padding (which I am using around the highlighted text) sitting within selected text a little bit different than WebKit. On macOS it is looking like it should:

Screenshot 2021-02-22 um 17 32 10

I will have a look into this in the following days and try to figure out a workaround for Chromium. However, I am not sure if there is one 😕

h16nning commented 3 years ago

Hey, sadly I couldn't come up with a solution. If I am able to do so in the future, I will get back to this issue.