A lot of improvements made by @goncalossilva:
Fix#112
Improve the themes support:
Clean all the CSS involved
Encapsulate theme handling
Reload preview when theme changes
Fix fonts on the preview mode
Add support for high contrast themes
Add Hemingway mode
Theme colors are originally based on GitHub's theme.
This script (slightly) offsets them to match the color pallete of the
specified theme automatically, and prints them out.
While the adjustments are meant to be minor, color contrast should still
be verified.
Finally, a few themes should not be automated in this way. For example,
the high contrast themes are meant to be purely black & white.
The Theme class encapsulates theme handling, by listing default themes
and providing means to access their gtk/web css.
Besides cleaning things up, it makes it easy to support custom themes
in the future. The user just needs to provide two CSS files, and we'll
be able to instantiate and use a Theme from that.
Fixes#121. Additional, fixes include:
* Light tables, title/hr underlines, code and quote blocks on the
dark theme
* Scrollbar not rendering on top of content
Cleanup includes:
* Removal of css rules that are internal to github (eg. octicon)
* Merging of duplicate or overridden declarations
* De-duplicating light and dark theme using import + custom properties
Improvements include:
* Using Fira / Fira Mono for rendering (as is done in the text editor)
* Using relative units as much as possible, making it much easier to
use a responsive design in the future
* Using the same background color for a more seamless experience
* Adjusting color contrast for the background changes, ensuring proper
accessibility while still using GitHub's style
While WebKit2 is loading, it renders a blank (white) page.
This causes it to flash briefly, while the content is not yet loaded.
Waiting for it to finish using the load-change event fixes the issue.
Fixes#112