[GH-ISSUE #8712] [Issue]: Expose per-character avatar metadata for CSS themes #8467

Closed
opened 2026-11-07 16:43:09 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @SpicyMarinara on GitHub (Nov 3, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8712

Originally assigned to: @SpicyMarinara on GitHub.

Summary

Merged Roleplay portraits do not expose character names, IDs, or name colors to CSS themes. Theme authors need stable per-portrait hooks to add optional character labels, colored borders, and custom layouts while preserving the default appearance.

Expected behavior

Each merged Roleplay portrait should provide a stable wrapper and character metadata usable by CSS, such as a character ID, character name, and name-color value or CSS variable. Existing avatar sizing, positioning, cycling behavior, and default appearance should remain unchanged unless a custom theme uses these hooks.

Actual behavior

Individual portraits do not expose the character name or color to CSS, preventing themes from targeting characters or rendering character-specific labels and borders. The maintainer indicated that exposing CSS data may create security vulnerabilities and suggested that character-colored borders could instead be implemented internally.

Steps to reproduce

  1. Use merged Roleplay and assign characters distinct names and dialogue colors.
  2. Open the Glued Side Panel with multiple character portraits.
  3. Apply a CSS theme that attempts to identify each portrait or display its character name and color.
  4. Observe that the portraits do not expose character metadata or stable per-character CSS hooks.

Environment

  • Marinara Engine version: Not provided
  • Install type: Not provided
  • OS + version: Not provided
  • Browser or app shell: Not provided

Logs, screenshots, or video

No logs or video provided. Attached screenshots: https://cdn.discordapp.com/attachments/1567101797070544986/1567101797288386623/image.png?ex=6aeaf4c7&is=6ae9a347&hm=9f9290fe3d66e7967ed5b1100fa21be549eea70f1d4babae38b1ccb8e35ba57b and https://cdn.discordapp.com/attachments/1567101797070544986/1567101797737431141/image.png?ex=6aeaf4c7&is=6ae9a347&hm=ca0100972edbcc838110c756a22a24d4aadbad027e6ccda3e119f2c65a603d1f&.

Additional context

The requester reports that the behavior already works in a privately patched build and that the native change is limited to one React file, with labels and borders handled by CSS. The proposed approach was a stable portrait wrapper with data-character-id, data-character-name, data-character-name-color, and a CSS variable for the name color; exposing the original gradient alongside a solid fallback was also suggested. No Support Diagnostics were provided.

Discord thread: Expose per-character avatar metadata for CSS themes in merged Roleplay
Discord thread link: https://discord.com/channels/1417099416812392641/1567101797070544986
Requested by: Marinara (marinara_spaghetti, Discord ID 169561011928432653)

Discord thread transcript (8 messages)
[2026-11-03T09:03:03.765Z] kociol21: I mainly use merged Roleplay and assign each character their own name and dialogue colors.

I’d like to use CSS to give each avatar a subtle border in that character’s color, plus a small name label in the upper-left corner. This would make characters easier to identify, especially with several portraits in the Glued Side Panel.

Currently, the individual portraits don’t expose the character name or color to CSS.
Proposed solution
Wrap each portrait in a separate element with a stable class and expose its character metadata. For example:

` ` `<span
  class="mari-roleplay-portrait"
  data-character-id="character-id"
  data-character-name="Mei"
  data-character-name-color="#64b544"
  style="--mari-portrait-name-color: #64b544"
>
  <img src="avatar.png" alt="Mei">
</span>` ` `

The wrapper would allow themes to:
- Display the name using ::after and content: attr(data-character-name).
- Apply character-colored borders or other styling using the CSS variable.
- Target individual characters through their IDs.
For gradient name colors, exposing the original value alongside a solid-color fallback would be useful.

The default appearance could stay unchanged. Labels, borders and custom layouts would remain optional CSS.

This is already working in a privately patched build. The native change is limited to one React file; the labels and borders are handled separately by CSS.

The main request is simply to expose the metadata and a suitable wrapper for theme authors. 

Important thing is that default appearance and behavior should remain unchanged unless a custom theme explicitly uses these hooks, so there would be no real downside of doing this. The wrapper should preserve existing avatar sizing, positioning, and cycling behavior. This already works with my custom theming. I attach picture of how it looks on mine end.

[attached image 1: https://cdn.discordapp.com/attachments/1567101797070544986/1567101797288386623/image.png?ex=6aeaf4c7&is=6ae9a347&hm=9f9290fe3d66e7967ed5b1100fa21be549eea70f1d4babae38b1ccb8e35ba57b&]
[attached image 2: https://cdn.discordapp.com/attachments/1567101797070544986/1567101797737431141/image.png?ex=6aeaf4c7&is=6ae9a347&hm=ca0100972edbcc838110c756a22a24d4aadbad027e6ccda3e119f2c65a603d1f&]
[Discord message: https://discord.com/channels/1417099416812392641/1567101797070544986/1567101797070544986]

[2026-11-03T09:03:05.300Z] Professor Mari [bot]: Howdy!

Thank you for submitting a new bug report/feature request, your support means a lot. A member of the team will look into it as soon as possible, and if they find it valid, they will open a GitHub Issue out of it. You can check whether it was addressed on the staging build of Marinara Engine. **Do not ping any of the developers, this will not speed up the process.**

**Please include a Support Diagnostic in the post if you haven't done it yet.** Otherwise, ignore this step. To grab it, go to the Marinara Engine tab:

`Settings -> Advanced -> Support Diagnostics -> Copy Support Diagnostics.`

If your report is about any of the **Agents**, please provide **the Agent's version** which you can grab from here:

`Agents -> Download Agents -> Installed Agents -> Selected Agent -> Installed Version`

Thank you, this will help tremendously.

This is an automated message, but if you reply to it, I will do my best to assist you using my LLM-powered brain. That said, it's best for a human to handle this case.

Cheers!
[Discord message: https://discord.com/channels/1417099416812392641/1567101797070544986/1567101803508801617]

[2026-11-03T10:40:30.979Z] Marinara: Yeah, that's a no-go.
[Discord message: https://discord.com/channels/1417099416812392641/1567101797070544986/1567126322063343719]

[2026-11-03T10:40:59.976Z] Marinara: But I can add borders colored like the character's name.
[Discord message: https://discord.com/channels/1417099416812392641/1567101797070544986/1567126443685711883]

[2026-11-03T10:41:07.218Z] Marinara: Just on our end.
[Discord message: https://discord.com/channels/1417099416812392641/1567101797070544986/1567126474060988477]

[2026-11-03T10:41:29.744Z] kociol21: I thought it would be easy, because that would only require exposing 2-3 variables to CSS
[Discord message: https://discord.com/channels/1417099416812392641/1567101797070544986/1567126568541753426]

[2026-11-03T10:42:36.481Z] kociol21: But yeah, option for borders in character name color would be something. I just use CSS theming to make shared avatars vertical
[Discord message: https://discord.com/channels/1417099416812392641/1567101797070544986/1567126848457154572]

[2026-11-03T10:43:21.719Z] Marinara: Anything that exposes CSS can be a security vulnerability, so we avoid it.
[Discord message: https://discord.com/channels/1417099416812392641/1567101797070544986/1567127038198939731]

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @SpicyMarinara on GitHub (Nov 3, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8712 Originally assigned to: @SpicyMarinara on GitHub. ## Summary Merged Roleplay portraits do not expose character names, IDs, or name colors to CSS themes. Theme authors need stable per-portrait hooks to add optional character labels, colored borders, and custom layouts while preserving the default appearance. ## Expected behavior Each merged Roleplay portrait should provide a stable wrapper and character metadata usable by CSS, such as a character ID, character name, and name-color value or CSS variable. Existing avatar sizing, positioning, cycling behavior, and default appearance should remain unchanged unless a custom theme uses these hooks. ## Actual behavior Individual portraits do not expose the character name or color to CSS, preventing themes from targeting characters or rendering character-specific labels and borders. The maintainer indicated that exposing CSS data may create security vulnerabilities and suggested that character-colored borders could instead be implemented internally. ## Steps to reproduce 1. Use merged Roleplay and assign characters distinct names and dialogue colors. 2. Open the Glued Side Panel with multiple character portraits. 3. Apply a CSS theme that attempts to identify each portrait or display its character name and color. 4. Observe that the portraits do not expose character metadata or stable per-character CSS hooks. ## Environment - Marinara Engine version: Not provided - Install type: Not provided - OS + version: Not provided - Browser or app shell: Not provided ## Logs, screenshots, or video No logs or video provided. Attached screenshots: https://cdn.discordapp.com/attachments/1567101797070544986/1567101797288386623/image.png?ex=6aeaf4c7&is=6ae9a347&hm=9f9290fe3d66e7967ed5b1100fa21be549eea70f1d4babae38b1ccb8e35ba57b and https://cdn.discordapp.com/attachments/1567101797070544986/1567101797737431141/image.png?ex=6aeaf4c7&is=6ae9a347&hm=ca0100972edbcc838110c756a22a24d4aadbad027e6ccda3e119f2c65a603d1f&. ## Additional context The requester reports that the behavior already works in a privately patched build and that the native change is limited to one React file, with labels and borders handled by CSS. The proposed approach was a stable portrait wrapper with data-character-id, data-character-name, data-character-name-color, and a CSS variable for the name color; exposing the original gradient alongside a solid fallback was also suggested. No Support Diagnostics were provided. Discord thread: Expose per-character avatar metadata for CSS themes in merged Roleplay Discord thread link: https://discord.com/channels/1417099416812392641/1567101797070544986 Requested by: Marinara (marinara_spaghetti, Discord ID 169561011928432653) <details> <summary>Discord thread transcript (8 messages)</summary> ```text [2026-11-03T09:03:03.765Z] kociol21: I mainly use merged Roleplay and assign each character their own name and dialogue colors. I’d like to use CSS to give each avatar a subtle border in that character’s color, plus a small name label in the upper-left corner. This would make characters easier to identify, especially with several portraits in the Glued Side Panel. Currently, the individual portraits don’t expose the character name or color to CSS. Proposed solution Wrap each portrait in a separate element with a stable class and expose its character metadata. For example: ` ` `<span class="mari-roleplay-portrait" data-character-id="character-id" data-character-name="Mei" data-character-name-color="#64b544" style="--mari-portrait-name-color: #64b544" > <img src="avatar.png" alt="Mei"> </span>` ` ` The wrapper would allow themes to: - Display the name using ::after and content: attr(data-character-name). - Apply character-colored borders or other styling using the CSS variable. - Target individual characters through their IDs. For gradient name colors, exposing the original value alongside a solid-color fallback would be useful. The default appearance could stay unchanged. Labels, borders and custom layouts would remain optional CSS. This is already working in a privately patched build. The native change is limited to one React file; the labels and borders are handled separately by CSS. The main request is simply to expose the metadata and a suitable wrapper for theme authors. Important thing is that default appearance and behavior should remain unchanged unless a custom theme explicitly uses these hooks, so there would be no real downside of doing this. The wrapper should preserve existing avatar sizing, positioning, and cycling behavior. This already works with my custom theming. I attach picture of how it looks on mine end. [attached image 1: https://cdn.discordapp.com/attachments/1567101797070544986/1567101797288386623/image.png?ex=6aeaf4c7&is=6ae9a347&hm=9f9290fe3d66e7967ed5b1100fa21be549eea70f1d4babae38b1ccb8e35ba57b&] [attached image 2: https://cdn.discordapp.com/attachments/1567101797070544986/1567101797737431141/image.png?ex=6aeaf4c7&is=6ae9a347&hm=ca0100972edbcc838110c756a22a24d4aadbad027e6ccda3e119f2c65a603d1f&] [Discord message: https://discord.com/channels/1417099416812392641/1567101797070544986/1567101797070544986] [2026-11-03T09:03:05.300Z] Professor Mari [bot]: Howdy! Thank you for submitting a new bug report/feature request, your support means a lot. A member of the team will look into it as soon as possible, and if they find it valid, they will open a GitHub Issue out of it. You can check whether it was addressed on the staging build of Marinara Engine. **Do not ping any of the developers, this will not speed up the process.** **Please include a Support Diagnostic in the post if you haven't done it yet.** Otherwise, ignore this step. To grab it, go to the Marinara Engine tab: `Settings -> Advanced -> Support Diagnostics -> Copy Support Diagnostics.` If your report is about any of the **Agents**, please provide **the Agent's version** which you can grab from here: `Agents -> Download Agents -> Installed Agents -> Selected Agent -> Installed Version` Thank you, this will help tremendously. This is an automated message, but if you reply to it, I will do my best to assist you using my LLM-powered brain. That said, it's best for a human to handle this case. Cheers! [Discord message: https://discord.com/channels/1417099416812392641/1567101797070544986/1567101803508801617] [2026-11-03T10:40:30.979Z] Marinara: Yeah, that's a no-go. [Discord message: https://discord.com/channels/1417099416812392641/1567101797070544986/1567126322063343719] [2026-11-03T10:40:59.976Z] Marinara: But I can add borders colored like the character's name. [Discord message: https://discord.com/channels/1417099416812392641/1567101797070544986/1567126443685711883] [2026-11-03T10:41:07.218Z] Marinara: Just on our end. [Discord message: https://discord.com/channels/1417099416812392641/1567101797070544986/1567126474060988477] [2026-11-03T10:41:29.744Z] kociol21: I thought it would be easy, because that would only require exposing 2-3 variables to CSS [Discord message: https://discord.com/channels/1417099416812392641/1567101797070544986/1567126568541753426] [2026-11-03T10:42:36.481Z] kociol21: But yeah, option for borders in character name color would be something. I just use CSS theming to make shared avatars vertical [Discord message: https://discord.com/channels/1417099416812392641/1567101797070544986/1567126848457154572] [2026-11-03T10:43:21.719Z] Marinara: Anything that exposes CSS can be a security vulnerability, so we avoid it. [Discord message: https://discord.com/channels/1417099416812392641/1567101797070544986/1567127038198939731] ``` </details> ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-11-07 16:43:09 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#8467
No description provided.