mox/webmail
Mechiel Lukkien a16c08681b
webmail: change many inline styles to using css classes, and add dark mode
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.
2024-05-06 09:13:50 +02:00
..
api.go add aliases/lists: when sending to an alias, the message gets delivered to all members 2024-04-24 19:15:30 +02:00
api.json webmail: when moving a single message out of/to the inbox, ask if user wants to create a rule to automatically do that server-side for future deliveries 2024-04-21 17:14:08 +02:00
api.ts webmail: when moving a single message out of/to the inbox, ask if user wants to create a rule to automatically do that server-side for future deliveries 2024-04-21 17:14:08 +02:00
api_test.go webmail: less boilerplate code for api functions 2024-04-21 21:32:24 +02:00
eventwriter.go replace packages slog and slices from golang.org/x/exp with stdlib 2024-02-08 14:49:01 +01:00
lib.ts webmail: change many inline styles to using css classes, and add dark mode 2024-05-06 09:13:50 +02:00
message.go webmail: remember per from-address whether we should show the text/html/html-with-external-resources version of a message 2024-04-20 21:25:52 +02:00
message_test.go webmail: recognize multiple urls in List-Post addresses 2024-04-16 20:26:37 +02:00
msg.html webmail: change many inline styles to using css classes, and add dark mode 2024-05-06 09:13:50 +02:00
msg.js webmail: change many inline styles to using css classes, and add dark mode 2024-05-06 09:13:50 +02:00
msg.ts webmail: change many inline styles to using css classes, and add dark mode 2024-05-06 09:13:50 +02:00
text.html webmail: change many inline styles to using css classes, and add dark mode 2024-05-06 09:13:50 +02:00
text.js webmail: change many inline styles to using css classes, and add dark mode 2024-05-06 09:13:50 +02:00
text.ts webmail: change many inline styles to using css classes, and add dark mode 2024-05-06 09:13:50 +02:00
view.go add aliases/lists: when sending to an alias, the message gets delivered to all members 2024-04-24 19:15:30 +02:00
view_test.go webmail: less boilerplate code for api functions 2024-04-21 21:32:24 +02:00
webmail.go webmail: add export functionality 2024-04-22 13:41:40 +02:00
webmail.html webmail: change many inline styles to using css classes, and add dark mode 2024-05-06 09:13:50 +02:00
webmail.js webmail: change many inline styles to using css classes, and add dark mode 2024-05-06 09:13:50 +02:00
webmail.ts webmail: change many inline styles to using css classes, and add dark mode 2024-05-06 09:13:50 +02:00
webmail_test.go webmail: add export functionality 2024-04-22 13:41:40 +02:00