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

Make WebView stylesheets more maintainable and consistent #1290

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Fs00
Copy link
Contributor

@Fs00 Fs00 commented Apr 29, 2023

The primary goal of this PR is to leverage the @import feature in CSS (available from API 21 WebView) to greatly reduce duplication in stylesheets used in WebViews.
With these changes, the dark and print variants of the stylesheets will derive from the light variant using @import, and then override only the parts that differ. This will make maintainance a lot easier and helps keep the styles consistent: in fact, before this PR prettify (code preview) stylesheets had several differences between dark and light themes, but now no more:

Before After
Screenshot_20230429-114651_OctoDroid Screenshot_20230429-114434_OctoDroid_Debug

While I was at it, I've also taken the opportunity to fix #1274 (here's how repro looks like after the fix) and tweak code background colors in Markdown CSS to make it more similar to the one rendered in TextViews.

Last but not least, I've found a neat CSS trick to make Markdown tables horizontally scrollable and prevent them from overflowing.

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.

Hightlighted source code contrast is illegible in night mode
2 participants