Spaces:
Running on Zero
Running on Zero
| /* Phone / narrow layout skin — activated when html[data-ui-skin="phone"] | |
| Desktop shell is removed from the DOM by boot.js so IDs stay unique. */ | |
| /* Do not lock zoom: avoid touch-action/manipulation globals and maximum-scale tricks. | |
| overflow-x only on shell, not html — html overflow can interfere with pinch-zoom on some browsers. */ | |
| html[data-ui-skin="phone"] .gradio-container { | |
| overflow-x: clip; | |
| } | |
| html[data-ui-skin="phone"] body { | |
| /* allow page zoom; keep horizontal spill contained without trapping gestures */ | |
| overflow-x: visible; | |
| } | |
| html[data-ui-skin="phone"] .app-shell-phone, | |
| html[data-ui-skin="phone"] #skin-phone .app-shell { | |
| margin: 0 ; | |
| max-width: none ; | |
| border-radius: 0 ; | |
| border-left: none ; | |
| border-right: none ; | |
| min-height: 100dvh; | |
| } | |
| /* App chrome header (logo/GitHub) is omitted from shell_phone.html */ | |
| /* Single-column stack */ | |
| html[data-ui-skin="phone"] .phone-stack { | |
| display: flex; | |
| flex-direction: column; | |
| width: 100%; | |
| min-width: 0; | |
| /* clear fixed Edit bar so last fields stay reachable */ | |
| padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); | |
| } | |
| html[data-ui-skin="phone"] .phone-block { | |
| width: 100%; | |
| box-sizing: border-box; | |
| border-bottom: 1px solid #27272a; | |
| background: #18181b; | |
| } | |
| /* Upload: toolbar as section header + full-height gallery */ | |
| html[data-ui-skin="phone"] .phone-upload .app-toolbar { | |
| width: 100% ; | |
| max-width: 100% ; | |
| flex: none ; | |
| padding: 8px 12px ; | |
| border-right: none ; | |
| border-bottom: 1px solid #27272a; | |
| display: flex; | |
| flex-direction: column; | |
| gap: 6px; | |
| box-sizing: border-box; | |
| } | |
| /* Keep upload block size; only shrink the empty-state placeholder so it doesn’t scroll inside */ | |
| html[data-ui-skin="phone"] .phone-upload #gallery-drop-zone { | |
| width: 100% ; | |
| min-height: 168px ; | |
| height: min(38vw, 220px) ; | |
| max-height: 240px ; | |
| aspect-ratio: auto ; | |
| position: relative; | |
| background: #09090b; | |
| overflow: hidden ; | |
| } | |
| /* Placeholder scale ~midway between full desktop and the previous tiny 0.52 */ | |
| html[data-ui-skin="phone"] .phone-upload #gallery-drop-zone .upload-prompt-modern { | |
| transform: translate(-50%, -50%) scale(0.72); | |
| transform-origin: center center; | |
| max-width: 92%; | |
| pointer-events: none; | |
| } | |
| html[data-ui-skin="phone"] .phone-upload #gallery-drop-zone .upload-click-area { | |
| pointer-events: auto; | |
| padding: 12px 16px ; | |
| gap: 4px; | |
| border-radius: 12px; | |
| } | |
| html[data-ui-skin="phone"] .phone-upload #gallery-drop-zone .upload-click-area svg { | |
| width: 56px ; | |
| height: 56px ; | |
| } | |
| html[data-ui-skin="phone"] .phone-upload #gallery-drop-zone .upload-main-text { | |
| font-size: 13px ; | |
| margin-top: 4px ; | |
| } | |
| html[data-ui-skin="phone"] .phone-upload #gallery-drop-zone .upload-sub-text { | |
| font-size: 11px ; | |
| max-width: 14rem ; | |
| line-height: 1.35 ; | |
| padding: 0 6px; | |
| } | |
| /* Gallery with images: allow internal scroll without changing the outer block size */ | |
| html[data-ui-skin="phone"] .phone-upload #gallery-drop-zone:has(.image-gallery-grid[style*="display: grid"]), | |
| html[data-ui-skin="phone"] .phone-upload #gallery-drop-zone:has(.image-gallery-grid:not([style*="display: none"])) { | |
| overflow: auto ; | |
| } | |
| /* Output right after upload */ | |
| html[data-ui-skin="phone"] .phone-output .output-toolbar { | |
| width: 100% ; | |
| max-width: 100% ; | |
| flex: none ; | |
| padding: 8px 12px ; | |
| border-bottom: 1px solid #27272a; | |
| display: flex; | |
| align-items: center; | |
| justify-content: space-between; | |
| box-sizing: border-box; | |
| } | |
| /* Same footprint as upload block for side-by-side compare when scrolling */ | |
| html[data-ui-skin="phone"] .phone-output .output-frame { | |
| width: 100% ; | |
| flex: none ; | |
| min-height: 168px ; | |
| height: min(38vw, 220px) ; | |
| max-height: 240px ; | |
| aspect-ratio: auto ; | |
| display: flex; | |
| flex-direction: column; | |
| background: #09090b; | |
| overflow: hidden; | |
| } | |
| html[data-ui-skin="phone"] .phone-output .output-frame .out-body { | |
| flex: 1 1 auto; | |
| min-height: 0; | |
| height: 100%; | |
| position: relative; | |
| display: flex; | |
| align-items: center; | |
| justify-content: center; | |
| } | |
| html[data-ui-skin="phone"] .phone-output .out-body img, | |
| html[data-ui-skin="phone"] .phone-output .modern-out-img { | |
| max-width: 100%; | |
| max-height: 100%; | |
| width: auto; | |
| height: auto; | |
| object-fit: contain; | |
| } | |
| /* Quick prompts — whole block capped; open panels scroll inside so N open tables | |
| don’t keep growing the page past the fixed Edit bar */ | |
| html[data-ui-skin="phone"] .phone-prompts { | |
| max-height: min(42vh, 320px); | |
| display: flex; | |
| flex-direction: column; | |
| min-height: 0; | |
| overflow-x: hidden; | |
| overflow-y: auto; | |
| -webkit-overflow-scrolling: touch; | |
| } | |
| html[data-ui-skin="phone"] .phone-prompts .prompts-toolbar { | |
| width: 100%; | |
| padding: 8px 12px; | |
| box-sizing: border-box; | |
| flex: 0 0 auto; | |
| position: sticky; | |
| top: 0; | |
| z-index: 2; | |
| background: #18181b; | |
| } | |
| html[data-ui-skin="phone"] .phone-prompts .chip-panel { | |
| width: 100%; | |
| border-top: 1px solid #27272a; | |
| flex: 0 0 auto; | |
| } | |
| html[data-ui-skin="phone"] .phone-prompts .chip-panel-body { | |
| max-height: min(22vh, 160px); | |
| overflow-y: auto; | |
| -webkit-overflow-scrolling: touch; | |
| overscroll-behavior: contain; | |
| } | |
| /* Prompt — 16px inputs reduce iOS focus zoom */ | |
| html[data-ui-skin="phone"] .phone-prompt .panel-card { | |
| border: none ; | |
| background: transparent ; | |
| } | |
| html[data-ui-skin="phone"] .phone-prompt .panel-card-body { | |
| padding: 12px 14px ; | |
| } | |
| html[data-ui-skin="phone"] .phone-prompt .modern-textarea { | |
| min-height: 110px; | |
| font-size: 16px ; | |
| } | |
| /* Menus: pack + aspect + size */ | |
| html[data-ui-skin="phone"] .phone-menus { | |
| padding: 0 0 4px; | |
| } | |
| html[data-ui-skin="phone"] .phone-menus .prompt-pack-menu, | |
| html[data-ui-skin="phone"] .phone-menus .lora-selector-card { | |
| border: none ; | |
| border-bottom: 1px solid #27272a ; | |
| background: transparent ; | |
| margin: 0 ; | |
| } | |
| html[data-ui-skin="phone"] .phone-menus .prompt-pack-menu, | |
| html[data-ui-skin="phone"] .phone-menus .lora-selector-body { | |
| padding: 12px 14px ; | |
| } | |
| html[data-ui-skin="phone"] .phone-menus .lora-native-select, | |
| html[data-ui-skin="phone"] .phone-lora .lora-native-select { | |
| font-size: 16px ; /* iOS zoom guard */ | |
| } | |
| /* LoRA */ | |
| html[data-ui-skin="phone"] .phone-lora { | |
| padding: 12px 14px 16px; | |
| } | |
| html[data-ui-skin="phone"] .phone-lora .left-stack { | |
| border-top: none; | |
| padding: 0; | |
| } | |
| /* Demos hidden until a LoRA is selected (class toggled in lora_demo.js) */ | |
| html[data-ui-skin="phone"]:not(.has-lora-selected) #lora-demo-row, | |
| html[data-ui-skin="phone"]:not(.has-lora-selected) #lora-demo-status, | |
| html[data-ui-skin="phone"]:not(.has-lora-selected) .lora-demo-caption { | |
| display: none ; | |
| } | |
| /* Advanced + run */ | |
| html[data-ui-skin="phone"] .phone-advanced .settings-group { | |
| border: none ; | |
| border-radius: 0 ; | |
| margin: 0 ; | |
| } | |
| /* | |
| * Fixed Edit bar. On HF, transform/filter on Gradio ancestors break position:fixed | |
| * (bar sticks to a nested box, not the screen). boot.js ports .phone-run to | |
| * document.body (.phone-run--ported) so fixed = real viewport — same as embeds. | |
| */ | |
| html[data-ui-skin="phone"] .phone-run, | |
| html[data-ui-skin="phone"] body > .phone-run, | |
| body > .phone-run.phone-run--ported { | |
| position: fixed ; | |
| left: 0 ; | |
| right: 0 ; | |
| bottom: 0 ; | |
| top: auto ; | |
| z-index: 2147483000 ; /* above typical HF/Gradio chrome */ | |
| width: 100% ; | |
| max-width: 100vw ; | |
| box-sizing: border-box ; | |
| padding: 10px 14px ; | |
| margin: 0 ; | |
| background: rgba(24, 24, 27, 0.97) ; | |
| border-top: 1px solid #27272a ; | |
| box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.5) ; | |
| transform: none ; | |
| filter: none ; | |
| contain: none ; | |
| } | |
| html[data-ui-skin="phone"] .phone-run .run-btn-wrap { | |
| padding: 0 ; | |
| } | |
| html[data-ui-skin="phone"] .phone-run .btn-run { | |
| width: 100%; | |
| min-height: 48px; | |
| font-size: 15px; | |
| } | |
| html[data-ui-skin="phone"] .phone-footer { | |
| padding-bottom: 8px; | |
| } | |
| html[data-ui-skin="phone"] .phone-footer .exp-note { | |
| padding: 10px 14px; | |
| font-size: 11px; | |
| } | |
| html[data-ui-skin="phone"] .phone-footer .app-statusbar { | |
| padding: 6px 12px; | |
| height: auto; | |
| min-height: 34px; | |
| flex-wrap: wrap; | |
| } | |
| @supports (padding: env(safe-area-inset-bottom)) { | |
| html[data-ui-skin="phone"] .phone-run, | |
| html[data-ui-skin="phone"] body > .phone-run, | |
| body > .phone-run.phone-run--ported { | |
| padding-bottom: calc(10px + env(safe-area-inset-bottom)) ; | |
| } | |
| } | |
| /* Hide unused skin before boot removes it (avoid flash of both) */ | |
| #skin-phone[hidden] { display: none ; } | |
| #skin-desktop[hidden] { display: none ; } | |