Andrew Gockenbach commited on
Commit
b44d8f4
·
1 Parent(s): 99ebdf1

Additional CSS updates

Browse files
Files changed (1) hide show
  1. app.py +72 -47
app.py CHANGED
@@ -67,38 +67,11 @@ class HfModelWrapper:
67
  # Custom theme colors based on brand standards
68
  class ArtemisiaTheme(Base):
69
  def __init__(self, **kwargs):
70
-
71
-
72
- # Configure Gradio's theme system with our colors
73
- super().__init__(
74
- font=["Segoe UI", "Tahoma", "Geneva", "Verdana", "sans-serif"],
75
- primary_hue=colors.indigo,
76
- neutral_hue=colors.gray,
77
- **kwargs
78
- )
79
-
80
- # Background settings
81
- self.body_background_fill = "#4f008c"
82
- self.background_fill_primary = self.neutral_800
83
- self.block_background_fill = "transparent"
84
- self.block_label_background_fill = self.neutral_700
85
-
86
- # Components
87
- self.button_primary_background_fill = self.primary_900
88
- self.button_primary_background_fill_hover = self.primary_700
89
-
90
- # Input fields
91
- self.input_background_fill = "#000000"
92
- self.input_border_color = "transparent"
93
-
94
- # Text colors
95
  self.text_color = "#ffffff"
96
- self.error_text_color = "#ff5252"
97
-
98
- # Custom theme colors based on brand standards
99
- class ArtemisiaTheme(Base):
100
- def __init__(self, **kwargs):
101
-
102
 
103
  # Configure Gradio's theme system with our colors
104
  super().__init__(
@@ -109,7 +82,7 @@ class ArtemisiaTheme(Base):
109
  )
110
 
111
  # Background settings
112
- self.body_background_fill = "#4f008c"
113
  self.background_fill_primary = self.neutral_800
114
  self.block_background_fill = "transparent"
115
  self.block_label_background_fill = self.neutral_700
@@ -117,45 +90,94 @@ class ArtemisiaTheme(Base):
117
  # Components
118
  self.button_primary_background_fill = self.primary_900
119
  self.button_primary_background_fill_hover = self.primary_700
 
120
 
121
  # Input fields
122
- self.input_background_fill = "#000000"
123
  self.input_border_color = "transparent"
 
124
 
125
  # Text colors
126
- self.text_color = "#ffffff"
127
- self.error_text_color = "#ff5252"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
 
129
  # Custom CSS for exact layout and styling
130
  custom_css = """
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
  body {
132
  margin: 0;
133
  padding: 0;
134
  width: 100%;
135
- background-color: #ffffff;
136
- color: #000;
137
  font-family: 'Helvetica Neue', Helvetica, Arial, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
138
  font-weight: 400;
139
  line-height: 1.5;
140
  -webkit-font-smoothing: antialiased;
141
  -moz-osx-font-smoothing: grayscale;
142
  }
 
 
143
  .gradio-container {
144
- background-color: #ffffff !important;
 
 
145
  }
146
 
 
147
  .header {
148
- background-color: #ffffff;
149
- padding: 10px 20px;
150
  display: flex;
151
  flex-wrap: nowrap;
152
  align-items: flex-end;
153
- gap: 24px;
 
154
  }
155
 
156
  .logo-container {
157
  display: flex;
158
- gap: 0px;
159
  flex-direction: row;
160
  width: fit-content !important;
161
  flex: 0 0 auto !important;
@@ -166,8 +188,8 @@ body {
166
  .nav-divider {
167
  width: 1px;
168
  height: 1rem;
169
- background-color: #4f008c;
170
- margin: 0 10px;
171
  align-self: flex-end;
172
  }
173
 
@@ -181,11 +203,12 @@ body {
181
  overflow: hidden;
182
  text-overflow: ellipsis;
183
  letter-spacing: -0.02em;
184
- color: #4f008c !important;
185
  }
186
 
187
- .header h1 {
188
- color: #4f008c !important;
 
189
  }
190
 
191
  .stc-logo {
@@ -199,6 +222,7 @@ body {
199
  height: 1rem;
200
  width: auto;
201
  display: block;
 
202
  overflow: hidden;
203
  scrollbar-width: none;
204
  overflow-x: hidden;
@@ -658,6 +682,7 @@ input, textarea {
658
 
659
  # SVG icons
660
  stc_logo_svg = """<svg xmlns="http://www.w3.org/2000/svg" width="66" height="32" viewBox="0 0 66 32" fill="#4f008c" style="display: block; flex-shrink: 0;"><path fill-rule="evenodd" clip-rule="evenodd" d="M31.625 6.80851L31.6213 0.00567279L24.7511 0L24.75 6.79666L31.625 6.80851ZM5.88232 23.0513L0 24.2653C0.424529 29.3706 6.18066 32.1214 11.3441 31.9959C14.2329 31.9257 16.8607 30.9901 18.5472 29.6392C22.4356 26.5245 22.4103 20.0758 17.2744 17.3711C15.3452 16.3551 13.2453 15.9901 11.4475 15.6777C9.10574 15.2707 7.27666 14.9528 7.00534 13.4013C6.4686 10.332 12.5096 9.46738 14.5772 12.2286C14.8637 12.6112 14.954 12.903 15.0505 13.2152L15.0505 13.2152C15.114 13.4203 15.1801 13.6342 15.3064 13.8884L20.889 12.6335C20.9094 12.6247 20.9455 12.6077 20.9725 12.5925C20.6349 7.68784 14.5151 5.00625 9.32399 5.5062C-0.27525 6.43076 -2.55039 16.9042 5.58028 20.2095C6.79516 20.7033 8.15129 20.9902 9.48385 21.2722C10.7248 21.5347 11.9453 21.793 13.0123 22.21C15.9184 23.3457 15.0929 26.4741 11.6771 26.7789C8.56398 27.0567 6.23313 25.7203 5.88232 23.0513ZM66 23.5042L59.9776 21.5819C59.8074 21.8761 59.6967 22.1399 59.5911 22.3913C59.4397 22.7522 59.2989 23.0876 59.0079 23.451C58.5671 24.0016 58.1301 24.4609 57.4746 24.8733C56.2011 25.6745 54.3913 26.0052 52.5943 25.6296C49.5135 24.9858 47.5738 22.504 47.4893 18.9828C47.4011 15.3106 49.2053 12.6962 52.1919 11.9434C56.004 10.9825 58.8882 12.9476 59.6362 15.8925L65.8508 13.9081C65.2461 10.9173 62.8376 8.44026 60.8112 7.24677C52.9767 2.63234 40.5366 7.03787 40.5625 18.7666C40.5881 30.3289 53.233 34.8158 60.8587 30.2249C62.1039 29.4752 63.2247 28.4579 64.0145 27.4692C64.723 26.5823 65.7798 24.9372 66 23.5042ZM24.8097 12.9397L31.6484 12.9362C31.6463 13.2625 31.6421 13.7315 31.6371 14.2928L31.637 14.3022L31.637 14.3033L31.637 14.3036L31.637 14.304C31.6122 17.0787 31.5674 22.0894 31.6626 23.2768C31.7957 24.9371 32.571 25.7899 34.2386 26.0043C35.9984 26.2305 36.9321 25.8072 38.115 25.2708L38.1151 25.2708C38.2402 25.2141 38.3681 25.1561 38.5 25.0975L38.4566 30.5261C35.605 32.6136 28.5618 32.8937 25.8963 28.6417C24.7526 26.8176 24.7717 24.551 24.7916 22.1906L24.7916 22.19C24.7942 21.8817 24.7968 21.5719 24.7968 21.2612C24.7969 20.3989 24.7853 19.5126 24.7737 18.6184V18.6183V18.6183V18.6182V18.6182C24.7489 16.7095 24.7236 14.7647 24.8097 12.9397ZM38.5 12.9362L31.625 12.935L31.6257 6.12766L38.4997 6.13078L38.5 12.9362Z" fill="#ffffff"></path></svg>"""
 
661
  artemsia_logo_svg = """
662
  <?xml version="1.0" encoding="UTF-8"?>
663
  <svg id="Layer_2" data-name="Layer 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 351.26 430.29">
 
67
  # Custom theme colors based on brand standards
68
  class ArtemisiaTheme(Base):
69
  def __init__(self, **kwargs):
70
+ # Define color variables for easy maintenance
71
+ self.primary_color = "#4f008c"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  self.text_color = "#ffffff"
73
+ self.error_color = "#ff5252"
74
+ self.input_bg = "#000000"
 
 
 
 
75
 
76
  # Configure Gradio's theme system with our colors
77
  super().__init__(
 
82
  )
83
 
84
  # Background settings
85
+ self.body_background_fill = self.primary_color
86
  self.background_fill_primary = self.neutral_800
87
  self.block_background_fill = "transparent"
88
  self.block_label_background_fill = self.neutral_700
 
90
  # Components
91
  self.button_primary_background_fill = self.primary_900
92
  self.button_primary_background_fill_hover = self.primary_700
93
+ self.button_primary_text_color = self.text_color
94
 
95
  # Input fields
96
+ self.input_background_fill = self.input_bg
97
  self.input_border_color = "transparent"
98
+ self.input_text_color = self.text_color
99
 
100
  # Text colors
101
+ self.text_color = self.text_color
102
+ self.error_text_color = self.error_color
103
+
104
+ # Add custom CSS variables for more flexible theming
105
+ self.set(
106
+ # Colors
107
+ *[
108
+ ("primary", self.primary_color),
109
+ ("text", self.text_color),
110
+ ("error", self.error_color),
111
+ # Add more theme variables as needed
112
+ ],
113
+ # Font sizes
114
+ *[
115
+ ("text-sm", "0.875rem"),
116
+ ("text-base", "1rem"),
117
+ ("text-lg", "1.125rem"),
118
+ # Add more size variables as needed
119
+ ]
120
+ )
121
 
122
  # Custom CSS for exact layout and styling
123
  custom_css = """
124
+ :root {
125
+ /* Theme colors */
126
+ --primary: #4f008c;
127
+ --primary-hover: #3d006d;
128
+ --text: #ffffff;
129
+ --text-secondary: #e0e0e0;
130
+ --background: #ffffff;
131
+ --error: #ff5252;
132
+
133
+ /* Spacing */
134
+ --spacing-xs: 0.25rem;
135
+ --spacing-sm: 0.5rem;
136
+ --spacing-md: 1rem;
137
+ --spacing-lg: 1.5rem;
138
+ --spacing-xl: 2rem;
139
+
140
+ /* Border radius */
141
+ --radius-sm: 4px;
142
+ --radius-md: 8px;
143
+ --radius-lg: 12px;
144
+ }
145
+
146
+ /* Base styles */
147
  body {
148
  margin: 0;
149
  padding: 0;
150
  width: 100%;
151
+ background-color: var(--background);
152
+ color: var(--text);
153
  font-family: 'Helvetica Neue', Helvetica, Arial, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
154
  font-weight: 400;
155
  line-height: 1.5;
156
  -webkit-font-smoothing: antialiased;
157
  -moz-osx-font-smoothing: grayscale;
158
  }
159
+
160
+ /* Container */
161
  .gradio-container {
162
+ background-color: var(--background) !important;
163
+ padding: 0 !important;
164
+ max-width: 100% !important;
165
  }
166
 
167
+ /* Header */
168
  .header {
169
+ background-color: var(--background);
170
+ padding: var(--spacing-md) var(--spacing-lg);
171
  display: flex;
172
  flex-wrap: nowrap;
173
  align-items: flex-end;
174
+ gap: var(--spacing-lg);
175
+ border-bottom: 1px solid rgba(0, 0, 0, 0.1);
176
  }
177
 
178
  .logo-container {
179
  display: flex;
180
+ gap: 0;
181
  flex-direction: row;
182
  width: fit-content !important;
183
  flex: 0 0 auto !important;
 
188
  .nav-divider {
189
  width: 1px;
190
  height: 1rem;
191
+ background-color: var(--primary);
192
+ margin: 0 var(--spacing-sm);
193
  align-self: flex-end;
194
  }
195
 
 
203
  overflow: hidden;
204
  text-overflow: ellipsis;
205
  letter-spacing: -0.02em;
206
+ color: var(--primary) !important;
207
  }
208
 
209
+ .header h1, .header h2, .header h3, .header h4, .header h5, .header h6 {
210
+ color: var(--primary) !important;
211
+ margin: 0;
212
  }
213
 
214
  .stc-logo {
 
222
  height: 1rem;
223
  width: auto;
224
  display: block;
225
+ fill: var(--primary);
226
  overflow: hidden;
227
  scrollbar-width: none;
228
  overflow-x: hidden;
 
682
 
683
  # SVG icons
684
  stc_logo_svg = """<svg xmlns="http://www.w3.org/2000/svg" width="66" height="32" viewBox="0 0 66 32" fill="#4f008c" style="display: block; flex-shrink: 0;"><path fill-rule="evenodd" clip-rule="evenodd" d="M31.625 6.80851L31.6213 0.00567279L24.7511 0L24.75 6.79666L31.625 6.80851ZM5.88232 23.0513L0 24.2653C0.424529 29.3706 6.18066 32.1214 11.3441 31.9959C14.2329 31.9257 16.8607 30.9901 18.5472 29.6392C22.4356 26.5245 22.4103 20.0758 17.2744 17.3711C15.3452 16.3551 13.2453 15.9901 11.4475 15.6777C9.10574 15.2707 7.27666 14.9528 7.00534 13.4013C6.4686 10.332 12.5096 9.46738 14.5772 12.2286C14.8637 12.6112 14.954 12.903 15.0505 13.2152L15.0505 13.2152C15.114 13.4203 15.1801 13.6342 15.3064 13.8884L20.889 12.6335C20.9094 12.6247 20.9455 12.6077 20.9725 12.5925C20.6349 7.68784 14.5151 5.00625 9.32399 5.5062C-0.27525 6.43076 -2.55039 16.9042 5.58028 20.2095C6.79516 20.7033 8.15129 20.9902 9.48385 21.2722C10.7248 21.5347 11.9453 21.793 13.0123 22.21C15.9184 23.3457 15.0929 26.4741 11.6771 26.7789C8.56398 27.0567 6.23313 25.7203 5.88232 23.0513ZM66 23.5042L59.9776 21.5819C59.8074 21.8761 59.6967 22.1399 59.5911 22.3913C59.4397 22.7522 59.2989 23.0876 59.0079 23.451C58.5671 24.0016 58.1301 24.4609 57.4746 24.8733C56.2011 25.6745 54.3913 26.0052 52.5943 25.6296C49.5135 24.9858 47.5738 22.504 47.4893 18.9828C47.4011 15.3106 49.2053 12.6962 52.1919 11.9434C56.004 10.9825 58.8882 12.9476 59.6362 15.8925L65.8508 13.9081C65.2461 10.9173 62.8376 8.44026 60.8112 7.24677C52.9767 2.63234 40.5366 7.03787 40.5625 18.7666C40.5881 30.3289 53.233 34.8158 60.8587 30.2249C62.1039 29.4752 63.2247 28.4579 64.0145 27.4692C64.723 26.5823 65.7798 24.9372 66 23.5042ZM24.8097 12.9397L31.6484 12.9362C31.6463 13.2625 31.6421 13.7315 31.6371 14.2928L31.637 14.3022L31.637 14.3033L31.637 14.3036L31.637 14.304C31.6122 17.0787 31.5674 22.0894 31.6626 23.2768C31.7957 24.9371 32.571 25.7899 34.2386 26.0043C35.9984 26.2305 36.9321 25.8072 38.115 25.2708L38.1151 25.2708C38.2402 25.2141 38.3681 25.1561 38.5 25.0975L38.4566 30.5261C35.605 32.6136 28.5618 32.8937 25.8963 28.6417C24.7526 26.8176 24.7717 24.551 24.7916 22.1906L24.7916 22.19C24.7942 21.8817 24.7968 21.5719 24.7968 21.2612C24.7969 20.3989 24.7853 19.5126 24.7737 18.6184V18.6183V18.6183V18.6182V18.6182C24.7489 16.7095 24.7236 14.7647 24.8097 12.9397ZM38.5 12.9362L31.625 12.935L31.6257 6.12766L38.4997 6.13078L38.5 12.9362Z" fill="#ffffff"></path></svg>"""
685
+ # SVG assets
686
  artemsia_logo_svg = """
687
  <?xml version="1.0" encoding="UTF-8"?>
688
  <svg id="Layer_2" data-name="Layer 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 351.26 430.29">