petter2025 commited on
Commit
47c1a9b
·
verified ·
1 Parent(s): 1674ff5

Update ui/styles.py

Browse files
Files changed (1) hide show
  1. ui/styles.py +8 -76
ui/styles.py CHANGED
@@ -1,7 +1,10 @@
1
  """
2
- CSS styles and themes
3
  """
4
 
 
 
 
5
  CUSTOM_CSS = """
6
  /* Main container */
7
  .gradio-container {
@@ -25,22 +28,16 @@ h1 {
25
  }
26
 
27
  /* Buttons */
28
- .gradio-button.primary {
29
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%) !important;
30
  color: white !important;
31
  border: none !important;
32
  font-weight: 600 !important;
33
  padding: 12px 24px !important;
34
  border-radius: 8px !important;
35
- transition: transform 0.2s, box-shadow 0.2s !important;
36
- }
37
-
38
- .gradio-button.primary:hover {
39
- transform: translateY(-2px) !important;
40
- box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4) !important;
41
  }
42
 
43
- .gradio-button.secondary {
44
  background: linear-gradient(90deg, #4ECDC4 0%, #44A08D 100%) !important;
45
  color: white !important;
46
  border: none !important;
@@ -49,19 +46,6 @@ h1 {
49
  border-radius: 8px !important;
50
  }
51
 
52
- /* Tabs */
53
- .gradio-tab {
54
- border-bottom: 2px solid transparent !important;
55
- padding: 12px 24px !important;
56
- font-weight: 500 !important;
57
- }
58
-
59
- .gradio-tab.selected {
60
- border-bottom: 2px solid #667eea !important;
61
- color: #667eea !important;
62
- font-weight: 600 !important;
63
- }
64
-
65
  /* JSON displays */
66
  .gr-json {
67
  border: 1px solid #e2e8f0 !important;
@@ -72,56 +56,6 @@ h1 {
72
  font-size: 13px !important;
73
  }
74
 
75
- /* Checkboxes and radios */
76
- .gr-checkbox, .gr-radio {
77
- padding: 10px !important;
78
- border-radius: 6px !important;
79
- border: 1px solid #e2e8f0 !important;
80
- }
81
-
82
- .gr-checkbox:hover, .gr-radio:hover {
83
- border-color: #667eea !important;
84
- background: #f8fafc !important;
85
- }
86
-
87
- /* Sliders */
88
- .gr-slider {
89
- padding: 20px 0 !important;
90
- }
91
-
92
- .gr-slider .range {
93
- background: linear-gradient(90deg, #667eea 0%, #764ba2 100%) !important;
94
- }
95
-
96
- /* Dataframes */
97
- .gr-dataframe {
98
- border: 1px solid #e2e8f0 !important;
99
- border-radius: 8px !important;
100
- overflow: hidden !important;
101
- }
102
-
103
- .gr-dataframe th {
104
- background: #f8fafc !important;
105
- color: #1a365d !important;
106
- font-weight: 600 !important;
107
- padding: 12px !important;
108
- border-bottom: 2px solid #e2e8f0 !important;
109
- }
110
-
111
- .gr-dataframe td {
112
- padding: 10px !important;
113
- border-bottom: 1px solid #e2e8f0 !important;
114
- }
115
-
116
- /* Plot containers */
117
- .gr-plot {
118
- border: 1px solid #e2e8f0 !important;
119
- border-radius: 10px !important;
120
- padding: 15px !important;
121
- background: white !important;
122
- box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
123
- }
124
-
125
  /* Custom classes */
126
  .critical-metric {
127
  background: linear-gradient(135deg, rgba(255,107,107,0.1) 0%, rgba(255,107,107,0.2) 100%) !important;
@@ -159,7 +93,6 @@ h1 {
159
  border-radius: 10px !important;
160
  margin: 15px 0 !important;
161
  border-left: 5px solid #4ECDC4 !important;
162
- box-shadow: 0 4px 6px rgba(0,0,0,0.1) !important;
163
  }
164
 
165
  /* Footer */
@@ -172,6 +105,7 @@ h1 {
172
  }
173
  """
174
 
 
175
  THEME = gr.themes.Soft(
176
  primary_hue="purple",
177
  secondary_hue="teal",
@@ -188,7 +122,5 @@ THEME = gr.themes.Soft(
188
  background_fill_primary="#f8fafc",
189
  background_fill_secondary="#ffffff",
190
  border_color_primary="#e2e8f0",
191
- border_color_secondary="#cbd5e0",
192
- shadow_spread="2px",
193
- shadow_spread_dark="1px"
194
  )
 
1
  """
2
+ CSS styles and themes - FIXED VERSION
3
  """
4
 
5
+ # IMPORT gradio at the top of the file
6
+ import gradio as gr
7
+
8
  CUSTOM_CSS = """
9
  /* Main container */
10
  .gradio-container {
 
28
  }
29
 
30
  /* Buttons */
31
+ button.primary {
32
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%) !important;
33
  color: white !important;
34
  border: none !important;
35
  font-weight: 600 !important;
36
  padding: 12px 24px !important;
37
  border-radius: 8px !important;
 
 
 
 
 
 
38
  }
39
 
40
+ button.secondary {
41
  background: linear-gradient(90deg, #4ECDC4 0%, #44A08D 100%) !important;
42
  color: white !important;
43
  border: none !important;
 
46
  border-radius: 8px !important;
47
  }
48
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  /* JSON displays */
50
  .gr-json {
51
  border: 1px solid #e2e8f0 !important;
 
56
  font-size: 13px !important;
57
  }
58
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  /* Custom classes */
60
  .critical-metric {
61
  background: linear-gradient(135deg, rgba(255,107,107,0.1) 0%, rgba(255,107,107,0.2) 100%) !important;
 
93
  border-radius: 10px !important;
94
  margin: 15px 0 !important;
95
  border-left: 5px solid #4ECDC4 !important;
 
96
  }
97
 
98
  /* Footer */
 
105
  }
106
  """
107
 
108
+ # Now gr is defined, so this won't cause an error
109
  THEME = gr.themes.Soft(
110
  primary_hue="purple",
111
  secondary_hue="teal",
 
122
  background_fill_primary="#f8fafc",
123
  background_fill_secondary="#ffffff",
124
  border_color_primary="#e2e8f0",
125
+ border_color_secondary="#cbd5e0"
 
 
126
  )