Nekochu commited on
Commit
f746311
·
verified ·
1 Parent(s): 9af691a

fix double-box user bubble: Gradio nests .message.user > [data-testid=user]; my selector styled BOTH -> two stacked boxes. Now the OUTER is the single bubble, the INNER is flattened (transparent/no box). Verified via live CSS injection.

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -779,15 +779,21 @@ footer { display: none !important; } /* drop the defaul
779
  border: none !important; line-height: 1.6 !important; padding: 11px 15px !important;
780
  animation: fadeRise 0.16s ease-out both; /* every bubble "arrives" */
781
  }
782
- /* USER turn: right-aligned, raised taupe surface with a faint amber top-edge highlight. Identical every time.
783
- width:fit-content so the bubble HUGS its text (was stretching to the full 86% with big empty space). */
784
- #chat .message.user, #chat [data-testid="user"] {
 
 
785
  margin-left: auto !important; width: fit-content !important; max-width: 86% !important;
786
  background: #3A2F27 !important; color: #E8DDD0 !important;
787
  padding: 9px 14px !important;
788
  border-radius: 11px !important; border-top: 1px solid rgba(232,147,43,0.40) !important;
789
  box-shadow: 0 1px 2px rgba(0,0,0,0.30) !important;
790
  }
 
 
 
 
791
  /* tighten the markdown <p> inside the user bubble so a short message isn't a tall box */
792
  #chat .message.user p, #chat [data-testid="user"] p { margin: 0 !important; }
793
  #chat .message.user *, #chat [data-testid="user"] * { color: #E8DDD0 !important; }
 
779
  border: none !important; line-height: 1.6 !important; padding: 11px 15px !important;
780
  animation: fadeRise 0.16s ease-out both; /* every bubble "arrives" */
781
  }
782
+ /* USER turn: ONE bubble. Gradio NESTS .message.user (outer) > [data-testid="user"] (inner); styling BOTH gave
783
+ a DOUBLE box. So the OUTER .message.user is the single taupe bubble (right-aligned, hugs its text via
784
+ fit-content + the faint amber top-edge), and the INNER [data-testid="user"] is FLATTENED (transparent, no
785
+ box/padding) so it just holds the text. */
786
+ #chat .message.user {
787
  margin-left: auto !important; width: fit-content !important; max-width: 86% !important;
788
  background: #3A2F27 !important; color: #E8DDD0 !important;
789
  padding: 9px 14px !important;
790
  border-radius: 11px !important; border-top: 1px solid rgba(232,147,43,0.40) !important;
791
  box-shadow: 0 1px 2px rgba(0,0,0,0.30) !important;
792
  }
793
+ #chat .message.user [data-testid="user"], #chat [data-testid="user"] {
794
+ background: transparent !important; border: none !important; border-radius: 0 !important;
795
+ box-shadow: none !important; padding: 0 !important; margin: 0 !important;
796
+ }
797
  /* tighten the markdown <p> inside the user bubble so a short message isn't a tall box */
798
  #chat .message.user p, #chat [data-testid="user"] p { margin: 0 !important; }
799
  #chat .message.user *, #chat [data-testid="user"] * { color: #E8DDD0 !important; }