Test css
Browse files- app.py +3 -5
- src/display/css_html_js.py +189 -92
app.py
CHANGED
|
@@ -76,11 +76,9 @@ def init_leaderboard(dataframe, benchmark_type):
|
|
| 76 |
demo = gr.Blocks(css=custom_css)
|
| 77 |
with demo:
|
| 78 |
gr.HTML(f"""
|
| 79 |
-
<div style="text-align:center; margin-
|
| 80 |
-
<h1 style="margin-bottom:0;">{TITLE}</h1>
|
| 81 |
-
<p style="color
|
| 82 |
-
Performance Insights & Comparison
|
| 83 |
-
</p>
|
| 84 |
</div>
|
| 85 |
""")
|
| 86 |
# gr.HTML(TITLE)
|
|
|
|
| 76 |
demo = gr.Blocks(css=custom_css)
|
| 77 |
with demo:
|
| 78 |
gr.HTML(f"""
|
| 79 |
+
<div style="text-align:center; margin-bottom:1rem;">
|
| 80 |
+
<h1 style="margin-bottom: 0.25rem;">{TITLE}</h1>
|
| 81 |
+
<p style="color:#eb088a; margin:0; font-size:1.2rem;">Performance Insights & Comparison</p>
|
|
|
|
|
|
|
| 82 |
</div>
|
| 83 |
""")
|
| 84 |
# gr.HTML(TITLE)
|
src/display/css_html_js.py
CHANGED
|
@@ -1,124 +1,221 @@
|
|
| 1 |
-
custom_css = """
|
| 2 |
|
| 3 |
-
.markdown-text {
|
| 4 |
-
|
| 5 |
-
}
|
| 6 |
|
| 7 |
-
#models-to-add-text {
|
| 8 |
-
|
| 9 |
-
}
|
| 10 |
|
| 11 |
-
#citation-button span {
|
| 12 |
-
|
| 13 |
-
}
|
| 14 |
|
| 15 |
-
#citation-button textarea {
|
| 16 |
-
|
| 17 |
-
}
|
| 18 |
|
| 19 |
-
#citation-button > label > button {
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
}
|
| 23 |
|
| 24 |
-
#leaderboard-table {
|
| 25 |
-
|
| 26 |
-
}
|
| 27 |
|
| 28 |
-
#leaderboard-table-lite {
|
| 29 |
-
|
| 30 |
-
}
|
| 31 |
|
| 32 |
-
#search-bar-table-box > div:first-child {
|
| 33 |
-
|
| 34 |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 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
#
|
| 87 |
-
|
| 88 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
}
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
|
|
|
|
|
|
|
|
|
| 93 |
}
|
| 94 |
-
|
| 95 |
-
|
|
|
|
| 96 |
}
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
font-family: Roboto, sans-serif;
|
| 100 |
-
background-color: #ffffff;
|
| 101 |
-
color: #000000; /* main text color */
|
| 102 |
-
margin: 0;
|
| 103 |
-
padding: 0;
|
| 104 |
}
|
| 105 |
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
font-weight: 600;
|
| 109 |
margin-bottom: 1rem;
|
|
|
|
| 110 |
}
|
| 111 |
-
|
| 112 |
-
/* Example ‘intro-block’ styling if you want extra flair */
|
| 113 |
-
.intro-block {
|
| 114 |
-
background-color: #eb088a10; /* light tinted background */
|
| 115 |
-
padding: 1.5rem;
|
| 116 |
-
border-radius: 10px;
|
| 117 |
-
margin-bottom: 2rem;
|
| 118 |
-
}
|
| 119 |
-
|
| 120 |
"""
|
| 121 |
|
|
|
|
| 122 |
get_window_url_params = """
|
| 123 |
function(url_params) {
|
| 124 |
const params = new URLSearchParams(window.location.search);
|
|
|
|
| 1 |
+
# custom_css = """
|
| 2 |
|
| 3 |
+
# .markdown-text {
|
| 4 |
+
# font-size: 16px !important;
|
| 5 |
+
# }
|
| 6 |
|
| 7 |
+
# #models-to-add-text {
|
| 8 |
+
# font-size: 18px !important;
|
| 9 |
+
# }
|
| 10 |
|
| 11 |
+
# #citation-button span {
|
| 12 |
+
# font-size: 16px !important;
|
| 13 |
+
# }
|
| 14 |
|
| 15 |
+
# #citation-button textarea {
|
| 16 |
+
# font-size: 16px !important;
|
| 17 |
+
# }
|
| 18 |
|
| 19 |
+
# #citation-button > label > button {
|
| 20 |
+
# margin: 6px;
|
| 21 |
+
# transform: scale(1.3);
|
| 22 |
+
# }
|
| 23 |
|
| 24 |
+
# #leaderboard-table {
|
| 25 |
+
# margin-top: 15px
|
| 26 |
+
# }
|
| 27 |
|
| 28 |
+
# #leaderboard-table-lite {
|
| 29 |
+
# margin-top: 15px
|
| 30 |
+
# }
|
| 31 |
|
| 32 |
+
# #search-bar-table-box > div:first-child {
|
| 33 |
+
# background: none;
|
| 34 |
+
# border: none;
|
| 35 |
+
# }
|
| 36 |
|
| 37 |
+
# #search-bar {
|
| 38 |
+
# padding: 0px;
|
| 39 |
+
# }
|
| 40 |
+
|
| 41 |
+
# /* Limit the width of the first AutoEvalColumn so that names don't expand too much */
|
| 42 |
+
# #leaderboard-table td:nth-child(2),
|
| 43 |
+
# #leaderboard-table th:nth-child(2) {
|
| 44 |
+
# max-width: 400px;
|
| 45 |
+
# overflow: auto;
|
| 46 |
+
# white-space: nowrap;
|
| 47 |
+
# }
|
| 48 |
+
|
| 49 |
+
# .tab-buttons button {
|
| 50 |
+
# font-size: 20px;
|
| 51 |
+
# }
|
| 52 |
+
|
| 53 |
+
# #scale-logo {
|
| 54 |
+
# border-style: none !important;
|
| 55 |
+
# box-shadow: none;
|
| 56 |
+
# display: block;
|
| 57 |
+
# margin-left: auto;
|
| 58 |
+
# margin-right: auto;
|
| 59 |
+
# max-width: 600px;
|
| 60 |
+
# }
|
| 61 |
+
|
| 62 |
+
# #scale-logo .download {
|
| 63 |
+
# display: none;
|
| 64 |
+
# }
|
| 65 |
+
# #filter_type{
|
| 66 |
+
# border: 0;
|
| 67 |
+
# padding-left: 0;
|
| 68 |
+
# padding-top: 0;
|
| 69 |
+
# }
|
| 70 |
+
# #filter_type label {
|
| 71 |
+
# display: flex;
|
| 72 |
+
# }
|
| 73 |
+
# #filter_type label > span{
|
| 74 |
+
# margin-top: var(--spacing-lg);
|
| 75 |
+
# margin-right: 0.5em;
|
| 76 |
+
# }
|
| 77 |
+
# #filter_type label > .wrap{
|
| 78 |
+
# width: 103px;
|
| 79 |
+
# }
|
| 80 |
+
# #filter_type label > .wrap .wrap-inner{
|
| 81 |
+
# padding: 2px;
|
| 82 |
+
# }
|
| 83 |
+
# #filter_type label > .wrap .wrap-inner input{
|
| 84 |
+
# width: 1px
|
| 85 |
+
# }
|
| 86 |
+
# #filter-columns-type{
|
| 87 |
+
# border:0;
|
| 88 |
+
# padding:0.5;
|
| 89 |
+
# }
|
| 90 |
+
# #filter-columns-size{
|
| 91 |
+
# border:0;
|
| 92 |
+
# padding:0.5;
|
| 93 |
+
# }
|
| 94 |
+
# #box-filter > .form{
|
| 95 |
+
# border: 0
|
| 96 |
+
# }
|
| 97 |
+
|
| 98 |
+
# body, .gradio-container {
|
| 99 |
+
# font-family: Roboto, sans-serif;
|
| 100 |
+
# background-color: #ffffff;
|
| 101 |
+
# color: #000000; /* main text color */
|
| 102 |
+
# margin: 0;
|
| 103 |
+
# padding: 0;
|
| 104 |
+
# }
|
| 105 |
+
|
| 106 |
+
# h1, h2, h3, h4, h5, h6 {
|
| 107 |
+
# color: #eb088a; /* your brand color for headings */
|
| 108 |
+
# font-weight: 600;
|
| 109 |
+
# margin-bottom: 1rem;
|
| 110 |
+
# }
|
| 111 |
+
|
| 112 |
+
# /* Example ‘intro-block’ styling if you want extra flair */
|
| 113 |
+
# .intro-block {
|
| 114 |
+
# background-color: #eb088a10; /* light tinted background */
|
| 115 |
+
# padding: 1.5rem;
|
| 116 |
+
# border-radius: 10px;
|
| 117 |
+
# margin-bottom: 2rem;
|
| 118 |
+
# }
|
| 119 |
+
|
| 120 |
+
# """
|
| 121 |
|
| 122 |
+
custom_css = """
|
| 123 |
+
/* 1) Load Karbon Font: Make sure this points to your actual font files */
|
| 124 |
+
@font-face {
|
| 125 |
+
font-family: 'Karbon';
|
| 126 |
+
src: url('path/to/Karbon.woff2') format('woff2'),
|
| 127 |
+
url('path/to/Karbon.woff') format('woff');
|
| 128 |
+
font-weight: normal;
|
| 129 |
+
font-style: normal;
|
| 130 |
}
|
| 131 |
|
| 132 |
+
/* 2) Global Container */
|
| 133 |
+
body, .gradio-container {
|
| 134 |
+
font-family: 'Karbon', sans-serif;
|
| 135 |
+
margin: 0;
|
| 136 |
+
padding: 0;
|
| 137 |
+
background-color: #fafafa; /* Light background */
|
| 138 |
+
color: #000000;
|
| 139 |
}
|
| 140 |
|
| 141 |
+
.gradio-container {
|
| 142 |
+
max-width: 1200px;
|
| 143 |
+
margin: 0 auto;
|
| 144 |
+
padding: 2rem 1rem;
|
|
|
|
|
|
|
|
|
|
| 145 |
}
|
| 146 |
|
| 147 |
+
/* 3) Headings, with brand color #eb088a */
|
| 148 |
+
h1, h2, h3, h4, h5, h6 {
|
| 149 |
+
color: #eb088a;
|
| 150 |
+
margin-bottom: 1rem;
|
| 151 |
+
font-weight: 600;
|
| 152 |
}
|
| 153 |
+
|
| 154 |
+
/* 4) Intro Block for a slight highlight */
|
| 155 |
+
.intro-block {
|
| 156 |
+
background-color: #ffe2f1; /* lighter tint of #eb088a */
|
| 157 |
+
padding: 1.5rem;
|
| 158 |
+
border-radius: 8px;
|
| 159 |
+
border: 1px solid #f8badb;
|
| 160 |
+
margin-bottom: 2rem;
|
| 161 |
}
|
| 162 |
+
|
| 163 |
+
/* 5) Tab styling - remove default orange styling */
|
| 164 |
+
.tab-buttons {
|
| 165 |
+
margin-top: 1rem;
|
| 166 |
+
margin-bottom: 1rem;
|
| 167 |
display: flex;
|
| 168 |
}
|
| 169 |
+
.tab-buttons > .tabitem {
|
| 170 |
+
padding: 0.6rem 1.2rem;
|
| 171 |
+
background-color: #ffffff;
|
| 172 |
+
border: 1px solid #eb088a;
|
| 173 |
+
border-radius: 6px;
|
| 174 |
+
color: #eb088a;
|
| 175 |
+
margin-right: 5px;
|
| 176 |
+
cursor: pointer;
|
| 177 |
+
transition: background-color 0.2s ease, color 0.2s ease;
|
| 178 |
+
font-weight: 500;
|
| 179 |
+
}
|
| 180 |
+
.tab-buttons > .tabitem.selected {
|
| 181 |
+
background-color: #eb088a;
|
| 182 |
+
color: #ffffff;
|
| 183 |
+
}
|
| 184 |
+
.tab-buttons > .tabitem:hover {
|
| 185 |
+
background-color: #eb088a;
|
| 186 |
+
color: #ffffff;
|
| 187 |
+
}
|
| 188 |
+
|
| 189 |
+
/* 6) Dataframe Styling */
|
| 190 |
+
.gr-dataframe table {
|
| 191 |
+
width: 100%;
|
| 192 |
+
border-collapse: collapse;
|
| 193 |
+
border: 1px solid #cccccc;
|
| 194 |
+
margin-bottom: 2rem;
|
| 195 |
}
|
| 196 |
+
.gr-dataframe th {
|
| 197 |
+
background-color: #eb088a;
|
| 198 |
+
color: #ffffff;
|
| 199 |
+
padding: 0.6rem;
|
| 200 |
+
text-align: left;
|
| 201 |
+
font-weight: 600;
|
| 202 |
}
|
| 203 |
+
.gr-dataframe td {
|
| 204 |
+
padding: 0.6rem;
|
| 205 |
+
border-bottom: 1px solid #e0e0e0;
|
| 206 |
}
|
| 207 |
+
.gr-dataframe tr:nth-child(even) {
|
| 208 |
+
background-color: #fdfdfd;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 209 |
}
|
| 210 |
|
| 211 |
+
/* 7) Make default markdown text nice */
|
| 212 |
+
.markdown-text p {
|
|
|
|
| 213 |
margin-bottom: 1rem;
|
| 214 |
+
line-height: 1.6;
|
| 215 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 216 |
"""
|
| 217 |
|
| 218 |
+
|
| 219 |
get_window_url_params = """
|
| 220 |
function(url_params) {
|
| 221 |
const params = new URLSearchParams(window.location.search);
|