Zedel17 commited on
Commit
ddd11b5
·
1 Parent(s): 5c3681a

Fix css injection

Browse files
Files changed (1) hide show
  1. app.py +36 -33
app.py CHANGED
@@ -77,39 +77,42 @@ def chat_fn(message, history, persona_name):
77
  # Gradio UI
78
  # ==============================
79
 
80
- custom_css = """
81
- .gradio-container {
82
- background-color: #F5FAFF !important;
83
- }
84
- button.primary {
85
- background-color: #1A73E8 !important;
86
- border-color: #1A73E8 !important;
87
- }
88
- button.primary:hover {
89
- background-color: #1557B0 !important;
90
- }
91
- .message.user {
92
- background-color: #EDEDED !important;
93
- }
94
- .message.bot {
95
- background-color: #E8F1FF !important;
96
- }
97
- h1 {
98
- color: #1A73E8 !important;
99
- text-align: center;
100
- }
101
- .gr-markdown {
102
- text-align: center;
103
- }
104
- .gr-radio {
105
- background-color: white;
106
- padding: 15px;
107
- border-radius: 8px;
108
- box-shadow: 0 2px 4px rgba(0,0,0,0.05);
109
- }
110
- """
111
-
112
- with gr.Blocks(css=custom_css) as demo:
 
 
 
113
 
114
  gr.Markdown(
115
  """
 
77
  # Gradio UI
78
  # ==============================
79
 
80
+ with gr.Blocks() as demo:
81
+
82
+ # Inject custom CSS
83
+ gr.HTML("""
84
+ <style>
85
+ .gradio-container {
86
+ background-color: #F5FAFF !important;
87
+ }
88
+ button.primary {
89
+ background-color: #1A73E8 !important;
90
+ border-color: #1A73E8 !important;
91
+ }
92
+ button.primary:hover {
93
+ background-color: #1557B0 !important;
94
+ }
95
+ .message.user {
96
+ background-color: #EDEDED !important;
97
+ }
98
+ .message.bot {
99
+ background-color: #E8F1FF !important;
100
+ }
101
+ h1 {
102
+ color: #1A73E8 !important;
103
+ text-align: center;
104
+ }
105
+ .gr-markdown {
106
+ text-align: center;
107
+ }
108
+ .gr-radio {
109
+ background-color: white;
110
+ padding: 15px;
111
+ border-radius: 8px;
112
+ box-shadow: 0 2px 4px rgba(0,0,0,0.05);
113
+ }
114
+ </style>
115
+ """)
116
 
117
  gr.Markdown(
118
  """