summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKit La Touche <kit@transneptune.net>2024-11-11 22:20:35 -0500
committerKit La Touche <kit@transneptune.net>2024-11-11 22:20:35 -0500
commitf9e3b7211910338ec485170f4d18325398bc1d7a (patch)
tree4c140353d13aec4e2c1a534ca52503dfbc5eddb3
parent030fe796552ced317fbed30b86db3141279908d9 (diff)
Style own messages
-rw-r--r--ui/lib/components/MessageRun.svelte18
1 files changed, 16 insertions, 2 deletions
diff --git a/ui/lib/components/MessageRun.svelte b/ui/lib/components/MessageRun.svelte
index 2e8c613..2a88a82 100644
--- a/ui/lib/components/MessageRun.svelte
+++ b/ui/lib/components/MessageRun.svelte
@@ -16,7 +16,21 @@
<span class="chip variant-soft sticky top-o left-0">
@{name}:
</span>
- {#each messages as { at, body }}
- <Message {at} {body} />
+ {#each messages as message}
+ <Message {...message} />
{/each}
</div>
+
+<style>
+ .own-message {
+ background-color: rgb(32, 42, 74);
+ }
+ /* Honestly, I don't love scoping styles per component, and this is a great
+ * example of why. MessageRuns know if they're own-message, but Messages in
+ * them need to get a style based on that fact. I don't wanna bucket-brigade
+ * that fact into the Message, when it's a pure CSS concern.
+ */
+ .own-message :global(*) {
+ color: rgb(198, 198, 198);
+ }
+</style>