diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2025-05-07 23:37:41 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2025-05-08 20:09:17 -0400 |
| commit | 02c8c1e91026a58e7999356bf3348aca15f627e2 (patch) | |
| tree | 2f04823794c5e03859a8bcc4ab521bf35aec0c8a /ui/styles/variables.css | |
| parent | 1932ef679bcfde08cb1348500a1f0f454e8ecf3f (diff) | |
Provide conventional text styling for message bodies.
Our reset strips out a ton of default browser styles, which is good, but we haven't yet gotten around to adding styles we're using. This left formatted messages
feeling a
lot like
this
regardless of the intended formatting. (Is the above an example of a paragraph? A list? A single line that has gotten wrapped? The answer was "yes.")
To make the margins and padding work out nicely, I've rearranged the positioning containers used for message runs and messages. We also no longer `float` the message handles, since we no longer need to: they can be positioned relative to the message they're part of.
Styling on long bodies of inline code (`like this`) is a bit shaky. The outline overlaps with the following line. I think having a visual cue for where the code block begins and ends is _good_, but I'd like to pick apart some of the other examples on the internet because I think this needs more work.
This change also makes code blocks wrap lines at the page edge where possible (it'll still scroll if wrapping isn't possible). This won't affect _most_ code blocks much - code tends to not be that wide - and it means that using a code block for effect doesn't require people to manually wrap strings. Having tried it both ways, this feels more human.
Dumbnailing is not a _great_ solution to dealing with huge images, but it's the best we can do at rendering time. A more complete solution would require generating images at multiple sizes.
Diffstat (limited to 'ui/styles/variables.css')
| -rw-r--r-- | ui/styles/variables.css | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ui/styles/variables.css b/ui/styles/variables.css index ea0e9f5..2758aa1 100644 --- a/ui/styles/variables.css +++ b/ui/styles/variables.css @@ -18,6 +18,7 @@ /* Light text is a bit hard to read; I may need to adjust it. */ --light-text: color-mix(in srgb, var(--colour-base) 40%, white); --dark-text: color-mix(in srgb, var(--colour-base) 40%, black); + --mid-text: color-mix(in srgb, var(--dark-text) 75%, var(--light-text)); --link-text: color-mix(in srgb, var(--colour-base) 40%, blue); /* Header */ @@ -59,6 +60,8 @@ --colour-message-run-other-text: var(--dark-text); --colour-message-run-link-text: var(--link-text); --colour-message-run-unsent-text: var(--light-text); + --colour-message-run-blockquote-text: var(--mid-text); + --colour-message-run-code-bg: color-mix(in srgb, var(--colour-base) 40%, white); --colour-message-run-username-bg: color-mix(in srgb, var(--colour-base) 70%, white); --colour-message-run-username-border: color-mix(in srgb, var(--colour-base) 50%, black); |
