Skip to content
This repository was archived by the owner on Sep 25, 2022. It is now read-only.

Add dark mode#14

Open
imax9000 wants to merge 9 commits into
andyschott:masterfrom
imax9000:dark-mode
Open

Add dark mode#14
imax9000 wants to merge 9 commits into
andyschott:masterfrom
imax9000:dark-mode

Conversation

@imax9000

@imax9000 imax9000 commented Feb 13, 2021

Copy link
Copy Markdown

Adds dark mode support, with:

  • Auto-detection via @media (prefer-color-scheme)
  • Toggle button at the top
  • Choice persisted in a cookie

My initial attempt was to utilise CSS variables. But for that to work I'd have to rip bulma apart and replace every color value with a variable reference. So the next best thing is to compile two different versions of bulma and switch between them.

Sorry for the mess in MaxPowerLevel.csproj, surprisingly, that was the path of least resistance to get .scss files compiled on Mac. Couldn't use WebCompiler because MSVS2019 doesn't support extensions, and every NuGet package I tried either didn't work or was too eager to compile every partial .sass in submodules.

Almost forgot to mention: this change breaks dotnet run, because for whatever stupid reason dotnet run doesn't pull in files from build output dir 🤦

@andyschott andyschott left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks for the contribution! I pulled down your code, but when I try to fetch the submodules I get permission denied errors from GitHub. What do I have to do in order to pull down the submodules you added to the project?

@imax9000

Copy link
Copy Markdown
Author

I think that's what happens when trying to clone over ssh without registering ssh public key with github. I've updated the URL to https, which should avoid this problem.

@imax9000

Copy link
Copy Markdown
Author

Hey, did you manage to get a closer look at this?

@andyschott

Copy link
Copy Markdown
Owner

Sorry, I haven't had a chance to look at it yet (been a busy few weeks). Planning on looking at it this weekend.

@andyschott

Copy link
Copy Markdown
Owner

It looks like the submodule for bulma is still using SSH to clone - can you update that to use https as well?

@imax9000

Copy link
Copy Markdown
Author

I did that in f767d2e above, both submodules now using https. You might need to do git submodule sync after pulling f767d2e in, to propagate URL change to submodule repo in .git. (https://stackoverflow.com/q/60003502)

@andyschott

Copy link
Copy Markdown
Owner

I'm able to get the submodules now (I haven't done much with submodules before - sorry for the confusion).

I see you said that dotnet run is broken, which might be fine. However I typically use VS Code on a Mac to develop this, and that uses dotnet run I believe, so now I can't run the code from VS Code. How do you run this?

Also, I see a lot of unstaged changes in MaxPowerLevel/Views/bulmawatch - do I have to do something with submodules to get rid of that?

@imax9000

Copy link
Copy Markdown
Author

now I can't run the code from VS Code. How do you run this?

Yeah, that's probably the case :( I seems that dotnet run does very little in terms of setting up application environment, and it's up to the application itself to support different configurations.

I was building the docker image and running that.

Also, I see a lot of unstaged changes in MaxPowerLevel/Views/bulmawatch - do I have to do something with submodules to get rid of that?

That's unexpected, I don't think git even supports committing local modifications of submodules. I just did a fresh clone of my branch and I don't see any unstaged changes. Maybe you already had bulmaswatch directory there? Or it's line ending handling going haywire?

@andyschott

Copy link
Copy Markdown
Owner

I've been thinking about your change, and I love the idea of supporting dark mode, but I don't like the restrictions it places on development. Did you look for other options and couldn't find anything? Would it be worth me doing some research for other options to make the development process smoother?

@imax9000

imax9000 commented Mar 7, 2021

Copy link
Copy Markdown
Author

By restrictions you mean inability to use dotnet run or something else?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants