lxrogerscohere commited on
Commit
6cf1e36
·
verified ·
1 Parent(s): a3c2486

Remove nested textbox wrappers

Browse files
Files changed (2) hide show
  1. app.py +6 -6
  2. style.css +20 -28
app.py CHANGED
@@ -717,8 +717,8 @@ def build_demo() -> gr.Blocks:
717
  instructions = gr.Textbox(
718
  value="",
719
  label="Instructions",
720
- show_label=True,
721
- container=True,
722
  lines=4,
723
  max_lines=8,
724
  max_length=MAX_INPUT_CHARS,
@@ -727,8 +727,8 @@ def build_demo() -> gr.Blocks:
727
  source_text = gr.Textbox(
728
  value="",
729
  label="Source text",
730
- show_label=True,
731
- container=True,
732
  lines=10,
733
  max_lines=16,
734
  max_length=MAX_INPUT_CHARS,
@@ -762,8 +762,8 @@ def build_demo() -> gr.Blocks:
762
  translation_output = gr.Textbox(
763
  value="",
764
  label="Translation",
765
- show_label=True,
766
- container=True,
767
  interactive=False,
768
  lines=18,
769
  buttons=["copy"],
 
717
  instructions = gr.Textbox(
718
  value="",
719
  label="Instructions",
720
+ show_label=False,
721
+ container=False,
722
  lines=4,
723
  max_lines=8,
724
  max_length=MAX_INPUT_CHARS,
 
727
  source_text = gr.Textbox(
728
  value="",
729
  label="Source text",
730
+ show_label=False,
731
+ container=False,
732
  lines=10,
733
  max_lines=16,
734
  max_length=MAX_INPUT_CHARS,
 
762
  translation_output = gr.Textbox(
763
  value="",
764
  label="Translation",
765
+ show_label=False,
766
+ container=False,
767
  interactive=False,
768
  lines=18,
769
  buttons=["copy"],
style.css CHANGED
@@ -190,6 +190,7 @@ footer {
190
  #source-text-input,
191
  #translation-output {
192
  overflow: hidden;
 
193
  border: 1px solid var(--mushroom-300) !important;
194
  background: #fff !important;
195
  box-shadow: none !important;
@@ -217,28 +218,13 @@ footer {
217
  background: #f0f2f3 !important;
218
  }
219
 
220
- #instructions-input > .wrap,
221
- #source-text-input > .wrap,
222
- #translation-output > .wrap,
223
- #instructions-input label,
224
- #source-text-input label,
225
- #translation-output label {
226
- height: 100% !important;
227
- min-height: 0 !important;
228
- }
229
-
230
- #instructions-input label,
231
- #source-text-input label,
232
- #translation-output label {
233
- display: flex !important;
234
- flex-direction: column;
235
- }
236
-
237
- #instructions-input .block-info,
238
- #source-text-input .block-info,
239
- #translation-output .block-info {
240
- flex: 0 0 auto;
241
- padding: 14px 20px 0;
242
  color: var(--volcanic-500) !important;
243
  font-family: var(--sans) !important;
244
  font-size: 10px !important;
@@ -246,13 +232,19 @@ footer {
246
  line-height: 1.2 !important;
247
  letter-spacing: 0.04em;
248
  text-transform: uppercase;
 
249
  }
250
 
251
- #instructions-input .input-container,
252
- #source-text-input .input-container,
253
- #translation-output .input-container {
254
- flex: 1 1 auto;
255
- min-height: 0 !important;
 
 
 
 
 
256
  }
257
 
258
  #instructions-input textarea,
@@ -260,7 +252,7 @@ footer {
260
  #translation-output textarea {
261
  height: 100% !important;
262
  min-height: 0 !important;
263
- padding: 7px 20px 16px !important;
264
  overflow-y: auto !important;
265
  resize: none !important;
266
  border: 0 !important;
 
190
  #source-text-input,
191
  #translation-output {
192
  overflow: hidden;
193
+ position: relative;
194
  border: 1px solid var(--mushroom-300) !important;
195
  background: #fff !important;
196
  box-shadow: none !important;
 
218
  background: #f0f2f3 !important;
219
  }
220
 
221
+ #instructions-input::before,
222
+ #source-text-input::before,
223
+ #translation-output::before {
224
+ position: absolute;
225
+ top: 13px;
226
+ left: 20px;
227
+ z-index: 1;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
228
  color: var(--volcanic-500) !important;
229
  font-family: var(--sans) !important;
230
  font-size: 10px !important;
 
232
  line-height: 1.2 !important;
233
  letter-spacing: 0.04em;
234
  text-transform: uppercase;
235
+ pointer-events: none;
236
  }
237
 
238
+ #instructions-input::before {
239
+ content: "Instructions";
240
+ }
241
+
242
+ #source-text-input::before {
243
+ content: "Source text";
244
+ }
245
+
246
+ #translation-output::before {
247
+ content: "Translation";
248
  }
249
 
250
  #instructions-input textarea,
 
252
  #translation-output textarea {
253
  height: 100% !important;
254
  min-height: 0 !important;
255
+ padding: 34px 20px 16px !important;
256
  overflow-y: auto !important;
257
  resize: none !important;
258
  border: 0 !important;