hn-special icon indicating copy to clipboard operation
hn-special copied to clipboard

High contrast option changes all colors to black and white instead of simply increasing contrast

Open extesy opened this issue 8 years ago • 14 comments

Repro steps:

  1. Install extension
  2. Enabled "high contrast" option. Set "dark theme" to off or on - it doesn't matter.
  3. Everything is black and white, not orange

extesy avatar Jul 27 '16 17:07 extesy

Weird, I just tested the following but it works fine:

  1. Remove the extension
  2. Install from chrome web store
  3. Enable dark theme
  4. Disable dark theme

The dark theme gets disabled correctly.

Can you look at localStorage in the HN home page and show us what's there?

gabrielecirulli avatar Jul 27 '16 17:07 gabrielecirulli

Just reinstalled the extension and I still have a dark theme stuck independent of the option value. How do I look into its local storage?

extesy avatar Jul 27 '16 17:07 extesy

Ok, I found it:

hnspecial-defaults: {"visual_theme":true,"dark_theme":false,"high_contrast":false,"gray_visited_links":false,"infinite_scrolling":true,"open_links_in_new_tabs":false,"highlight_links_when_returning":true,"accurate_domain_names":true,"mark_as_read":false,"sticky_header":false,"user_tooltips":false,"hide_downvote":false}

hnspecial-settings: {"visual_theme":true,"dark_theme":false,"high_contrast":true,"gray_visited_links":true,"infinite_scrolling":true,"open_links_in_new_tabs":true,"highlight_links_when_returning":true,"accurate_domain_names":true,"mark_as_read":false,"sticky_header":false,"user_tooltips":true,"hide_downvote":false}

hnspecial-settings-version: 11

extesy avatar Jul 27 '16 17:07 extesy

I did some more playing with options and turns out its the "high contrast" option that changes everything to black and white. Previously it just increased the contrast.

extesy avatar Jul 27 '16 17:07 extesy

I have the same problem. I believe the problem is the combination of Dark theme OFF and High contrast ON, since it works when High contrast is OFF.

ghost avatar Jul 27 '16 17:07 ghost

Here's the formatted hn_theme_light_contrast.css I see in the Chrome developer tools: https://gist.github.com/bobmichael/a59737558f06de0c1bfdeb43aec91c10

ghost avatar Jul 27 '16 17:07 ghost

Is this what you're referring to?

hacker news 2016-07-27 7 pm-55-52

gabrielecirulli avatar Jul 27 '16 17:07 gabrielecirulli

@gabrielecirulli yep, that's what I'm referring to.

ghost avatar Jul 27 '16 17:07 ghost

Yeah that's the new high contrast theme. I guess we have a different question to ask then: do we 1) make high contrast a modifier to each theme, or 2) should it be its own theme?

I think option 1 is what people are expecting and it makes sense to me.

PxlBuzzard avatar Jul 27 '16 17:07 PxlBuzzard

Yes, it should be (1). Because non-contrast regular theme is way too low contrast, almost unusable, I can barely read anything. But I also don't want black-and-white theme.

extesy avatar Jul 27 '16 18:07 extesy

This should be fairly simple to do by refactoring hn_theme_light_contrast.styl into a more generic hn_theme_high_contrast.styl which just adds some extra styles instead of rendering _theme. The theme could add an extra class to the HTML in order to allow high-contrast to distinguish.

gabrielecirulli avatar Jul 27 '16 20:07 gabrielecirulli

For reference, this is what the high contrast light version should look like (taken from an old version):

hacker news 2016-07-27 10 pm-37-20

gabrielecirulli avatar Jul 27 '16 20:07 gabrielecirulli

Yes, this is the color I'd like to see. By the way, I find your definition of "high contrast" a bit strange. The image above is normal contrast and default theme is very low contrast. I'm not sure what monitor setup do you have, but default colors make the text very hard to read. Please apply these guidelines: http://webaim.org/blog/wcag-2-0-and-link-colors/

extesy avatar Jul 27 '16 22:07 extesy

Fair point. The default theme is kinda calibrated to my personal vision, also based on my Macbook's monitor. It probably shows very differently on other monitors.

gabrielecirulli avatar Jul 28 '16 14:07 gabrielecirulli