Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make highlight-color lighter yellow #810

Closed
wants to merge 5 commits into from
Closed

Conversation

humitos
Copy link
Member

@humitos humitos commented Jul 28, 2019

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.

@agjohnson
Copy link
Collaborator

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

Copy link
Collaborator

@agjohnson agjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should have reviewed instead of comment. I'll request more changes here, I don't think the current change is the best solution to this problem.

@humitos
Copy link
Member Author

humitos commented Jul 30, 2019

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

@humitos
Copy link
Member Author

humitos commented Jul 30, 2019

I followed your recommendation and end up on this:

Screenshot_2019-07-30_13-17-32

@humitos humitos requested a review from agjohnson July 30, 2019 11:19
@humitos
Copy link
Member Author

humitos commented Jul 30, 2019

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!

@jessetan
Copy link
Contributor

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

@humitos
Copy link
Member Author

humitos commented Jul 31, 2019

@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.

@agjohnson
Copy link
Collaborator

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?

Copy link
Collaborator

@agjohnson agjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking close. My notes are for code organization and color selection.

The grey I noted to change to a darker color is:
image

@@ -220,6 +220,9 @@
background: $highlight-color
display: inline-block
font-weight: bold
font-style: italic
color: #404040
border-bottom: 2px solid rgb(255, 190, 0)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Colors are already defined as variables, #404040 should be a named color already. The yellow you have defined here is different than the yellow defined via Wyrm and should be used as a named color variable either way.

I'd also support using #404040 as the font color for #search-results, so that the text in our search results is easier to read.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand correctly, wyrm defines gray-dark as #333333 and gray as #555555. So, they are not exactly the same as #404040. What I should do?

I was thinking on adding as a variable with the highlight- prefix, like:

// Sphinx highlight color
$highlight-background-color:          rgba(255, 220, 0, 0.5)
$highlight-text-color:                #404040

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from bower_components/wyrm/sass/wyrm_core/_wy_variables.sass:

$black:                               #000 !default
$gray-darker:                         #222 !default
$gray-dark:                           #333 !default
$gray:                                #555 !default
$gray-light:                          #999 !default
$gray-lighter:                        #ccc !default
$white:                               #fff !default

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd probably use $gray-dark. The visual difference between #333333 and #404040 is pretty marginal.

@@ -59,7 +59,7 @@ $sidebar-border-color: $table-border-color
$sidebar-title-background-color: $table-border-color

// Sphinx highlight color
$highlight-color: $yellow
$highlight-color: rgba(255, 220, 0, 0.5)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a different shade of yellow than the defined yellow from Wyrm. It would be better to drop the alpha channel and instead use a tint of the defined yellow from Wyrm. rgb(248,225,135) is a closer approximation of this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't follow you here.

I found Wyrm defining $yellow as #F1C40F which is rgb(241,196,15).

Where rgb(248,225,135) comes from? Why it's better than my suggestion?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rgb(248,225,135) is a lighter tint of $yellow. HSL is easier to understand than RGB here:

  • $yellow == rgb(241, 196, 15) == hsl(48.1, 89%, 50.2%)
  • light yellow == hsl(48.1, 89%, 75%) (we increased l (lightness) from 50% to 75%) == rgb(248, 225, 135)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Niiiice! Thanks a lot of the explanation ;)

@jessetan
Copy link
Contributor

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.

src/sass/_theme_rst.sass Outdated Show resolved Hide resolved
@agjohnson agjohnson added the PR: work in progress Pull request is not ready for full review label Oct 16, 2019
@agjohnson
Copy link
Collaborator

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

@humitos
Copy link
Member Author

humitos commented Oct 21, 2021

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?

@nienn
Copy link
Contributor

nienn commented Oct 21, 2021

@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 nienn self-assigned this Oct 21, 2021
@humitos
Copy link
Member Author

humitos commented Oct 26, 2022

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 humitos closed this Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: work in progress Pull request is not ready for full review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants