Skip to content

Add light theme #120

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

Merged
merged 8 commits into from
Oct 19, 2019
Merged

Add light theme #120

merged 8 commits into from
Oct 19, 2019

Conversation

adtac
Copy link
Contributor

@adtac adtac commented Apr 16, 2019

Here's what it looks like:

light

Closes #98

@adtac adtac force-pushed the adtac/light branch 2 times, most recently from a7aeeae to 9c28b1f Compare April 16, 2019 03:25
@adtac
Copy link
Contributor Author

adtac commented Apr 16, 2019

I'm not very good with frontend stuff, so please feel free to point out anything stupid lol

@erayd erayd self-requested a review April 16, 2019 03:32
Copy link
Collaborator

@erayd erayd left a comment

Choose a reason for hiding this comment

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

Initial impressions are good, but some of the features from the current styling are missing.

image
image

The biggest concern here is contrast. As you can see, the light theme lacks contrast between the matched portions of the text and the popup background, and the initial popup entry has the same background colour as the search field.

I would also like it if the active-item highlighting was a bit more subtle. At the moment the change feels much more distinct than it is in the dark theme. Perhaps darkening the entry background might help improve this, and resolve the background contrast issue above at the same time.

I think your choice of colours generally is excellent - other than the points above, contrast is largely excellent, and the colours look attractive and match well, without being too aggressive.

@adtac
Copy link
Contributor Author

adtac commented Apr 16, 2019

@erayd thanks for the review. Previously, match text colour was coupled with the hint background colour for some reason. I've decoupled the two now, so it should be much better. Here's what the popup looks like now:

Untitled

I've amended the light theme commit as well.

@adtac adtac force-pushed the adtac/light branch 3 times, most recently from 9da0e5f to 1b6680a Compare April 16, 2019 04:32
@adtac
Copy link
Contributor Author

adtac commented Apr 16, 2019

(Made the badge a bit less dark to improve text contrast.)

@erayd
Copy link
Collaborator

erayd commented Apr 16, 2019

Definitely improving - thanks for your work on this 👍 .

Can you add some colour (or better contrast) back to the domain badge in the search field? It's fading into the background a bit:

image

Other Stuff

There is no noticable difference in the search field background colour based on whether it's focused or not. Compare with the dark theme to see what I mean - the dark theme gets this bit right. If the search field were generally lighter, that might make this easier to resolve. I know I asked for some contrast between the search field and the entries, but you don't need quite as much as is there now, and if it's causing problems then toning it down a little might be a simple fix.

When moving focus from the search field to the first item (e.g. by pressing the down-arrow key), the first item gets much lighter, and gives the impression that it's just been deselected. Changing the colour or shade is fine, but it needs to indicate to the user that this element has gained focus, not lost it.

@erayd
Copy link
Collaborator

erayd commented Apr 16, 2019

Here's another screenshot showing what it looks like with multiple custom stores configured:
scr-20190416-165402

@adtac
Copy link
Contributor Author

adtac commented Apr 16, 2019

@erayd updated. I was a bit hesitant to add non-grey colours to the mix as I didn't want it to be jarring, but I suppose it's alright to make the badge stand out a bit more.

Untitled

Hover is now darker than active so that it's more intuitive. The search field gets subtly lighter when it goes out of focus as well.

@erayd
Copy link
Collaborator

erayd commented Apr 16, 2019

Getting there. Now the domain badge has very low contrast with the 'remove-domain-badge' button though. Perhaps a light blue or something maybe?

@adtac
Copy link
Contributor Author

adtac commented Apr 16, 2019

Heh, you have a very keen eye, I missed that. Updated to a safer yellow :)

Copy link
Member

@maximbaz maximbaz left a comment

Choose a reason for hiding this comment

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

Very nice job! This is much better than I ever expected 👍

So far I only went through the code, but I would like to try it myself before merge, hopefully later tonight.

.part.login > .action:focus,
.part.login:focus > .name {
background-color: @hover-bg-color;
outline: none;
Copy link
Member

Choose a reason for hiding this comment

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

I think outline needs to be declared in popup.less, not here


document
.getElementsByTagName("html")[0]
.setAttribute("class", "colors-" + settings["theme"]);
Copy link
Member

Choose a reason for hiding this comment

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

Use .classList.add(`colors-${settings.theme}`), so that we don't accidentally override an existing class on <html> tag (now or in future).

Copy link
Member

Choose a reason for hiding this comment

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

In addition, please move this snippet to an earlier stage in the function, right after we retrieve settings. Right now I see a visible change of colors, when I open the popup, at first it is something white, and then in a split second it changes to dark theme.

Managed to catch a screenshot of it:

image

I confirm that this fixes the issue for my particular case, but to be on a safe side, can we perhaps even add class="colors-dark" directly in popup.html, to keep the theme by default dark even while we are loading settings? And this snippet would need to be adjusted to something like:

const root = document.getElementsByTagName("html")[0];
root.classList.remove("colors-light", "colors-dark");
root.classList.add("colors-${settings.theme}");

@maximbaz
Copy link
Member

Finally got to try this! Here's some of my feedback:

  1. I think we should be consistent in the way we highlight filter matches, if it is a different text color in dark theme, let's use text color in light theme too, not background color:

    image

    image

  2. The "Copy" buttons look like they are disabled, perhaps because the icon color is too light on a light background. Do you guys have the same impression?

  3. The "Copy" buttons and the "recency" badge (and maybe even the password store badge) look particularly hard to distinguish when the mouse is hovering the row:

    image

    image

    image

    image

  4. I agree that the domain filter should probably be light blue instead of red or yellow, a couple of suggestions just to give an impression, what do you think?

    background-color: #aad2f5;
    color: #343a40;

    image

    background-color: #39a3ff;
    color: white;

    image

@maximbaz
Copy link
Member

/cc a couple of people who I recall to be passionate about design and everyone who upvoted #98 so far, just to get a couple of extra opinions: @DamienCassou, @532910, @JanMa, @jakubtopic, @Tharre.

If anyone can't compile the branch to test, I'm willing to provide test builds, just say so.

I'd very much prefer to spend an extra time and get this right on the first try, so please, early feedback is very welcome.

@maximbaz maximbaz mentioned this pull request Apr 16, 2019
@Tharre
Copy link

Tharre commented Apr 16, 2019

The buttons look grayed out/disabled indeed.

The darker blue looks the nicest to me, but you might want to tone down the red if you go with it.

@erayd
Copy link
Collaborator

erayd commented Apr 17, 2019

I think we should be consistent in the way we highlight filter matches, if it is a different text color in dark theme, let's use text color in light theme too, not background color.

I disagree with this point - I actually think the way he's done the highlighting is spot on. Yes, it's different, but I don't see any issue with different themes being different, and the downside of a light pallette is it's harder to get good contrast with a text-colour change, the way the dark theme does it.

@adtac
Copy link
Contributor Author

adtac commented Apr 17, 2019

I think we should be consistent in the way we highlight filter matches, if it is a different text color in dark theme, let's use text color in light theme too, not background color:

It's currently both a different text colour and a different background colour. And as @erayd said, I personally think a small background contrast adds a lot to the visibility of the search matches. In fact, I wanted to update the dark theme to support this as well (I can still do this if others like the light theme's way of doing search matches better).

The "Copy" buttons look like they are disabled, perhaps because the icon color is too light on a light background. Do you guys have the same impression?

The "Copy" buttons and the "recency" badge (and maybe even the password store badge) look particularly hard to distinguish when the mouse is hovering the row

Agreed, I've updated this. It was a bit tricky because the classes use a SVG background with a hard-coded fill colour. I didn't want to create a separate SVG for the light theme as that's just an unnecessary maintenance overhead. As a result, the light theme is using CSS invert. While this is a perfectly valid solution for light/dark themes, implementing other themes will likely require hue rotate and other shenanigans.

I've also updated the badge to a dark blue. I agree with @maximbaz, @Tharre; it looks nicer:

Untitled

I confirm that this fixes the issue for my particular case, but to be on a safe side, can we perhaps even add class="colors-dark" directly in popup.html, to keep the theme by default dark even while we are loading settings? And this snippet would need to be adjusted to something like

If the dark theme is the default, I agree. I've made the change you suggested, but I'd also like to start a discussion on what the default theme itself should be. I think there's a case to be made that the default theme should be light for two reasons:

  • Most browsers come with a default light theme, so it's a bit jarring to have an extension not follow the standard.
  • v2 used to have a light theme, so sticking to a light theme would make the upgrade easier from a muscle memory perspective.

@ghost
Copy link

ghost commented Apr 17, 2019

So far I like the light theme a lot. Great work @adtac :-)
Maybe you could think about using the same yellow colours for highlighting as in the dark theme but this is just personal preference. I would also favour the light theme to be the default one, because light themes are also the default in Chrome and Firefox.

@DamienCassou
Copy link

I have used the light theme the whole day and I like it. Thank you for your work.

@maximbaz
Copy link
Member

It's currently both a different text colour and a different background colour. And as @erayd said, I personally think a small background contrast adds a lot to the visibility of the search matches. In fact, I wanted to update the dark theme to support this as well (I can still do this if others like the light theme's way of doing search matches better).

If this is the only way to get a good contrast and everyone is happy, I'm okay with it too 🙂

I think the color alone works good in the dark theme, but I would be curious to try out your idea, tell me a pair of text and background colors that you are thinking for the dark theme 🙂

As a result, the light theme is using CSS invert. While this is a perfectly valid solution for light/dark themes, implementing other themes will likely require hue rotate and other shenanigans.

Nice solution!

I think there's a case to be made that the default theme should be light for two reasons:

  • Most browsers come with a default light theme, so it's a bit jarring to have an extension not follow the standard.
  • v2 used to have a light theme, so sticking to a light theme would make the upgrade easier from a muscle memory perspective.

I'm not sure it's entirely true, probably depends on the OS - my Firefox is dark and I don't remember changing any of its options (I only use it to test Browserpass, he-he), and my Chromium is also dark because it respects GTK theme. Plus many geeky people like dark themes, so among our users it's totally possible that the majority prefers dark. Finally, I don't think colors can influence the ease of upgrade in any way 😉

I think we'll stick to a default dark theme, as long as we have an option to switch to a light one, we are good 🙂

@maximbaz
Copy link
Member

maximbaz commented Apr 17, 2019

Getting much better!

  1. I couldn't leave without trying to highlight with text color alone (#00bcff), IMHO looks quite alright, is it worse in your opinion than the highlight with background color?

    image

  2. If you still think the background highlight is much better, could it be made so that the blue background doesn't "touch" the store badge? In the picture below, ideally the blue background would stop maybe just a bit above the top of the "h" letter, but I feel there should be some space left between blue background and the store badge.

    image

  3. Would you agree that there's not enough contrast in this case, between blue background and the background of this entry? It doesn't look as bad on the enlarged screenshot, better try this in your browser:

    image

  4. When an entry is hovered, it feels the store badge also has small contrast (again doesn't look that bad on the enlarged screenshot, but try in your browser):

    image

  5. I'd recommend invert(85%) instead of 100%, makes the icons look not as bold:

    image

  6. The contrast between a focused search box and a pre-selected first line might also need additional improvement:

    image

  7. Is the "search icon" on purpose left without the "invert"? On the one hand it's not a button, on the other hand in the dark theme it has the same color as the buttons, and some might say it's almost invisible due to the low contrast with the background of the focused search input box:

    image

@adtac
Copy link
Contributor Author

adtac commented May 2, 2019

No problem. Just ping me here when that is merged and you're good to go.

@adtac
Copy link
Contributor Author

adtac commented Jun 12, 2019

Hey @maximbaz, I haven't been following the project's development much. Any updates on the password generation feature that you wanted merged before this? I'd really like to merge this; looking at the issue page, I imagine a few others would like this too.

@maximbaz
Copy link
Member

Hey, I apologize for the delay and the blocked state, I'll try to prioritize that work in the following days, I would also really like to get back to zero pending PRs in this project 🙂

@adtac
Copy link
Contributor Author

adtac commented Aug 12, 2019

@maximbaz ping :)

P.S. If you think the password generation feature will take more time than originally planned, I propose merging this patch first; just a suggestion :)

@erayd erayd added the blocked Cannot progress without first resolving something else this depends on label Aug 31, 2019
@erayd erayd added this to the 3.2 milestone Aug 31, 2019
@maximbaz
Copy link
Member

Apologies again. I agree, at this point let's just get this merged, #61 is taking way too much time than I planned. @erayd could you try again if you like the current colors, as well as do the code review? I'll do the same now.

@maximbaz maximbaz removed the blocked Cannot progress without first resolving something else this depends on label Aug 31, 2019
@maximbaz
Copy link
Member

For the background of the first entry highlighted by default I propose #d8dee3, a bit darker than the current #dee2e6, to add a bit of contrast to the blue highlight. Other than that, I'm ok with how it looks. @erayd?

@erayd erayd self-assigned this Aug 31, 2019
@erayd
Copy link
Collaborator

erayd commented Aug 31, 2019

@maximbaz I will go over this PR tomorrow.

@maximbaz maximbaz modified the milestones: 3.2, 3.3 Sep 25, 2019
@DamienCassou
Copy link

Hi guys. What is the status of this PR?

@erayd
Copy link
Collaborator

erayd commented Sep 26, 2019

@DamienCassou I'm midway through reviewing it.

@DamienCassou
Copy link

DamienCassou commented Sep 26, 2019 via email

Copy link
Member

@maximbaz maximbaz left a comment

Choose a reason for hiding this comment

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

Let's get this finally merged! 🥇

@maximbaz maximbaz changed the title Add themes support, add light theme Add light theme Oct 19, 2019
@maximbaz maximbaz merged commit 592f123 into browserpass:master Oct 19, 2019
@maximbaz
Copy link
Member

Thanks @adtac for your work!

@erayd
Copy link
Collaborator

erayd commented Oct 19, 2019

Yes, thank you @adtac, and sorry we took so long!

@adtac
Copy link
Contributor Author

adtac commented Oct 20, 2019

thank you, looks lovely!

fkneist pushed a commit to fkneist/browserpass-extension that referenced this pull request Feb 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add light theme
6 participants