sphinx_rtd_theme icon indicating copy to clipboard operation
sphinx_rtd_theme copied to clipboard

Make highlight-color lighter yellow

Open humitos opened this issue 5 years ago • 11 comments

Small change to make the highlight-color a little lighter.

I found that with this change it's easier to read what's highlighted, but still easily realized where is the highlighted text.

Before

Screenshot_2019-07-28_16-51-54

After

Screenshot_2019-07-28_16-48-47

NOTE: I don't know how to build these .sass files, so maybe the change is completely wrong.

humitos avatar Jul 28 '19 15:07 humitos

I'm not opposed to a lighter yellow, but here are some notes on this design change:

  • The lighter version of yellow could be less .. absolute yellow (rgb(255,255,0)). There is middle ground that retains the warmth of the current yellow
  • The lighter version of yellow might not be visually recognizable for readers with visual impairments (too low of contrast to the white background).
  • The current version is similarly not high enough contrast overall, depending on what text is highlighted (2.37/4.5), so a lighter color would help correct this.
  • I might support using a design feature on top of a background color change to aid users in recognizing these highlight elements

So, given the above, I'd be more enthusiastic about something like: image

This example:

  • Changes the font color on search results from gray to #40404 -- this is a separate issue, and we don't have good reason to use a muted color here
  • Implements a strong underline to retain visual distinction between highlight and standard text
  • Mimics other elements that we have that use a 2px border
  • Uses the same highlight color, but with lower alpha
  • Has a contrast ratio of 8.46:1 on highlighted text

agjohnson avatar Jul 29 '19 18:07 agjohnson

Thanks @agjohnson! I like your proposal. I will give it a try.

humitos avatar Jul 30 '19 10:07 humitos

I followed your recommendation and end up on this:

Screenshot_2019-07-30_13-17-32

humitos avatar Jul 30 '19 11:07 humitos

NOTE: I don't know how to build these .sass files, so maybe the change is completely wrong.

Just for the records, I was able to npm install and then npm run build. Then I installed this folder with pip install -e . and build a set of documentation with this theme. It worked!

humitos avatar Jul 30 '19 11:07 humitos

How does this new color look when combined with the browser native highlight color using Ctrl-F/Cmd-F?

jessetan avatar Jul 31 '19 06:07 jessetan

@jessetan take a look at these screenshots

Firefox

screenshot-0 0 0 0-9000-2019 07 31-12-41-03

Chrome

Screenshot_2019-07-31_12-39-12

I'm not sure if all the OS use the same colors for this, or if it even depends on some other color settings.

humitos avatar Jul 31 '19 10:07 humitos

There are CSS selectors to control the highlight color inside elements, it's something we could add here if we wanted.

Do the proposed changes seem okay so far? Is it clear text is highlighted, or does it maybe look too much like a button now?

agjohnson avatar Jul 31 '19 18:07 agjohnson

There are CSS selectors to control the highlight color inside elements, it's something we could add here if we wanted.

Are you referring to ::selection? I think that only works for user-selected text, not the browser search highlight color.

jessetan avatar Aug 24 '19 18:08 jessetan

There are two outstanding changes here around color names/values. Marking WIP.

agjohnson avatar Oct 16 '19 16:10 agjohnson

I won't be able to finish this PR. It may be better if @nienn can take ownership of it, probably. What do you think, @nienn?

humitos avatar Oct 21 '21 12:10 humitos

@humitos sure, I can do that.

I guess also that the changes in this PR and in the #1170 should be combined, as they are affecting the exact same thing. I'll probably pull those changes here to bring the conversation back where it started.

nienn avatar Oct 21 '21 13:10 nienn

I don't think I will come back to this PR again. @benjaoming feel free to re-open and update it if you consider it useful.

humitos avatar Oct 26 '22 11:10 humitos