c3er / mdview

Standalone Markdown viewer
MIT License
83 stars 7 forks source link

Added Dark Theme #12

Closed aurora-dot closed 3 years ago

aurora-dot commented 3 years ago

Overview

Hello, I added an option to switch between a light and dark theme, and saves preferences in a settings file. I had to copy dark theme for the css from https://github.com/mrdrivingduck/github-markdown-css and format it so it could work with the class names from the markdown html. I also improved readibility of main.js :)

(This is my first pull request to a repo I'm not directly involved with, so I'm sorry if this isn't good)

Dark theme:

image image

Light theme:

image image

aurora-dot commented 3 years ago

Once I have enough spare time, I'll look into having multiple themes, and having the current dark theme more consistant, as its using dracula colour scheme for highlighting but not for the markdown itself.

There are some limitations with what I have implimented, which is that there can only be one light theme and one dark theme, this is my first time working with electron so I'll have to research it more to find a better way of implimenting it.

I feel like the current state is still good, as at minimum there is a dark theme and light theme now but can still be improved.

I hope this helps in any way :)

aurora-dot commented 3 years ago

I fixed the inconsistancies within the dark theme now :)

c3er commented 3 years ago

The first pull request I got! I guess, it's time to add a CONTRIBUTING file.

I added an option to switch between a light and dark theme, and saves preferences in a settings file

Awesome! I was thinking about that feature but didn't have any pressure for it yet (I have my IDEs set to light theme).

I looked at the changes only superficially yet. I will look deeper at this at the weekend. But I added already some comments for you to work on. I don't think that the readability of the main.js is improved - see the respective review comment.

If your changes are okay at the weekend so far, I will publish a new release "1.5.0". Currently I have only at weekends time to occupy myself with this project.

(This is my first pull request to a repo I'm not directly involved with, so I'm sorry if this isn't good)

I see no reason to be sorry🙂 But I suggest the next time you want to add a feature to a project, you open a proposal as issue. For the case that the author just doesn't want that feature and you don't waste any time.

c3er commented 3 years ago

Once I have enough spare time, I'll look into having multiple themes, and having the current dark theme more consistant, as its using dracula colour scheme for highlighting but not for the markdown itself.

There are some limitations with what I have implimented, which is that there can only be one light theme and one dark theme, this is my first time working with electron so I'll have to research it more to find a better way of implimenting it.

I feel like the current state is still good, as at minimum there is a dark theme and light theme now but can still be improved.

I think, a dark theme is already a major improvement and would increase the user base dramatically.

If you want to add support for additional themes, you should clearly open another pull request. Maybe you should open a proposal-issue first where this feature and its user interface can be discussed.

aurora-dot commented 3 years ago

The first pull request I got! I guess, it's time to add a CONTRIBUTING file.

I added an option to switch between a light and dark theme, and saves preferences in a settings file

Awesome! I was thinking about that feature but didn't have any pressure for it yet (I have my IDEs set to light theme).

I looked at the changes only superficially yet. I will look deeper at this at the weekend. But I added already some comments for you to work on. I don't think that the readability of the main.js is improved - see the respective review comment.

If your changes are okay at the weekend so far, I will publish a new release "1.5.0". Currently I have only at weekends time to occupy myself with this project.

(This is my first pull request to a repo I'm not directly involved with, so I'm sorry if this isn't good)

I see no reason to be sorry🙂 But I suggest the next time you want to add a feature to a project, you open a proposal as issue. For the case that the author just doesn't want that feature and you don't waste any time.

Oh okay, I will do that next time, thank you! I have completed all but one request, as I'll have to look into this

Once I have enough spare time, I'll look into having multiple themes, and having the current dark theme more consistant, as its using dracula colour scheme for highlighting but not for the markdown itself. There are some limitations with what I have implimented, which is that there can only be one light theme and one dark theme, this is my first time working with electron so I'll have to research it more to find a better way of implimenting it. I feel like the current state is still good, as at minimum there is a dark theme and light theme now but can still be improved.

I think, a dark theme is already a major improvement and would increase the user base dramatically.

If you want to add support for additional themes, you should clearly open another pull request. Maybe you should open a proposal-issue first where this feature and its user interface can be discussed.

I possibly may create a proposal-issue, but most likely not (well for a few months at least) just because of the influx of work soon

c3er commented 3 years ago

Hi,

is there a chance that you solve the remaining problem in the next weeks or so? The highlighting of certain source code was not quite right yet. And as I just tried the tool with your changes I noticed that you put the "Switch Theme" item in the File menu. I think the View menu is a better fit.

If you say, you won't have time anytime soon, I'd finish this feature by myself in the next weeks (I got some time again). I would prioritize this feature over bug #11 and the architectural changes that I want to do.

BTW: you already did a great work and I'm looking forward to publish a new release with this feature!

c3er commented 3 years ago

Your commits are merged, the remaining problems are fixed and a new release 1.5.0 is published.

Thanks!

aurora-dot commented 3 years ago

Your commits are merged, the remaining problems are fixed and a new release 1.5.0 is published.

Thanks!

Oh nice!! Thank you! I thought I replied to your last comment but I didn't, sorry!