-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add theme setting #243
Add theme setting #243
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This is amazing! Can't wait for a merging! There is a suggest that import "github-markdown-css/github-markdown-light.css"; But there is also a Moreover, the following information may be helpful to you. I imported Thank you very much again! |
Refactor code
Thanks for the info. I have successfully loaded However, I am facing a roadblock when trying to dynamically load I attempted to delete the existing CSS before reloading, but I encountered a "module not found" error, and I'm not sure why. const themeModule = require.resolve('../node_modules/highlight.js/styles/github-dark.css');
delete require.cache[themeModule];
const newModule = require.resolve('../node_modules/highlight.js/styles/github.css');
import(newModule); I also tried doing this in the main process, but it didn't work, no style show up in the document. cssId = mainWindow.webContents.insertCSS(`@import url('${cssPath}');
window.webContents.removeInsertedCSS(cssId); Then I tried looping through the Feel free to give suggestions, or do you think this issue is acceptable since we don't change the theme very frequently? |
I think I will spend 1 more day on the issue, see if I can find any solution for that. |
I think your work is good enough to present to users. Some little pities can be resolved as things going. What do you think? |
Code refactoring
Okay, I got it. A good night's sleep helps. Kindly review and let me know if there is anything I can do. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe what you did is really great! Thank you very much!
But the markdown style is not effect. Could you fix it? Then we can merge & publish it to the users ASAP.
Done @sunner. |
Thank you very much! The PR will be included in next release! |
Add theme setting to setting page.
Allow user to choose between System, Light, and Dark mode.
No impact for Light theme as using current color scheme.
By default, use system theme when user first time launches the app.
If System mode, update theme when system theme changed.
Fix white screen on startup by delaying showing window only after URL is loaded.