openclaw/ui/src/styles/layout.css
Kit 480aa406bb feat(ui): improve mobile responsiveness
- Add @media (max-width: 600px) breakpoint for mobile-specific styles
- Compact header: smaller title, hidden subtitle, minimal status pill
- Horizontal scrollable nav: all items in one row, swipeable
- Hide redundant page titles on mobile
- Hide docs button on mobile (saves space)
- Smaller theme toggle icons
- Tighter spacing on cards, stats, forms
- Better chat layout: full-width session selector, compact compose
- Single-column log entries on small screens

Desktop layout remains unchanged.

Co-authored-by: Carl Ulsoe <34673973+carlulsoe@users.noreply.github.com>
2026-01-09 16:32:55 +01:00

640 lines
11 KiB
CSS

.shell {
--shell-pad: 18px;
--shell-gap: 18px;
--shell-nav-col: minmax(220px, 280px);
--shell-topbar-row: auto;
--shell-focus-duration: 220ms;
--shell-focus-ease: cubic-bezier(0.2, 0.85, 0.25, 1);
min-height: 100vh;
display: grid;
grid-template-columns: var(--shell-nav-col) minmax(0, 1fr);
grid-template-rows: var(--shell-topbar-row) 1fr;
grid-template-areas:
"topbar topbar"
"nav content";
gap: var(--shell-gap);
padding: var(--shell-pad);
animation: dashboard-enter 0.6s ease-out;
transition: padding var(--shell-focus-duration) var(--shell-focus-ease);
}
.shell--chat-focus {
--shell-pad: 8px;
--shell-gap: 0px;
--shell-nav-col: 0px;
--shell-topbar-row: auto;
}
.shell--chat-focus .content {
padding-top: 0;
gap: 0;
}
.topbar {
grid-area: topbar;
position: sticky;
top: var(--shell-pad);
z-index: 20;
display: flex;
justify-content: space-between;
align-items: center;
padding: 16px 20px;
border: 1px solid var(--border);
border-radius: 18px;
background: linear-gradient(135deg, var(--chrome), rgba(255, 255, 255, 0.02));
backdrop-filter: blur(18px);
box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
overflow: hidden;
transform-origin: top center;
transition: opacity var(--shell-focus-duration) var(--shell-focus-ease),
transform var(--shell-focus-duration) var(--shell-focus-ease),
max-height var(--shell-focus-duration) var(--shell-focus-ease),
padding var(--shell-focus-duration) var(--shell-focus-ease),
border-width var(--shell-focus-duration) var(--shell-focus-ease);
max-height: max(0px, var(--topbar-height, 92px));
}
.brand {
display: grid;
gap: 4px;
}
.brand-title {
font-family: var(--font-display);
font-size: 20px;
letter-spacing: 0.6px;
text-transform: uppercase;
}
.brand-sub {
color: var(--muted);
font-size: 12px;
letter-spacing: 1.2px;
text-transform: uppercase;
}
.topbar-status {
display: flex;
align-items: center;
gap: 10px;
}
.nav {
grid-area: nav;
position: sticky;
top: calc(
var(--shell-pad) + var(--topbar-height, 0px) + var(--shell-gap)
);
align-self: start;
max-height: calc(
100vh - var(--topbar-height, 0px) - var(--shell-gap) -
var(--shell-pad) - var(--shell-pad)
);
overflow: auto;
padding: 16px;
border: 1px solid var(--border);
border-radius: 20px;
background: var(--panel);
box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
backdrop-filter: blur(18px);
transform-origin: left center;
transition: opacity var(--shell-focus-duration) var(--shell-focus-ease),
transform var(--shell-focus-duration) var(--shell-focus-ease),
max-width var(--shell-focus-duration) var(--shell-focus-ease),
padding var(--shell-focus-duration) var(--shell-focus-ease),
border-width var(--shell-focus-duration) var(--shell-focus-ease);
max-width: 320px;
}
.shell--chat-focus .nav {
opacity: 0;
transform: translateX(-12px);
max-width: 0px;
padding: 0;
border-width: 0;
overflow: hidden;
pointer-events: none;
}
.nav-group {
margin-bottom: 18px;
display: grid;
gap: 6px;
padding-bottom: 12px;
border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}
.nav-group:last-child {
margin-bottom: 0;
padding-bottom: 0;
border-bottom: none;
}
.nav-label {
font-size: 10px;
text-transform: uppercase;
letter-spacing: 1.6px;
color: var(--muted);
}
.nav-item {
position: relative;
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
padding: 10px 12px 10px 14px;
border-radius: 12px;
border: 1px solid transparent;
background: rgba(255, 255, 255, 0.02);
color: var(--muted);
cursor: pointer;
transition: border-color 160ms ease, background 160ms ease, color 160ms ease,
transform 160ms ease;
}
.nav-item:hover {
color: var(--text);
border-color: rgba(255, 255, 255, 0.12);
background: rgba(255, 255, 255, 0.06);
}
.nav-item::before {
content: "";
position: absolute;
left: 6px;
top: 50%;
width: 4px;
height: 60%;
border-radius: 999px;
transform: translateY(-50%);
background: transparent;
}
.nav-item.active {
color: var(--text);
border-color: rgba(245, 159, 74, 0.45);
background: rgba(245, 159, 74, 0.16);
transform: translateX(2px);
}
.nav-item.active::before {
background: var(--accent);
box-shadow: 0 0 12px rgba(245, 159, 74, 0.4);
}
.content {
grid-area: content;
padding: 8px 6px 20px;
display: flex;
flex-direction: column;
gap: 20px;
min-height: 0;
}
.shell--chat .content {
min-height: calc(
100vh - var(--topbar-height, 0px) - var(--shell-gap) -
var(--shell-pad) - var(--shell-pad)
);
}
.docs-link {
position: fixed;
right: calc(var(--shell-pad) + 4px);
bottom: calc(var(--shell-pad) + 4px);
z-index: 30;
padding: 8px 12px;
border-radius: 999px;
border: 1px solid var(--border);
background: rgba(0, 0, 0, 0.35);
color: var(--text);
font-size: 12px;
letter-spacing: 0.4px;
text-transform: uppercase;
box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
transition: transform 140ms ease, border-color 140ms ease,
background 140ms ease, color 140ms ease;
}
.docs-link:hover {
transform: translateY(-2px);
border-color: rgba(245, 159, 74, 0.5);
background: rgba(245, 159, 74, 0.18);
color: var(--text);
}
.content-header {
display: flex;
align-items: flex-end;
justify-content: space-between;
gap: 12px;
padding: 0 6px;
overflow: hidden;
transform-origin: top center;
transition: opacity var(--shell-focus-duration) var(--shell-focus-ease),
transform var(--shell-focus-duration) var(--shell-focus-ease),
max-height var(--shell-focus-duration) var(--shell-focus-ease),
padding var(--shell-focus-duration) var(--shell-focus-ease);
max-height: 90px;
}
.shell--chat-focus .content-header {
opacity: 0;
transform: translateY(-10px);
max-height: 0px;
padding: 0;
pointer-events: none;
}
.page-title {
font-family: var(--font-display);
font-size: 26px;
letter-spacing: 0.6px;
}
.page-sub {
color: var(--muted);
font-size: 12px;
letter-spacing: 0.4px;
}
.page-meta {
display: flex;
gap: 10px;
}
.grid {
display: grid;
gap: 18px;
}
.grid-cols-2 {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-cols-3 {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
.stat-grid {
display: grid;
gap: 14px;
grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.note-grid {
display: grid;
gap: 14px;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.row {
display: flex;
gap: 12px;
align-items: center;
}
.stack {
display: grid;
gap: 14px;
}
.filters {
display: flex;
flex-wrap: wrap;
gap: 10px;
align-items: center;
}
@media (max-width: 1100px) {
.shell {
--shell-pad: 12px;
--shell-gap: 12px;
--shell-nav-col: 1fr;
grid-template-columns: 1fr;
grid-template-rows: auto auto 1fr;
grid-template-areas:
"topbar"
"nav"
"content";
}
.nav {
position: static;
max-height: none;
display: flex;
gap: 16px;
overflow-x: auto;
border-right: none;
padding: 12px;
}
.nav-group {
grid-auto-flow: column;
grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
border-bottom: none;
padding-bottom: 0;
}
.grid-cols-2,
.grid-cols-3 {
grid-template-columns: 1fr;
}
.topbar {
position: static;
flex-direction: column;
align-items: flex-start;
gap: 12px;
}
.topbar-status {
width: 100%;
flex-wrap: wrap;
}
.table-head,
.table-row {
grid-template-columns: 1fr;
}
.list-item {
grid-template-columns: 1fr;
}
}
/* Mobile-specific improvements */
@media (max-width: 600px) {
.shell {
--shell-pad: 8px;
--shell-gap: 8px;
}
/* Compact topbar for mobile */
.topbar {
padding: 10px 12px;
border-radius: 12px;
gap: 8px;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-between;
}
.brand {
flex: 1;
min-width: 0;
}
.brand-title {
font-size: 15px;
letter-spacing: 0.3px;
}
.brand-sub {
display: none;
}
.topbar-status {
gap: 6px;
width: auto;
flex-wrap: nowrap;
}
.topbar-status .pill {
padding: 4px 8px;
font-size: 11px;
gap: 4px;
}
.topbar-status .pill .mono {
display: none;
}
.topbar-status .pill span:nth-child(2) {
display: none;
}
/* Horizontal scrollable nav for mobile */
.nav {
padding: 8px;
border-radius: 12px;
gap: 8px;
-webkit-overflow-scrolling: touch;
scrollbar-width: none;
}
.nav::-webkit-scrollbar {
display: none;
}
.nav-group {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
gap: 6px;
margin-bottom: 0;
flex-shrink: 0;
}
.nav-label {
display: none;
}
.nav-item {
padding: 7px 10px;
font-size: 12px;
border-radius: 8px;
white-space: nowrap;
flex-shrink: 0;
}
.nav-item::before {
display: none;
}
/* Hide page title on mobile - nav already shows where you are */
.content-header {
display: none;
}
.content {
padding: 4px 4px 16px;
gap: 12px;
}
/* Smaller cards on mobile */
.card {
padding: 12px;
border-radius: 12px;
}
.card-title {
font-size: 14px;
}
/* Stat grid adjustments */
.stat-grid {
gap: 8px;
grid-template-columns: repeat(2, 1fr);
}
.stat {
padding: 10px;
border-radius: 10px;
}
.stat-label {
font-size: 10px;
}
.stat-value {
font-size: 16px;
}
/* Notes grid */
.note-grid {
grid-template-columns: 1fr;
gap: 10px;
}
/* Form fields */
.form-grid {
grid-template-columns: 1fr;
gap: 10px;
}
.field input,
.field textarea,
.field select {
padding: 8px 10px;
border-radius: 10px;
font-size: 14px;
}
/* Buttons */
.btn {
padding: 8px 12px;
font-size: 13px;
}
/* Pills */
.pill {
padding: 4px 10px;
font-size: 12px;
}
/* Chat-specific mobile improvements */
.chat-header {
flex-direction: column;
align-items: stretch;
gap: 8px;
}
.chat-header__left {
flex-direction: column;
align-items: stretch;
}
.chat-header__right {
justify-content: space-between;
}
.chat-session {
min-width: unset;
width: 100%;
}
.chat-thread {
margin-top: 8px;
padding: 10px 8px;
border-radius: 12px;
}
.chat-msg {
max-width: 92%;
}
.chat-bubble {
padding: 8px 10px;
border-radius: 12px;
}
.chat-compose {
gap: 8px;
}
.chat-compose__field textarea {
min-height: 60px;
padding: 8px 10px;
border-radius: 12px;
font-size: 14px;
}
/* Log stream mobile */
.log-stream {
border-radius: 10px;
max-height: 400px;
}
.log-row {
grid-template-columns: 1fr;
gap: 4px;
padding: 8px;
}
.log-time {
font-size: 10px;
}
.log-level {
font-size: 9px;
}
.log-subsystem {
font-size: 11px;
}
.log-message {
font-size: 12px;
}
/* Hide docs link on mobile - saves space */
.docs-link {
display: none;
}
/* List items */
.list-item {
padding: 10px;
border-radius: 10px;
}
.list-title {
font-size: 14px;
}
.list-sub {
font-size: 11px;
}
/* Code blocks */
.code-block {
padding: 8px;
border-radius: 10px;
font-size: 11px;
}
/* Theme toggle smaller */
.theme-toggle {
--theme-item: 24px;
--theme-gap: 4px;
--theme-pad: 4px;
}
.theme-icon {
width: 14px;
height: 14px;
}
}