BookStackApp / BookStack

A platform to create documentation/wiki content built with PHP & Laravel
https://www.bookstackapp.com/
MIT License
14.44k stars 1.83k forks source link

Change inline code highlighted text #5028

Open diasdmhub opened 2 months ago

diasdmhub commented 2 months ago

Attempted Debugging

Searched GitHub Issues


Describe the Scenario

Whenever I format a text to inline code and click on it, the text is highlighted and becomes very hard to read. If I select the text, it becomes even harder to read. It sort of takes on a high contrast color.

Unselected inline code text

image

Clicked inline code text

image

Selected inline code text

image


How can I change this highlight color to something easier to read?


Hosting Environment

ssddanbrown commented 2 months ago

Hi @diasdmhub, If you want to override the default browser/OS text selection color, you could add the following to your "Custom HTML Head Content" customization setting in BookStack:

<style>
  /* Use a purple background and white text for just code block elements*/
  .page-content code::selection { background: #b86ad3; color: #FFF; }

  /* As above, but for all page content elements*/
  .page-content *::selection { background: #b86ad3; color: #FFF; }
</style>

There are two examples in there, you could choose the one you want and tweak the colors as desired.

diasdmhub commented 2 months ago

Thanks @ssddanbrown. The purple background is easier on my eyes.

However, as shown in my clicked example, just clicking on an inline code text will highlight it in blue. Note that it is not a selection, it is just a click or placing the cursor on the inline code text.

bookstack_horrible_code_highlight

My browser does not highlight any code text like this. Only Bookstack's text editor does that. I wish it wouldn't highlight the text like that.