ใ……ใ…Žใ…‡ commited on
Commit
18b03df
ยท
1 Parent(s): 579a2a7

Fix: Apply CSS in Blocks constructor and improve selectors - Move CSS from launch() to Blocks constructor (official pattern) - Add more specific CSS selectors with data-testid and placeholder - Follow Gradio official documentation for CSS application

Browse files
Files changed (1) hide show
  1. CodeWeaver/ui/app.py +12 -5
CodeWeaver/ui/app.py CHANGED
@@ -53,15 +53,21 @@ CSS = """
53
  max-width: 100% !important;
54
  box-sizing: border-box !important;
55
  }
56
- /* Textbox ๋‚ด๋ถ€ input ์š”์†Œ ์Šคํƒ€์ผ */
57
  #session_id_input input[type="text"],
58
- #session_id_input textarea {
 
59
  width: 100% !important;
60
  min-width: 0 !important;
61
  box-sizing: border-box !important;
62
  height: 30px !important;
63
  min-height: 30px !important;
64
  }
 
 
 
 
 
65
  /* Textbox ์ปจํ…Œ์ด๋„ˆ ์Šคํƒ€์ผ */
66
  #session_id_input.form,
67
  #session_id_input > .form {
@@ -139,7 +145,8 @@ def create_demo() -> gr.Blocks:
139
  """Gradio ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค."""
140
 
141
  with gr.Blocks(
142
- title="CodeWeaver - AI ๊ฐœ๋ฐœ ๋„์šฐ๋ฏธ"
 
143
  ) as demo:
144
 
145
  gr.Markdown("""
@@ -290,6 +297,6 @@ if __name__ == "__main__":
290
  server_name="0.0.0.0",
291
  server_port=7860,
292
  share=False,
293
- theme=gr.themes.Soft(),
294
- css=CSS
295
  )
 
53
  max-width: 100% !important;
54
  box-sizing: border-box !important;
55
  }
56
+ /* Textbox ๋‚ด๋ถ€ input ์š”์†Œ ์Šคํƒ€์ผ - data-testid๋กœ ๋” ๊ตฌ์ฒด์ ์œผ๋กœ ํƒ€๊ฒŸํŒ… */
57
  #session_id_input input[type="text"],
58
+ #session_id_input textarea,
59
+ #session_id_input textarea[data-testid="textbox"] {
60
  width: 100% !important;
61
  min-width: 0 !important;
62
  box-sizing: border-box !important;
63
  height: 30px !important;
64
  min-height: 30px !important;
65
  }
66
+ /* Gradio์˜ textbox ์š”์†Œ ์ง์ ‘ ํƒ€๊ฒŸํŒ… */
67
+ textarea[data-testid="textbox"][placeholder*="์„ธ์…˜ ID"] {
68
+ height: 30px !important;
69
+ min-height: 30px !important;
70
+ }
71
  /* Textbox ์ปจํ…Œ์ด๋„ˆ ์Šคํƒ€์ผ */
72
  #session_id_input.form,
73
  #session_id_input > .form {
 
145
  """Gradio ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค."""
146
 
147
  with gr.Blocks(
148
+ title="CodeWeaver - AI ๊ฐœ๋ฐœ ๋„์šฐ๋ฏธ",
149
+ css=CSS # Gradio Blocks ๋ฌธ์„œ: CSS๋ฅผ Blocks ์ƒ์„ฑ์ž์— ์ „๋‹ฌ
150
  ) as demo:
151
 
152
  gr.Markdown("""
 
297
  server_name="0.0.0.0",
298
  server_port=7860,
299
  share=False,
300
+ theme=gr.themes.Soft()
301
+ # CSS๋Š” Blocks ์ƒ์„ฑ์ž์— ์ „๋‹ฌ๋จ
302
  )