Bit-Trading-Company commited on
Commit
14ba54c
·
verified ·
1 Parent(s): e5eae78

CI deploy b886e73b

Browse files
Files changed (1) hide show
  1. src/ui/theme.py +81 -5
src/ui/theme.py CHANGED
@@ -119,6 +119,19 @@ footer, .gradio-container footer{ display:none !important; }
119
  """
120
 
121
  SHELL_CSS = """
 
 
 
 
 
 
 
 
 
 
 
 
 
122
  /* ================= shell ================= */
123
  .gradio-container{
124
  background:var(--bg-canvas) !important;
@@ -464,12 +477,75 @@ html, body{ height:auto !important; min-height:0 !important; }
464
  max-height:560px !important;
465
  }
466
 
467
- /* The sign-in row sits directly under the header. Colour only -- no layout,
468
- positioning or pointer overrides on the OAuth control itself. */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
469
  .bit-loginrow{
470
- padding:6px 12px !important; gap:0 !important;
471
- background:var(--bg-panel);
472
- border-bottom:1px solid var(--border-default);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
473
  }
474
 
475
  /* ================= header help tooltip =================
 
119
  """
120
 
121
  SHELL_CSS = """
122
+ /* ================= tabs =================
123
+ Every tab, header nav and Gradio alike, is Styrene 10px. Gradio 5 renders
124
+ its tab strip as `.tab-container`, not the `.tab-nav` an older selector
125
+ assumed, which is why these were still falling back to the system font. */
126
+ .gradio-container .tab-container button,
127
+ .gradio-container .tab-nav > button,
128
+ .bit-topbar nav button,
129
+ header nav button{
130
+ font-family:var(--font-styrene) !important;
131
+ font-size:10px !important;
132
+ text-transform:uppercase; letter-spacing:var(--tracking-wide);
133
+ }
134
+
135
  /* ================= shell ================= */
136
  .gradio-container{
137
  background:var(--bg-canvas) !important;
 
477
  max-height:560px !important;
478
  }
479
 
480
+ /* ================= sign-in =================
481
+ The LoginButton stays a plain, unwrapped Gradio component -- that DOM
482
+ arrangement is the one that finally worked, and nothing here changes it.
483
+ Only presentation.
484
+
485
+ The button is pinned to the top-right of the header, and the header itself
486
+ *reserves* that width via padding-right. Reserving is what keeps the status,
487
+ glossary and store chips beside the button rather than under it: they are
488
+ pushed left by the reserve, so they cannot collide however long the run
489
+ context chip grows. An overlay with a guessed offset cannot promise that. */
490
+ :root{
491
+ --bit-header-h: 46px; /* keep in step with the header's own height */
492
+ --bit-header-pad: 12px; /* the header's own horizontal padding */
493
+ --bit-login-w: 200px; /* space reserved for the sign-in control */
494
+ --bit-stack-gap: 8px; /* the gap Gradio puts between stacked blocks */
495
+ }
496
+
497
+ .gradio-container header{
498
+ padding-right: calc(var(--bit-header-pad) + var(--bit-login-w)) !important;
499
+ }
500
+
501
  .bit-loginrow{
502
+ position:sticky; top:0; z-index:31;
503
+ /* Lift by the header height *plus* the stack gap: the row starts one gap
504
+ below the header, so ignoring it leaves the button sitting low. */
505
+ margin-top:calc(-1 * (var(--bit-header-h) + var(--bit-stack-gap))) !important;
506
+ height:var(--bit-header-h);
507
+ display:flex !important;
508
+ align-items:center; /* same optical centre as the chips */
509
+ justify-content:flex-end;
510
+ padding:0 var(--bit-header-pad) 0 0 !important;
511
+ gap:0 !important; background:transparent !important; border:0 !important;
512
+ pointer-events:none; /* must not eat header clicks */
513
+ }
514
+ /* Gradio wraps the button in its own block. Without making that wrapper fill
515
+ the bar and centre its child, `align-items` centres the *wrapper* and the
516
+ button settles at its bottom edge -- which is the extra top space. */
517
+ .bit-loginrow > *{
518
+ pointer-events:auto; flex:0 0 auto !important;
519
+ height:100% !important; min-height:0 !important;
520
+ display:flex !important; align-items:center !important;
521
+ padding:0 !important; margin:0 !important;
522
+ }
523
+
524
+ /* Colour and type only -- no positioning on the control itself. */
525
+ .bit-loginrow button{
526
+ background:var(--accent-amber) !important; color:var(--stone-950) !important;
527
+ border:1px solid var(--accent-amber) !important;
528
+ font-family:var(--font-mono) !important; font-size:var(--text-2xs) !important;
529
+ padding:4px 10px !important; min-width:0 !important; white-space:nowrap;
530
+ box-shadow:none !important; line-height:1.4 !important;
531
+ /* Keep its own height and sit centred, rather than stretching to fill the
532
+ bar -- a full-height button reads as a block, not a control. */
533
+ align-self:center !important; height:auto !important;
534
+ min-height:0 !important; flex:0 0 auto !important;
535
+ }
536
+ .bit-loginrow button:hover{
537
+ background:var(--stone-950) !important; color:var(--accent-amber) !important;
538
+ }
539
+
540
+ @media (max-width: 1100px){
541
+ /* Too tight to overlay: drop it to its own slim strip and stop reserving. */
542
+ .gradio-container header{ padding-right:var(--bit-header-pad) !important; }
543
+ .bit-loginrow{
544
+ position:static; margin-top:0 !important; height:auto;
545
+ padding:4px var(--bit-header-pad) !important;
546
+ border-bottom:1px solid var(--border-default) !important;
547
+ background:var(--bg-panel) !important;
548
+ }
549
  }
550
 
551
  /* ================= header help tooltip =================