Tuchuanhuhuhu commited on
Commit
7311426
·
1 Parent(s): 4aeab6a

修复显示不全的bug

Browse files
Files changed (2) hide show
  1. ChuanhuChatbot.py +8 -6
  2. custom.css +10 -1
ChuanhuChatbot.py CHANGED
@@ -100,18 +100,20 @@ with gr.Blocks(
100
  ).set(
101
  button_primary_background_fill="#06AE56",
102
  button_primary_background_fill_dark="#06AE56",
 
103
  button_primary_border_color="#06AE56",
104
  button_primary_border_color_dark="#06AE56",
105
  button_primary_text_color="#FFFFFF",
106
  button_primary_text_color_dark="#FFFFFF",
107
  button_secondary_background_fill="#F2F2F2",
108
  button_secondary_background_fill_dark="#2B2B2B",
109
- button_secondary_text_color="#06AE56",
110
  button_secondary_text_color_dark="#FFFFFF",
111
- background_fill_primary="#F7F7F7",
112
- background_fill_primary_dark="#1F1F1F",
113
- block_title_text_color="#6E737B",
114
- block_title_background_fill = "*background_fill_primary",
 
115
  ),
116
  ) as demo:
117
  history = gr.State([])
@@ -128,7 +130,7 @@ with gr.Blocks(
128
  with gr.Row(scale=1).style(equal_height=True):
129
  with gr.Column(scale=5):
130
  with gr.Row(scale=1):
131
- chatbot = gr.Chatbot(elem_id="chuanhu_chatbot")
132
  with gr.Row(scale=1):
133
  with gr.Column(scale=12):
134
  user_input = gr.Textbox(
 
100
  ).set(
101
  button_primary_background_fill="#06AE56",
102
  button_primary_background_fill_dark="#06AE56",
103
+ button_primary_background_fill_hover="#07C863",
104
  button_primary_border_color="#06AE56",
105
  button_primary_border_color_dark="#06AE56",
106
  button_primary_text_color="#FFFFFF",
107
  button_primary_text_color_dark="#FFFFFF",
108
  button_secondary_background_fill="#F2F2F2",
109
  button_secondary_background_fill_dark="#2B2B2B",
110
+ button_secondary_text_color="#393939",
111
  button_secondary_text_color_dark="#FFFFFF",
112
+ # background_fill_primary="#F7F7F7",
113
+ # background_fill_primary_dark="#1F1F1F",
114
+ block_title_text_color="*primary_500",
115
+ block_title_background_fill = "*primary_100",
116
+ input_background_fill="#F6F6F6",
117
  ),
118
  ) as demo:
119
  history = gr.State([])
 
130
  with gr.Row(scale=1).style(equal_height=True):
131
  with gr.Column(scale=5):
132
  with gr.Row(scale=1):
133
+ chatbot = gr.Chatbot(elem_id="chuanhu_chatbot").style(height="100%")
134
  with gr.Row(scale=1):
135
  with gr.Column(scale=12):
136
  user_input = gr.Textbox(
custom.css CHANGED
@@ -15,12 +15,20 @@
15
  @media (min-width: 500px) {
16
  #chuanhu_chatbot {
17
  height: calc(100vh - 200px);
 
 
 
 
18
  }
19
  }
20
  /* 屏幕宽度小于500px的设备 */
21
  @media (max-width: 499px) {
22
  #chuanhu_chatbot {
23
  height: calc(100vh - 140px);
 
 
 
 
24
  }
25
  }
26
  /* 对话气泡 */
@@ -34,12 +42,13 @@
34
  [data-testid = "bot"] {
35
  max-width: 85%;
36
  border-bottom-left-radius: 0 !important;
 
37
  }
38
  [data-testid = "user"] {
39
  max-width: 85%;
40
  width: auto !important;
41
  border-bottom-right-radius: 0 !important;
42
- color: #FFFFFF !important;
43
  }
44
  /* 表格 */
45
  table {
 
15
  @media (min-width: 500px) {
16
  #chuanhu_chatbot {
17
  height: calc(100vh - 200px);
18
+ background-color: #F3F3F3 !important;
19
+ }
20
+ #chuanhu_chatbot .wrap {
21
+ max-height: calc(100vh - 200px - var(--line-sm)*1rem );
22
  }
23
  }
24
  /* 屏幕宽度小于500px的设备 */
25
  @media (max-width: 499px) {
26
  #chuanhu_chatbot {
27
  height: calc(100vh - 140px);
28
+ background-color: #F3F3F3 !important;
29
+ }
30
+ #chuanhu_chatbot .wrap {
31
+ max-height: calc(100vh - 140 - var(--line-sm)*1rem );
32
  }
33
  }
34
  /* 对话气泡 */
 
42
  [data-testid = "bot"] {
43
  max-width: 85%;
44
  border-bottom-left-radius: 0 !important;
45
+ background-color: #FFFFFF !important;
46
  }
47
  [data-testid = "user"] {
48
  max-width: 85%;
49
  width: auto !important;
50
  border-bottom-right-radius: 0 !important;
51
+ background-color: #95EC69 !important;
52
  }
53
  /* 表格 */
54
  table {