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

[Feature] Add dark mode 🌙 #178

Closed
wants to merge 10 commits into from
Closed

Conversation

Teraskull
Copy link
Contributor

@Teraskull Teraskull commented Jan 20, 2022

This PR contains the following changes:

  • Add dark mode using the new dark: class in Tailwind 3.
  • Add theme switch button.
  • Replace all dark red colors with pastel alternatives in dark mode.
  • Fix static HTML elements flashing when reloading page.
  • Fix mobile layout and overflowing elements.
  • Update tailwind.min.css to only include used classes, which reduces the size from 2859KB to just 20KB.

Future changes to the style will require to use a CDN for development and tree shaking the file again.

This PR also changes a few things in light mode:

  • The toggles are now green (Red is not a good option for On state).
  • Removed the double border from the Clients header.
  • Removed the bottom border/divider from the last table child.

Screenshots:

wireguard_dashboard
wireguard_login
wireguard_modal

Before vs After (light/dark):

image

All elements should be properly styled in dark mode, including the Update banner. If I missed anything, let me know. (Closes #163)

[WIP] Tailwind CDN is used here for development.
Replaced all dark red colors with pastel alternatives.

This commit also changes a few things in light mode:
* The toggles are now green (Red is not a good option for `On` state).
* Removed the double border from the `Clients` header.
* Removed the bottom border/divider from the last table child.
* Tree shake `tailwind.min.css` to remove unused classes.
* Minify the CSS to reduce size.
This prevents flashing static HTML elements (icons, modals) on reload.
This allows to:
* Still default to `prefers-color-scheme`.
* Set theme with a button when implemented.
Script is inside `head` to avoid FOUC.
* Modals are properly centered.
* Add padding on container sides.
* Break info/name/buttons into blocks.
* Manipulate `<html>` directly because Vue does not bind it.
@taimadoCE
Copy link

Love it! Very good job!!!

* Change `Created/Last seen at` to `Created/Last seen on`.
@benisai
Copy link

benisai commented Jan 30, 2022

Love it. God bless you. The dev wouldn't do it. But man bless your heart @Teraskull

@WeeJeWel
Copy link
Collaborator

Looks nice, but I’d prefer it if you keep the WireGuard color scheme instead of this neutral style.

@Teraskull
Copy link
Contributor Author

@WeeJeWel I know, but sorry, the wireguard scheme just couldn't play right with dark colors and contrast.

@benisai
Copy link

benisai commented Jan 30, 2022

I'm excited for this PR :) 🙏✌️

@wjbridge
Copy link

Any estimate on when this can be merged into the project for a release? I love it!

@benisai
Copy link

benisai commented Apr 6, 2022

Has this been pulled/merged yet?

@WeeJeWel
Copy link
Collaborator

WeeJeWel commented Apr 6, 2022

No, I think the color scheme looks very boring and misses all WireGuard branding :/

@benisai
Copy link

benisai commented Apr 6, 2022

No, I think the color scheme looks very boring and misses all WireGuard branding :/

Can The branding be added? I think the color looks amazing, in my opinion. :) Would it be possible to have a switch in the web browser from original light to dark mode? :) 👍👍👍👍

@callumgare
Copy link

@WeeJeWel I definitely understand the desire to the WireGuard branding, I think having personality in design is really valuable. Although I'm sure you'd agree accessibility and comfort are also really valuable and there's no reason you can't have both. What would it take for you to feel like the UI keeps the brand while also ensuring there's a high enough colour contrast in dark mode? For example say the dark red of the wireguard brand was used in the border of the central panel instead and a more neutral color was used for the switch "on"/"off" text inside the switch to indicate state.

@ad84
Copy link

ad84 commented May 14, 2022

The wiregaurd android client gui seems to be made for accessibility and readability in dark mode. There's no branding colours, just the wiregaurd logo.

@archef2000
Copy link

When will it be merged ?

@JapCLoN
Copy link

JapCLoN commented Jun 15, 2022

I've added your dark mode pr to my non docker repo, added you to the credits for dark mode

@benisai
Copy link

benisai commented Jun 15, 2022

@WeeJeWel -- has this been merged yet? Looking forward to it

@WeeJeWel
Copy link
Collaborator

No. I'm only going to reconsider when the color scheme is black-ish (not blue-ish) and WireGuard-red-ish.

@rcdailey
Copy link

@WeeJeWel With respect, why not accept what many users are waiting for here? The point is that this theme does not blind me when I open the website. Seems like you are holding off a good thing for perfection. It's been half a year; I think it's time to stop nitpicking and merge.

@benisai
Copy link

benisai commented Jul 13, 2022

I would agree with @rcdailey

@benisai
Copy link

benisai commented Jul 13, 2022

No. I'm only going to reconsider when the color scheme is black-ish (not blue-ish) and WireGuard-red-ish.

Why? All Black and red is a eye sore. Terrible color choice.

@WeeJeWel
Copy link
Collaborator

Because it's my project. If you want changes, fork it. It's as simple as that guys, this is how open source works.

@benisai
Copy link

benisai commented Jul 14, 2022

You might as well just close the PR if it's never going to happen.

@benisai
Copy link

benisai commented Jul 14, 2022

And to be honest, the reason we don't want to fork is because we really like the work YOU did. 👍

@WeeJeWel
Copy link
Collaborator

And to be honest, the reason we don't want to fork is because we really like the work YOU did. 👍

You might mean: you want me to maintain this change ;-)

Any fork already contains the work I did :)

@benisai
Copy link

benisai commented Jul 31, 2022

@WeeJeWel - yes ;)

Can you merge it and make it an option at least? With a switch or something in the config?

@WeeJeWel
Copy link
Collaborator

WeeJeWel commented Aug 1, 2022

Not until the design looks better by keeping the WireGuard branding in place.

@JoryHogeveen
Copy link

No. I'm only going to reconsider when the color scheme is black-ish (not blue-ish) and WireGuard-red-ish.

I've got to agree with @WeeJeWel on this one. Besides, not much effort to change the colors for the PR author I imagine, most of the work is already done here.
I prefer dark mode as well but really do not like the blue/green color scheme proposed here.

@divadsn
Copy link

divadsn commented Sep 25, 2022

I'd agree as well, a dark-gray and WireGuard red style would fit much better

@benisai
Copy link

benisai commented Nov 4, 2022

At this point, I'll take anything. I can't stand the white page anymore.

@Butterkeks1000
Copy link

Any news to this pr?

@benisai
Copy link

benisai commented Nov 24, 2022

I was just wondering the same thing

@JoryHogeveen
Copy link

The plugin author already mentioned his requirements.
I guess that so long as this PR isn't updated accordingly nothing will happen.

@Teraskull
Copy link
Contributor Author

Ok, I guess it's time for me to reply too.

Sorry everyone, but I will not change the color scheme.

I respect Emile's design view, and his choice to not merge this PR, but I also expect my views to be respected, and him saying some color scheme is "better" because it has Wireguard colors, is very subjective.

Anyways, I am not going to change the colors since that is my design view, which I, and many others that upvoted this PR, like.

It is absolutely okay to not come to a design agreement. It is also okay to not accept changes if you don't like them. But remember that it goes both ways. I do not like the Wireguard colors contrasting with the dark theme.

I understand Emile not wanting to maintain the changes. Unfortunately, I also don't have time or motivation to maintain a fork. So if anyone wants to make a fork with my changes, they're welcome.

I hope you understand, and thank you for the support.

@benisai
Copy link

benisai commented Nov 25, 2022

I wish @WeeJeWel would accept this, it's super nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dark Theme possible?