p4535992 / foundryvtt-chat-portrait

Other
2 stars 6 forks source link

[BUG] Generic CSS restricts <div> elements to half width. #36

Closed mrkwnzl closed 1 year ago

mrkwnzl commented 1 year ago

Module Version: v0.9.1

Describe the bug .chat-portrait-text-size-name-generic includes display: flex; and defaults to flex-direction: row; (or is otherwise unset), I believe. This results in the behavior that <div> tags are only half the width of the chat card. Using flex-direction: column; will result in full width <div>, which would be default <div> behavior without Chat Portrait.

Since .chat-portrait-text-size-name-generic is added to <span class="flavor-text">, it’s putting the above rules for the container of the flavor text I have control over and it’s not as easy to for me to actually use the full width, since I can only put stuff in that container (or would otherwise need to add my own class to <span class="flavor-text">). On the other hand, if I really want some <div> elements with flex-direction: row, I can set that in my own container within <span class="flavor-text"> pretty easily (which I’d probably already have, since default Foundry has full-width for <div>).

To Reproduce Steps to reproduce the behavior:

  1. Install the Cypher System.
  2. Create a new World.
  3. Open the newly created World.
  4. Create a PC actor.
  5. Open the PC actor sheet.
  6. Click on one of the roll buttons.
  7. The chat card is only half width for flavor text.

Expected behavior I expect <div> elements to occupy the full width of the chat card by default.

Screenshots This is how it looks now:

Screenshot 2023-10-02 at 13 50 16

This is how it’s supposed to look. This has flex-direction: column; added to .chat-portrait-text-size-name-generic:

Screenshot 2023-10-02 at 13 51 04

For some extra context: There’s a way in the Cypher System to have the exact same output, but not as the flavor of a roll, which looks like this with Chat Portrait enabled (and no changes made):

Screenshot 2023-10-02 at 13 53 14

Browser:

Foundry Version:

Game System:

Additional context I don’t think that a full Cypher System style is needed or worth it for this one change.

Thanks!

mrkwnzl commented 1 year ago

🤦‍♂️ Nevermind!

A simple width: 100% on my end works just as well. I tried that before, but it didn’t work. Probably a silly typo or something. Sorry about that.

p4535992 commented 1 year ago

i can prepare a specific Cypher css if you pass to me the css style to add/replace to the generic

mrkwnzl commented 1 year ago

I think the generic one is working well, actually. There's nothing too fancy in the Cypher System that would warrant that, now that I found that a simple width: 100% at the right place does the job.

But thanks for the offer. If that changes, I'll let you know.

p4535992 commented 1 year ago

kk