mirror of
https://github.com/mjl-/mox.git
synced 2024-12-26 16:33:47 +03:00
a16c08681b
this started with looking into the dark mode of PR #163 by mattfbacon. it's a very good solution, especially for the amount of code. while looking into dark mode, some common problems with inverting colors are: - box-shadow start "glowing" which isn't great. likewise, semitransparent layers would become brighter, not darker. - while popups/overlays in light mode just stay the same white, in dark mode they should become lighter than the regular content because box shadows don't give enough contrast in dark mode. while looking at adding explicit styles for dark mode, it turns out that's easier when we work more with css rules/classes instead of inline styles (so we can use the @media rule). so we now also create css rules instead of working with inline styles a lot. benefits: - creating css rules is useful for items that repeat. they'll have a single css class. changing a style on a css class is now reflected in all elements of that kind (with that class) - css class names are helpful when inspecting the DOM while developing: they typically describe the function of the element. most css classes are defined near where they are used, often while making the element using the class (the css rule is created on first use). this changes moves colors used for styling to a single place in webmail/lib.ts. each property can get two values: one for regular/light mode, one for dark mode. that should prevent forgetting one of them and makes it easy to configure both. this change sets colors for the dark mode. i think the popups look better than in PR #163, but in other ways it may be worse. this is a start, we can tweak the styling. if we can reduce the number of needed colors some more, we could make them configurable in the webmail settings in the future. so this is also a step towards making the ui looks configurable as discussed in issue #107. |
||
---|---|---|
.. | ||
api.go | ||
api.json | ||
api.ts | ||
api_test.go | ||
eventwriter.go | ||
lib.ts | ||
message.go | ||
message_test.go | ||
msg.html | ||
msg.js | ||
msg.ts | ||
text.html | ||
text.js | ||
text.ts | ||
view.go | ||
view_test.go | ||
webmail.go | ||
webmail.html | ||
webmail.js | ||
webmail.ts | ||
webmail_test.go |