abir-hr196 commited on
Commit
3739861
·
1 Parent(s): f8b5cfa
Files changed (2) hide show
  1. app.py +41 -53
  2. tinysql_model_demo.py +5 -1
app.py CHANGED
@@ -3,16 +3,42 @@ from tinysql_dataset_viewer import dataset_viewer
3
  import gradio as gr
4
 
5
  custom_css = """
6
- /* Force everything dark */
7
- .gradio-container {
8
- background: #0A0A0A !important;
 
9
  }
10
 
11
- /* Tabs - black background, bigger bold text */
12
- .tabs {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  background: #0A0A0A !important;
14
  }
15
 
 
16
  .tab-nav {
17
  background: #0A0A0A !important;
18
  border: none !important;
@@ -39,18 +65,10 @@ label > span {
39
  font-weight: 700 !important;
40
  }
41
 
42
- /* Force white text everywhere */
43
- * {
44
- color: #E0E0E0 !important;
45
- }
46
-
47
- h1, h2, h3, h4, h5, h6 {
48
- color: #E0E0E0 !important;
49
- }
50
-
51
  /* Orange buttons */
52
- .primary {
53
  background: #FF6B4A !important;
 
54
  }
55
 
56
  /* Orange sliders */
@@ -62,52 +80,22 @@ input[type="range"]::-moz-range-thumb {
62
  background: #FF6B4A !important;
63
  }
64
 
65
- /* Force dark inputs and dropdowns */
66
- input, textarea, select {
67
- background: #1A1A1A !important;
68
- color: #E0E0E0 !important;
69
- border: 1px solid #3A3A3A !important;
70
- }
71
-
72
- /* Force dark table/dataframe */
73
- .dataframe, .table-wrap, table {
74
  background: #1A1A1A !important;
75
  }
76
 
77
- .dataframe td, .dataframe th, table td, table th {
78
- background: #1A1A1A !important;
79
- color: #E0E0E0 !important;
80
- border-color: #3A3A3A !important;
81
  }
82
 
83
- /* Dropdown menu */
84
- .dropdown-menu {
85
  background: #1A1A1A !important;
86
  }
87
 
88
- .dropdown-menu option {
89
- background: #1A1A1A !important;
90
- color: #E0E0E0 !important;
91
- }
92
-
93
- /* Number input wrapper */
94
- .number-input, .textbox {
95
- background: #1A1A1A !important;
96
- }
97
-
98
- /* Force all white boxes to be dark */
99
- .block, .form, .input-wrap, .wrap {
100
- background: #0A0A0A !important;
101
- }
102
-
103
- /* Code editor backgrounds */
104
- .cm-editor, .cm-scroller, .code-wrap {
105
- background: #1A1A1A !important;
106
- }
107
-
108
- /* Slider number displays */
109
- .slider-number {
110
- background: #1A1A1A !important;
111
  }
112
  """
113
 
 
3
  import gradio as gr
4
 
5
  custom_css = """
6
+ /* NUCLEAR OPTION - Force EVERYTHING dark */
7
+ *, *::before, *::after {
8
+ background-color: #0A0A0A !important;
9
+ color: #E0E0E0 !important;
10
  }
11
 
12
+ /* Override for specific dark elements that should stay darker */
13
+ input, textarea, select, table, .dataframe,
14
+ table td, table th, .dataframe td, .dataframe th {
15
+ background-color: #1A1A1A !important;
16
+ color: #E0E0E0 !important;
17
+ }
18
+
19
+ /* Table cells should NOT have nested black backgrounds */
20
+ table td *, table th *, .dataframe td *, .dataframe th * {
21
+ background-color: transparent !important;
22
+ }
23
+
24
+ /* Gray gradient boxes should keep their backgrounds */
25
+ [style*="background: linear-gradient"],
26
+ [style*="background: #2A2A2A"],
27
+ [style*="background: #3A3A3A"],
28
+ [style*="background: #4A4A4A"] {
29
+ background: inherit !important;
30
+ }
31
+
32
+ /* Text inside styled boxes should have transparent backgrounds */
33
+ [style*="background"] * {
34
+ background-color: transparent !important;
35
+ }
36
+
37
+ .gradio-container {
38
  background: #0A0A0A !important;
39
  }
40
 
41
+ /* Tabs - black background, bigger bold text */
42
  .tab-nav {
43
  background: #0A0A0A !important;
44
  border: none !important;
 
65
  font-weight: 700 !important;
66
  }
67
 
 
 
 
 
 
 
 
 
 
68
  /* Orange buttons */
69
+ .primary, button.primary {
70
  background: #FF6B4A !important;
71
+ color: white !important;
72
  }
73
 
74
  /* Orange sliders */
 
80
  background: #FF6B4A !important;
81
  }
82
 
83
+ /* Code blocks stay dark gray with transparent text containers */
84
+ pre, code, .code {
 
 
 
 
 
 
 
85
  background: #1A1A1A !important;
86
  }
87
 
88
+ pre *, code *, .code * {
89
+ background-color: transparent !important;
 
 
90
  }
91
 
92
+ /* Line numbers in code should be transparent */
93
+ .cm-lineNumbers, .cm-gutters {
94
  background: #1A1A1A !important;
95
  }
96
 
97
+ .cm-line {
98
+ background: transparent !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  }
100
  """
101
 
tinysql_model_demo.py CHANGED
@@ -123,7 +123,11 @@ def model_demo(shared_instruction, shared_schema):
123
  schema = gr.Code(
124
  label="Database Schema (SQL)",
125
  language="sql",
126
- value="CREATE TABLE employees (\n name VARCHAR(100),\n salary INT,\n department VARCHAR(100)\n);",
 
 
 
 
127
  lines=6
128
  )
129
 
 
123
  schema = gr.Code(
124
  label="Database Schema (SQL)",
125
  language="sql",
126
+ value="""CREATE TABLE employees (
127
+ name VARCHAR(100),
128
+ salary INT,
129
+ department VARCHAR(100)
130
+ );""",
131
  lines=6
132
  )
133