Spaces:
Running on Zero
Running on Zero
File size: 9,907 Bytes
3c47e57 bc415db 3c47e57 bc415db 3c47e57 bc415db 3c47e57 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 | /* ==========================================================================
Shared look for the Hugging Face Spaces in this folder:
Automatic Drawing, Automatic Writing, Chat Visualiser, Token Visualiser
(the "Inside the Machine" collection).
Canonical copy: shared-ui/brand.css. Edit it there, then run
`python shared-ui/sync.py` to copy it into each project.
- Start page and workspace share the midnight stage colour, in both
light and dark browser modes.
- The workspace's pale mint control panel stays light in both modes.
========================================================================== */
:root {
/* Workspace: the same in light and dark browser modes. */
--brand-stage: #080f18;
--brand-stage-raised: #112530;
--brand-stage-line: #577f89;
--brand-stage-text: #eef3f5;
--brand-stage-caption: #c5e2dd;
--brand-amber: #f4bf67;
--brand-amber-hover: #e7aa45;
--brand-amber-deep: #b77a20;
--brand-on-amber: #17242b;
--brand-mint: #eaf2eff2;
--brand-mint-solid: #eaf2ef;
--brand-mint-surface: #f4f8f6;
--brand-mint-text: #203c3a;
--brand-mint-label: #29433f;
--brand-mint-subdued: #526b68;
--brand-mint-line: #b3c7bd;
--brand-mint-border: #6d9f9b66;
--brand-shadow: 0 12px 50px #0006;
--brand-radius-panel: 18px;
--brand-radius-control: 10px;
--brand-serif: Georgia, 'Times New Roman', serif;
--brand-sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
/* Start page: the same midnight as the workspace stage, in both browser modes. */
--brand-page: #080f18;
--brand-surface: #091622;
--brand-heading: #eef3f5;
--brand-text: #d5e3e6;
--brand-subdued: #a8bdc4;
--brand-eyebrow: #f4bf67;
--brand-link: #f4bf67;
--brand-line: #577f89;
--brand-input: #112530;
--brand-input-hover: #193442;
--brand-focus: #f4bf67;
}
/* ---- Start page --------------------------------------------------------- */
/* Order: eyebrow, title, intro, sign-in + note, model, primary action, note. */
/* .st-key-start_page is Token Visualiser's Streamlit start-page container. */
.brand-start, .st-key-start_page {
box-sizing: border-box;
width: calc(100% - 24px) !important;
max-width: 680px !important;
margin: 7vh auto !important;
padding: 24px !important;
gap: 18px !important;
}
/* Gradio wraps fields in a bordered card; keep the start page flat (label above field),
as in Token Visualiser. */
.brand-start .form { border: 0 !important; background: transparent !important; box-shadow: none !important; }
.brand-start .form > .block {
padding: 0 !important;
border: 0 !important;
background: transparent !important;
box-shadow: none !important;
}
.brand-start .form > .block [data-testid="block-info"] {
padding-left: 0 !important;
padding-right: 0 !important;
font-weight: 600;
color: var(--brand-text) !important;
}
/* Gradio pads HTML blocks; align the title with the controls below it. */
.brand-start .html-container { padding-left: 0 !important; padding-right: 0 !important; }
.brand-header { padding: 12px 0 6px; }
.eyebrow {
font: 600 11px/1.5 var(--brand-sans);
letter-spacing: .18em;
text-transform: uppercase;
color: var(--brand-eyebrow) !important;
}
.brand-title {
margin: 14px 0 18px !important;
padding: 0 !important;
border: 0 !important;
font: 400 clamp(38px, 6vw, 62px)/1.06 var(--brand-serif) !important;
letter-spacing: -.04em !important;
color: var(--brand-heading) !important;
}
.title-stop { color: var(--brand-amber) !important; }
.brand-intro {
margin: 0 0 12px !important;
font: 16px/1.7 var(--brand-sans) !important;
color: var(--brand-text) !important;
}
.brand-note, .brand-note p, .brand-note li,
.signin-note, .signin-note p {
margin: 0;
font: 14px/1.6 var(--brand-sans) !important;
color: var(--brand-subdued) !important;
}
.brand-note strong, .signin-note strong { color: var(--brand-text) !important; }
.brand-note a, .signin-note a, .brand-header a { color: var(--brand-link) !important; }
/* .st-key-hf_load_preset is Token Visualiser's "Load model" button. */
.brand-primary, .st-key-hf_load_preset button {
min-height: 48px !important;
border: 0 !important;
border-radius: var(--brand-radius-control) !important;
background: var(--brand-amber) !important;
color: var(--brand-on-amber) !important;
font: 600 16px/1.4 var(--brand-sans) !important;
}
.brand-primary:hover, .st-key-hf_load_preset button:hover { background: var(--brand-amber-hover) !important; }
.brand-primary:focus-visible, .st-key-hf_load_preset button:focus-visible {
outline: 3px solid var(--brand-focus) !important;
outline-offset: 2px;
}
@media (max-width: 640px) {
.brand-start, .st-key-start_page { margin: 3vh auto !important; padding: 18px !important; }
}
/* ---- Workspace ---------------------------------------------------------- */
/* Floating mint panel. A light island: readable in both browser modes. */
.brand-dock {
box-sizing: border-box;
border: 1px solid var(--brand-mint-border) !important;
border-radius: var(--brand-radius-panel) !important;
background: var(--brand-mint) !important;
backdrop-filter: blur(18px);
box-shadow: var(--brand-shadow);
color: var(--brand-mint-text);
color-scheme: light;
/* Start-page tokens revert to their light values inside the panel. */
--brand-heading: #17242b;
--brand-text: #203c3a;
--brand-subdued: #526b68;
--brand-eyebrow: #92601c;
--brand-link: #92601c;
--brand-line: #b3c7bd;
--brand-input: #ffffff;
--brand-input-hover: #f4f8f6;
--brand-focus: #b77a20;
/* Gradio theme variables, so the panel ignores Gradio's dark mode. */
--body-text-color: #203c3a;
--body-text-color-subdued: #526b68;
--block-background-fill: #f4f8f6;
--background-fill-primary: #f4f8f6;
--background-fill-secondary: #e3ece7;
--block-label-background-fill: #f4f8f6;
--block-label-text-color: #29433f;
--block-title-text-color: #203c3a;
--block-title-background-fill: transparent;
--block-title-border-color: transparent;
--block-info-text-color: #526b68;
--block-border-color: #bdcdc5;
--border-color-primary: #b3c7bd;
--input-background-fill: #ffffff;
--input-background-fill-hover: #f4f8f6;
--input-background-fill-focus: #ffffff;
--input-border-color: #b3c7bd;
--input-text-color: #1c3536;
--input-placeholder-color: #526b68;
--accordion-text-color: #203c3a;
--checkbox-background-color: #ffffff;
--checkbox-border-color: #8aa49c;
--checkbox-label-background-fill: #f4f8f6;
--checkbox-label-text-color: #203c3a;
--button-secondary-background-fill: #f4f8f6;
--button-secondary-background-fill-hover: #dce9e1;
--button-secondary-text-color: #203c3a;
--button-secondary-text-color-hover: #17242b;
--button-secondary-border-color: #b3c7bd;
--link-text-color: #725020;
--table-even-background-fill: #ffffff;
--table-odd-background-fill: #f4f8f6;
}
.brand-dock .prose, .brand-dock .prose strong { color: var(--brand-mint-text) !important; }
.brand-dock label, .brand-dock .label-wrap, .brand-dock .label-wrap span {
color: var(--brand-mint-label) !important;
background: transparent !important;
}
.brand-dock input[type="number"], .brand-dock input[type="text"], .brand-dock textarea {
max-width: 100%;
color: #1c3536 !important;
-webkit-text-fill-color: #1c3536 !important;
background: #ffffff !important;
}
.brand-dock .block-info { color: var(--brand-mint-subdued) !important; }
.brand-dock button:focus-visible { outline: 3px solid var(--brand-amber-deep) !important; outline-offset: 2px; }
/* Model and status line at the top left of the stage. */
.brand-caption, .brand-caption .prose, .brand-caption p {
color: var(--brand-stage-caption) !important;
font: 13px/1.5 var(--brand-sans) !important;
}
.brand-caption strong { color: var(--brand-amber) !important; font-weight: 600; }
/* Round "change model" button, bottom right, outside the panel.
Its text stays as the accessible name; the ↺ glyph is drawn instead.
.st-key-clear_model is the Streamlit wrapper of Token Visualiser's button. */
.return-home, .st-key-clear_model button {
position: fixed !important;
right: max(16px, env(safe-area-inset-right));
bottom: max(16px, env(safe-area-inset-bottom));
z-index: 60;
display: flex !important;
align-items: center;
justify-content: center;
box-sizing: border-box;
width: 40px !important;
height: 40px !important;
min-width: 40px !important;
min-height: 40px !important;
padding: 0 !important;
border: 1px solid #86b6b366 !important;
border-radius: 50% !important;
background: #112530ed !important;
color: var(--brand-stage-caption) !important;
font-size: 0 !important;
box-shadow: 0 3px 16px #0004;
cursor: pointer;
}
.return-home::before, .st-key-clear_model button::before {
content: "\21ba";
font: 22px/1 var(--brand-sans);
color: var(--brand-stage-caption);
}
.return-home::after, .st-key-clear_model button::after {
content: var(--brand-return-label, "Change model");
position: absolute;
top: 50%;
right: 50px;
transform: translateY(-50%);
padding: 5px 9px;
border: 1px solid #78949d66;
border-radius: 7px;
background: #07121ff5;
color: #e2edf0;
font: 12px/1.4 var(--brand-sans);
white-space: nowrap;
opacity: 0;
pointer-events: none;
transition: opacity .15s;
}
.return-home:hover, .st-key-clear_model button:hover { background: #23434d !important; }
.return-home:hover::after, .return-home:focus-visible::after,
.st-key-clear_model button:hover::after, .st-key-clear_model button:focus-visible::after { opacity: 1; }
.return-home:focus-visible, .st-key-clear_model button:focus-visible {
outline: 2px solid var(--brand-amber) !important;
outline-offset: 3px;
}
@media (max-width: 640px) {
.return-home, .st-key-clear_model button { right: 12px; bottom: 12px; }
}
/* Gradio's "Use via API · Built with Gradio" footer. */
footer { display: none !important; }
|