Files
op-packages/luci-theme-carbon/styles/16-responsive.css
T

225 lines
9.1 KiB
CSS
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/* ==========================================================================
16. Responsive
========================================================================== */
/* wide screens: pages that profit from width (the dashboard grid, tables)
grow in steps; plain forms keep a readable 1240px */
@media (min-width: 1800px) { :root { --cb-content-wide: 1480px; } }
@media (min-width: 2300px) { :root { --cb-content-wide: 1720px; } }
body.cb-has-dash,
body:has(#maincontent .table) { --cb-content-max: var(--cb-content-wide); }
/* a wide devices card lays its list out in two columns */
.cb-clients { container-type: inline-size; }
@container (min-width: 880px) {
.cb-clients .cb-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
.cb-clients .cb-list > li:nth-child(2) { box-shadow: none; }
.cb-clients .cb-list > li:hover + li { box-shadow: 0 -.5px 0 var(--cb-sep); }
.cb-clients .cb-list > li:hover + li:nth-child(2) { box-shadow: none; }
}
/* columns too narrow for the MAC next to the name: keep the name readable */
@container (min-width: 880px) and (max-width: 1099px) {
.cb-clients .cb-list .cb-hide-sm { display: none; }
.cb-clients .cb-tag-wifi .cb-tag-text { display: none; }
.cb-clients .cb-device-source { display: block; }
}
@media (max-width: 1180px) {
.cb-dash .span-8,
.cb-dash .span-4 { grid-column: span 12; }
.cb-dash .span-3 { grid-column: span 6; }
.cb-resources .cb-res-body { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 0 28px; align-items: start; }
.cb-resources .cb-rings { margin-bottom: 0; }
}
@media (max-width: 1023px) {
.cb-sidebar { transform: translateX(calc(-100% - var(--cb-gutter) * 2)); }
body.cb-nav-open .cb-sidebar { transform: none; }
.cb-collapse { display: none; }
.cb-scrim {
display: block;
position: fixed;
z-index: 250;
inset: 0;
background: rgba(0, 0, 0, .3);
opacity: 0;
visibility: hidden;
transition: opacity .25s var(--cb-ease), visibility .25s;
}
body.cb-nav-open .cb-scrim { opacity: 1; visibility: visible; }
.cb-main { margin-left: 0; }
.cb-burger { display: inline-block; }
.cb-toolbar { padding: 8px 16px; padding-left: max(16px, env(safe-area-inset-left)); }
.cb-content { padding: 10px 16px 24px; }
.cb-footer { padding: 8px 16px 24px; }
}
@media (max-width: 760px) {
.cb-resources .cb-res-body { display: block; }
.cb-resources .cb-rings { margin-bottom: 16px; }
.cb-dash { gap: 12px; }
.cb-card { padding: 16px; }
.cb-hero { padding: 18px 16px; }
/* hero meta becomes a tidy list: status pill on its own row, then
label/value rows — no more crowding next to the badge */
.cb-hero-meta { flex: 1 1 100%; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.cb-hero-meta > .cb-pill { justify-self: start; margin: 0 0 12px; }
.cb-hero-meta .cb-meta {
flex-direction: row;
align-items: baseline;
justify-content: space-between;
gap: 12px;
min-width: 0;
padding: 8px 0;
border-top: .5px solid var(--cb-sep);
}
.cb-hero-meta .cb-meta-label { flex: none; white-space: nowrap; }
.cb-hero-meta .cb-meta-val { text-align: right; }
.cb-rate-val { font-size: 24px; }
.cb-chart { height: 160px; }
.cb-totals { margin-left: 0; text-align: left; flex-basis: 100%; }
.cb-ring svg { width: 74px; height: 74px; }
.cb-ring-center { height: 74px; }
.cb-ring-center b { font-size: 16px; }
.cb-tile-val { font-size: 24px; }
.cb-list .cb-hide-sm { display: none; }
/* keep device names readable: Wi‑Fi tag shrinks to its icon (details stay in the tooltip) */
.cb-tag-wifi .cb-tag-text { display: none; }
.cb-tag-wifi svg { margin-right: 0; }
/* source/lease text gets its own line so badges cannot crowd out the name */
.cb-clients .cb-device-source { display: block; }
.cb-clients .cb-list-aside { max-width: 55%; }
#view > h2, .cbi-map > h2, h2[name="content"] { font-size: 24px; }
.cbi-section-node { padding: 2px 14px; }
.cbi-value { flex-direction: column; gap: 6px; padding: 12px 0; }
.cbi-value-title,
.cbi-value label.cbi-value-title { flex: none; padding-top: 0; }
.cbi-value-field { flex: none; width: 100%; }
/* flag values (switches) stay on one row: title left, switch right; the
optional description (rendered inside the field) drops below the row */
.cbi-value[data-widget="CBI.FlagValue"] { flex-direction: row; align-items: center; }
.cbi-value[data-widget="CBI.FlagValue"] > .cbi-value-title { flex: 1 1 0; min-width: 0; }
.cbi-value[data-widget="CBI.FlagValue"] > .cbi-value-field { display: contents; }
.cbi-value[data-widget="CBI.FlagValue"] .cbi-value-description { flex: 1 1 100%; margin-top: 0; }
/* package manager (luci-app-package-manager): input + button on one line */
.controls .control-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.controls .control-group > input { flex: 1 1 12em; width: auto; min-width: 0; }
.controls .control-group > .btn { flex: 0 0 auto; }
input:where(:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"])),
textarea,
select,
.cbi-select,
.cbi-dropdown:not(.btn):not(.cbi-button),
.cbi-dynlist { width: 100%; }
.tabs, .cbi-tabmenu { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar, .cbi-tabmenu::-webkit-scrollbar { display: none; }
.tabs > li, .cbi-tabmenu > li { flex: none; }
.cbi-page-actions { bottom: max(8px, env(safe-area-inset-bottom)); }
/* tables become stacked cards (uses LuCI's data-title attributes) */
.table { display: flex; flex-direction: column; overflow: visible; }
.table .tr {
display: flex;
flex-wrap: wrap;
align-items: flex-start;
padding: 8px 4px;
border-top: .5px solid var(--cb-sep);
}
.table .tr:first-child,
.table .tr.table-titles + .tr,
.table .tr.cbi-section-table-titles + .tr { border-top: 0; }
.table .th,
.table .td,
.table .tr::before {
display: block;
flex: 1 1 50%;
min-width: 0;
padding: 4px 10px;
border-top: 0 !important;
overflow: hidden;
text-overflow: ellipsis;
word-wrap: break-word;
}
.table .td.cbi-dropdown-open { overflow: visible; }
.table .tr:hover > .td { background: transparent !important; }
.tr.table-titles,
.cbi-section-table-titles,
.cbi-section-table-descr { display: none !important; }
.tr[data-title]::before {
flex: 1 1 100%;
font-size: 15px;
font-weight: 600;
padding-bottom: 6px;
}
.td[data-title]::before {
content: attr(data-title);
display: block;
margin-bottom: 2px;
color: var(--cb-text-2);
font-size: 11.5px;
font-weight: 600;
white-space: pre-line;
}
.td.cbi-value-field { flex-basis: 100%; }
.td.cbi-value-field[data-widget="CBI.DummyValue"],
.td.cbi-value-field[data-widget="CBI.Button"],
.td.cbi-value-field[data-widget="CBI.FlagValue"],
.td.cbi-value-field[data-widget="dvalue"],
.td.cbi-value-field[data-widget="button"],
.td.cbi-value-field[data-widget="fvalue"] { flex-basis: 50%; text-align: left; }
/* data cells never share a wrapped row with button cells (e.g. Nikki's
status table: the core state is a readout, not a button) */
.tr:has(> .td[data-widget="CBI.ButtonValue"]) > .td.cbi-value-field:not([data-widget="CBI.ButtonValue"]) { flex-basis: 100%; }
/* button cells share one row when they fit (Nikki's four actions),
and wrap gracefully when the labels are too long for the screen;
margin-left matches the field inset above so the row aligns */
.td.cbi-value-field[data-widget="CBI.ButtonValue"] { flex: 1 0 auto; width: auto; min-width: 0; padding-left: 0; padding-right: 0; margin-left: 10px; }
.td.cbi-section-actions { flex-basis: 100%; width: auto; padding-top: 8px; }
.td.cbi-section-actions > * { justify-content: flex-start; flex-wrap: wrap; gap: 4px; }
/* tighter action buttons so short button sets fit on one row */
.td.cbi-section-actions .btn,
.td.cbi-section-actions .cbi-button { min-height: 28px; padding: 3px 9px; font-size: 12.5px; }
/* stacked-table button cells keep the regular button size; only the
horizontal padding is trimmed so four actions fit one row */
.td.cbi-value-field[data-widget="CBI.ButtonValue"] .cbi-button { padding-left: 8px; padding-right: 8px; }
.tr.placeholder > .td { position: static; }
.col-1 { flex: 1 1 30px !important; }
.col-2 { flex: 2 2 60px !important; }
.col-3 { flex: 3 3 90px !important; }
.col-4 { flex: 4 4 120px !important; }
.col-5 { flex: 5 5 150px !important; }
.col-6 { flex: 6 6 180px !important; }
.col-7 { flex: 7 7 210px !important; }
.col-8 { flex: 8 8 240px !important; }
.col-9 { flex: 9 9 270px !important; }
.col-10 { flex: 10 10 300px !important; }
.hide-sm, .hide-xs { display: none !important; }
.modal { width: 94%; margin-top: 6vh; padding: 18px; }
}
@media (max-width: 480px) {
.cb-dash .span-3 { grid-column: span 6; }
.cb-tile { padding: 14px; }
.cb-tile-val { font-size: 22px; }
.cb-spark { display: none; }
.cb-hero-title { font-size: 19px; }
.hide-xs { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: .01ms !important;
animation-iteration-count: 1 !important;
transition-duration: .01ms !important;
}
}