R-Kentaren commited on
Commit
93d71db
Β·
verified Β·
1 Parent(s): 770a0c0

Fix UI: remove LoginButton, fix aggressive CSS overrides that hid custom HTML component

Browse files
Files changed (1) hide show
  1. static/style.css +54 -70
static/style.css CHANGED
@@ -1,71 +1,42 @@
1
  /* DeepSeek V4 Flash Ultra-Minimalist & Mobile-Friendly Style Sheet */
2
 
3
- /* ── AGGRESSIVE Gradio overrides ─────────────────────────────────────── */
4
- /* Completely hide Gradio's default chrome, containers, and hidden components */
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  .gradio-container,
6
- .contain,
7
  .gr-app,
8
  .main,
9
- .wrap,
10
- .contain .gr-box,
11
- .gr-panel,
12
- .gr-input,
13
- .gr-form,
14
- .gr-block {
15
  max-width: 100% !important;
16
  padding: 0 !important;
17
  margin: 0 !important;
18
  background: transparent !important;
19
  border: none !important;
20
  box-shadow: none !important;
21
- gap: 0 !important;
22
  }
23
 
24
- /* Hide Gradio's top bar / header */
25
- .gradio-container > .header,
26
- .gradio-container header,
27
- #gradio-header,
28
- .gr-header {
29
- display: none !important;
30
- }
31
-
32
- /* Hide ALL Gradio hidden components and their wrappers */
33
- .component-3,
34
- .component-2,
35
- .component-1,
36
- [data-testid="textbox"],
37
- [data-testid="button"],
38
- .gradio-container .gr-box[data-testid],
39
- .gradio-container .form,
40
- .gradio-container .gap {
41
- display: none !important;
42
- height: 0 !important;
43
- min-height: 0 !important;
44
- padding: 0 !important;
45
  margin: 0 !important;
 
46
  overflow: hidden !important;
47
- visibility: hidden !important;
48
- position: absolute !important;
49
- pointer-events: none !important;
50
- }
51
-
52
- /* Hide the Gradio LoginButton (visible=True needed for OAuth, but we use our own custom button) */
53
- .gradio-container a[href*="login"],
54
- .gradio-container button[class*="login"],
55
- .gradio-container [data-testid="login-button"],
56
- .gradio-container .login-btn,
57
- .gradio-container a[target="_top"] {
58
- position: absolute !important;
59
- left: -9999px !important;
60
- top: -9999px !important;
61
- width: 0 !important;
62
- height: 0 !important;
63
- overflow: hidden !important;
64
- opacity: 0 !important;
65
- pointer-events: none !important;
66
  }
67
 
68
- /* Make our custom app root the only visible thing */
69
  #custom-app-root {
70
  display: block !important;
71
  visibility: visible !important;
@@ -80,10 +51,12 @@
80
  height: 100vh;
81
  }
82
 
83
- /* Make the Gradio HTML component container full viewport */
84
  .gradio-container .gr-html,
85
  [data-testid="html"],
86
- .gradio-container > .gr-box:has(> #custom-app-root) {
 
 
87
  display: block !important;
88
  visibility: visible !important;
89
  position: relative !important;
@@ -98,24 +71,40 @@
98
  background: transparent !important;
99
  }
100
 
101
- /* Fallback: show any element that contains our app root */
102
- .gradio-container > *:has(#custom-app-root) {
103
- display: block !important;
104
- visibility: visible !important;
105
- width: 100% !important;
106
- height: 100vh !important;
 
 
 
 
 
 
 
107
  padding: 0 !important;
108
  margin: 0 !important;
109
  overflow: hidden !important;
 
 
110
  }
111
 
112
- /* Make body and html fill viewport */
113
- html, body {
114
- margin: 0 !important;
115
- padding: 0 !important;
 
 
 
 
 
 
 
116
  overflow: hidden !important;
117
- height: 100vh !important;
118
- width: 100vw !important;
119
  }
120
 
121
  /* ── CSS Variables ────────────────────────────────────────────────────── */
@@ -1498,11 +1487,6 @@ input[type="password"]:focus {
1498
  .sidebar-right.collapsed {
1499
  transform: translateX(100%);
1500
  }
1501
-
1502
- /* When settings are open, we can optionally squeeze the workspace */
1503
- .app-container:not(.settings-collapsed) .main-workspace {
1504
- /* Only apply if you want layout shifting. Slicing over is cleaner! */
1505
- }
1506
  }
1507
 
1508
  /* Mobile: Left sidebar becomes an overlay */
 
1
  /* DeepSeek V4 Flash Ultra-Minimalist & Mobile-Friendly Style Sheet */
2
 
3
+ /* ── Targeted Gradio overrides ─────────────────────────────────────── */
4
+ /*
5
+ Strategy: Hide Gradio's chrome but NEVER hide our #custom-app-root.
6
+ We use specific selectors instead of blanket .component-N hiding.
7
+ */
8
+
9
+ /* 1. Hide Gradio's top header bar */
10
+ .gradio-container > .header,
11
+ .gradio-container header:not(:has(#custom-app-root)),
12
+ #gradio-header,
13
+ .gr-header {
14
+ display: none !important;
15
+ }
16
+
17
+ /* 2. Reset Gradio container to full viewport - no max-width, no padding */
18
  .gradio-container,
 
19
  .gr-app,
20
  .main,
21
+ .wrap {
 
 
 
 
 
22
  max-width: 100% !important;
23
  padding: 0 !important;
24
  margin: 0 !important;
25
  background: transparent !important;
26
  border: none !important;
27
  box-shadow: none !important;
 
28
  }
29
 
30
+ /* 3. Make body and html fill viewport */
31
+ html, body {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  margin: 0 !important;
33
+ padding: 0 !important;
34
  overflow: hidden !important;
35
+ height: 100vh !important;
36
+ width: 100vw !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  }
38
 
39
+ /* 4. Ensure our custom app root is the ONLY visible thing at full viewport */
40
  #custom-app-root {
41
  display: block !important;
42
  visibility: visible !important;
 
51
  height: 100vh;
52
  }
53
 
54
+ /* 5. Make the Gradio HTML component container that wraps our app full viewport */
55
  .gradio-container .gr-html,
56
  [data-testid="html"],
57
+ .gradio-container > .gr-box:has(> #custom-app-root),
58
+ .gradio-container > *:has(#custom-app-root),
59
+ .gradio-container > *:has(> #custom-app-root) {
60
  display: block !important;
61
  visibility: visible !important;
62
  position: relative !important;
 
71
  background: transparent !important;
72
  }
73
 
74
+ /* 6. Hide ALL Gradio-generated components that are NOT our HTML block.
75
+ These are the hidden Textbox/Button components used for API endpoints.
76
+ Since they have visible=False, Gradio already hides them, but we add
77
+ extra protection for any wrappers. We DO NOT use .component-N selectors
78
+ because those are unstable and can accidentally hide our content. */
79
+
80
+ /* Hide any Gradio form/gap elements that are not our content */
81
+ .gradio-container .form:has(> [data-testid="textbox"]),
82
+ .gradio-container .form:has(> [data-testid="button"]),
83
+ .gradio-container .gap {
84
+ display: none !important;
85
+ height: 0 !important;
86
+ min-height: 0 !important;
87
  padding: 0 !important;
88
  margin: 0 !important;
89
  overflow: hidden !important;
90
+ position: absolute !important;
91
+ pointer-events: none !important;
92
  }
93
 
94
+ /* Hide the Gradio LoginButton link if it exists */
95
+ .gradio-container a[href*="login"]:not(:has(#custom-app-root)),
96
+ .gradio-container button[class*="login"]:not(:has(#custom-app-root)),
97
+ .gradio-container [data-testid="login-button"]:not(:has(#custom-app-root)),
98
+ .gradio-container .login-btn:not(:has(#custom-app-root)) {
99
+ display: none !important;
100
+ position: absolute !important;
101
+ left: -9999px !important;
102
+ top: -9999px !important;
103
+ width: 0 !important;
104
+ height: 0 !important;
105
  overflow: hidden !important;
106
+ opacity: 0 !important;
107
+ pointer-events: none !important;
108
  }
109
 
110
  /* ── CSS Variables ────────────────────────────────────────────────────── */
 
1487
  .sidebar-right.collapsed {
1488
  transform: translateX(100%);
1489
  }
 
 
 
 
 
1490
  }
1491
 
1492
  /* Mobile: Left sidebar becomes an overlay */