Files
sanderling/examples/folio-web/src/index.css
pj af7b7e27b0 feat(folio-web): web sample app + CDP spec tests (#36)
* fix(runner): allow nil connection for web platform

* fix(testrun): skip SDK handshake for web platform

* feat(folio-web): add React/Vite web sample app

* feat(folio-web): add sanderling spec

* fix(chrome): use InsertText for multi-char text input

* feat(hierarchy): add Screen field populated from sanderling-screen attr

* fix(chrome): auto-detect viewport from CSS vars, fix InputText accumulation, expose route as screen

* fix(runner): fall back to hierarchy root screen when snapshot screen is empty

* fix(folio-web): broaden loggedIn extractor to all authenticated pages
2026-04-22 23:59:30 +07:00

585 lines
11 KiB
CSS

:root {
--bg: #ffffff;
--surface: #fafafa;
--surface-2: #f4f4f4;
--surface-3: #ebebeb;
--border: #e7e7e7;
--border-strong: #d6d6d6;
--text: #000000;
--text-muted: #6b6b6b;
--text-faint: #9a9a9a;
--accent: #000000;
--accent-press: #1a1a1a;
--on-accent: #ffffff;
--credit: #000000;
--debit: #000000;
--danger: #000000;
--shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
--frame-w: 420px;
--frame-h: 900px;
--r-sm: 8px;
--r-md: 12px;
--r-lg: 16px;
--r-pill: 999px;
--pad: 20px;
--mono:
'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-family: var(--mono);
font-size: 15px;
line-height: 1.45;
color: var(--text);
background: var(--bg);
color-scheme: light;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-rendering: optimizeLegibility;
font-synthesis: none;
}
* {
box-sizing: border-box;
}
html,
body,
#root {
margin: 0;
padding: 0;
height: 100%;
}
body {
background: var(--bg);
display: grid;
place-items: center;
overflow: hidden;
}
#root {
width: 100%;
height: 100%;
display: grid;
place-items: center;
}
.frame {
width: 100%;
height: 100%;
max-width: var(--frame-w);
max-height: var(--frame-h);
background: var(--bg);
color: var(--text);
position: relative;
overflow: hidden;
display: flex;
flex-direction: column;
border-left: 1px solid var(--border);
border-right: 1px solid var(--border);
}
.statusbar {
height: 28px;
flex: 0 0 auto;
display: flex;
align-items: center;
justify-content: space-between;
padding: 6px 22px 0;
font-size: 12px;
font-weight: 600;
letter-spacing: 0.04em;
color: var(--text);
user-select: none;
}
.statusbar .dots {
display: inline-flex;
gap: 4px;
opacity: 0.85;
}
.statusbar .dot {
width: 4px;
height: 4px;
border-radius: 50%;
background: currentColor;
}
.screen {
flex: 1 1 auto;
display: flex;
flex-direction: column;
min-height: 0;
}
.screen-header {
flex: 0 0 auto;
display: flex;
align-items: center;
gap: 12px;
padding: 14px var(--pad) 8px;
}
.screen-header .title {
font-size: 20px;
font-weight: 700;
letter-spacing: -0.01em;
margin: 0;
flex: 1 1 auto;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.screen-header .subtitle {
font-size: 12px;
color: var(--text-muted);
margin: 2px 0 0;
}
.screen-body {
flex: 1 1 auto;
overflow-y: auto;
padding: 8px var(--pad) 24px;
-webkit-overflow-scrolling: touch;
display: flex;
flex-direction: column;
gap: 12px;
}
.screen-footer {
flex: 0 0 auto;
padding: 16px var(--pad) calc(20px + env(safe-area-inset-bottom));
border-top: 1px solid var(--border);
background: var(--bg);
display: flex;
flex-direction: column;
gap: 14px;
}
.icon-btn {
appearance: none;
background: var(--surface-2);
color: var(--text);
border: 1px solid var(--border);
width: 36px;
height: 36px;
border-radius: 10px;
display: inline-flex;
align-items: center;
justify-content: center;
cursor: pointer;
font-family: inherit;
font-size: 16px;
line-height: 1;
transition: background 0.12s ease, transform 0.06s ease;
}
.icon-btn:hover {
background: var(--surface-3);
}
.icon-btn:active {
transform: scale(0.96);
}
.btn {
appearance: none;
font-family: inherit;
font-size: 15px;
font-weight: 600;
letter-spacing: 0.01em;
border-radius: var(--r-md);
padding: 14px 16px;
border: 1px solid var(--border-strong);
background: var(--surface-2);
color: var(--text);
cursor: pointer;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8px;
transition: background 0.12s ease, transform 0.06s ease, opacity 0.12s ease;
width: 100%;
}
.btn:hover {
background: var(--surface-3);
}
.btn:active {
transform: scale(0.99);
}
.btn:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.btn.primary {
background: var(--accent);
border-color: var(--accent);
color: var(--on-accent);
}
.btn.primary:hover {
background: var(--accent-press);
border-color: var(--accent-press);
}
.btn.danger {
color: var(--text);
border-color: var(--border-strong);
}
.btn.danger:hover {
background: var(--surface-2);
}
.btn.ghost {
background: transparent;
border-color: transparent;
color: var(--text-muted);
}
.btn.ghost:hover {
background: var(--surface-2);
color: var(--text);
}
.field {
display: flex;
flex-direction: column;
gap: 6px;
}
.field-label {
font-size: 12px;
color: var(--text-muted);
letter-spacing: 0.06em;
text-transform: uppercase;
}
.input {
appearance: none;
font-family: inherit;
font-size: 16px;
width: 100%;
background: var(--surface);
color: var(--text);
border: 1px solid var(--border);
border-radius: var(--r-md);
padding: 14px 14px;
outline: none;
transition: border-color 0.12s ease, background 0.12s ease;
}
.input::placeholder {
color: var(--text-faint);
}
.input:focus {
border-color: var(--accent);
background: var(--surface-2);
}
.input.invalid {
border-color: var(--danger);
}
.error {
color: var(--danger);
font-size: 12px;
min-height: 1em;
}
.muted {
color: var(--text-muted);
}
.faint {
color: var(--text-faint);
}
.list {
display: flex;
flex-direction: column;
gap: 10px;
}
.row {
display: flex;
align-items: center;
gap: 12px;
}
.spacer {
flex: 1 1 auto;
}
.card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--r-lg);
padding: 16px;
display: flex;
flex-direction: column;
gap: 6px;
}
.account-card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--r-lg);
padding: 16px;
display: flex;
align-items: center;
gap: 14px;
text-align: left;
width: 100%;
font-family: inherit;
color: inherit;
cursor: pointer;
transition: background 0.12s ease, transform 0.06s ease,
border-color 0.12s ease;
}
.account-card:hover {
background: var(--surface-2);
border-color: var(--border-strong);
}
.account-card:active {
transform: scale(0.995);
}
.account-avatar {
width: 40px;
height: 40px;
border-radius: 12px;
display: grid;
place-items: center;
background: var(--surface-3);
color: var(--accent);
font-weight: 700;
font-size: 15px;
flex: 0 0 auto;
}
.account-meta {
flex: 1 1 auto;
min-width: 0;
display: flex;
flex-direction: column;
gap: 2px;
}
.account-name {
font-size: 15px;
font-weight: 600;
letter-spacing: -0.005em;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.account-sub {
font-size: 12px;
color: var(--text-muted);
}
.account-amount {
font-size: 15px;
font-weight: 600;
font-variant-numeric: tabular-nums;
white-space: nowrap;
}
.empty {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
padding: 48px 16px;
color: var(--text-muted);
gap: 6px;
}
.empty .empty-title {
color: var(--text);
font-size: 15px;
font-weight: 600;
}
.empty .empty-sub {
font-size: 13px;
color: var(--text-muted);
}
.empty .empty-icon {
width: 56px;
height: 56px;
border-radius: 50%;
background: var(--surface-2);
border: 1px solid var(--border);
display: grid;
place-items: center;
margin-bottom: 8px;
color: var(--text-muted);
}
.balance-display {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 4px;
}
.balance-label {
font-size: 11px;
letter-spacing: 0.1em;
text-transform: uppercase;
color: var(--text-muted);
}
.balance-value {
font-size: 28px;
font-weight: 700;
font-variant-numeric: tabular-nums;
letter-spacing: -0.01em;
}
.balance-value.credit,
.balance-value.debit {
color: var(--text);
}
.txn-row {
display: flex;
align-items: center;
gap: 12px;
padding: 14px 0;
border-bottom: 1px solid var(--border);
}
.txn-row:last-child {
border-bottom: 0;
}
.txn-icon {
width: 36px;
height: 36px;
border-radius: 10px;
display: grid;
place-items: center;
font-weight: 700;
font-size: 16px;
flex: 0 0 auto;
}
.txn-icon.credit {
background: var(--surface-2);
color: var(--text);
}
.txn-icon.debit {
background: var(--surface-2);
color: var(--text);
}
.txn-meta {
flex: 1 1 auto;
min-width: 0;
display: flex;
flex-direction: column;
gap: 2px;
}
.txn-note {
font-size: 14px;
font-weight: 500;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.txn-date {
font-size: 11px;
color: var(--text-faint);
letter-spacing: 0.04em;
}
.txn-amount {
font-size: 15px;
font-weight: 600;
font-variant-numeric: tabular-nums;
white-space: nowrap;
}
.txn-amount.credit,
.txn-amount.debit {
color: var(--text);
}
.section-label {
font-size: 11px;
text-transform: uppercase;
letter-spacing: 0.12em;
color: var(--text-faint);
padding: 4px 4px;
}
.segmented {
display: grid;
grid-template-columns: 1fr 1fr;
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--r-md);
padding: 4px;
gap: 4px;
}
.segmented button {
appearance: none;
font-family: inherit;
font-size: 14px;
font-weight: 600;
background: transparent;
color: var(--text-muted);
border: 0;
padding: 10px 12px;
border-radius: 8px;
cursor: pointer;
transition: background 0.12s ease, color 0.12s ease;
}
.segmented button[aria-pressed='true'] {
background: var(--surface-3);
color: var(--text);
}
.segmented button.credit[aria-pressed='true'],
.segmented button.debit[aria-pressed='true'] {
color: var(--text);
}
.amount-input {
text-align: center;
font-size: 36px;
font-weight: 700;
letter-spacing: -0.01em;
padding: 24px 12px;
font-variant-numeric: tabular-nums;
}
.brand {
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
padding: 36px 16px 24px;
}
.brand-mark {
width: 56px;
height: 56px;
border-radius: 16px;
display: grid;
place-items: center;
background: var(--surface-2);
border: 1px solid var(--border);
color: var(--accent);
font-weight: 700;
font-size: 22px;
letter-spacing: -0.02em;
}
.brand-name {
font-size: 22px;
font-weight: 700;
letter-spacing: -0.01em;
}
.brand-sub {
font-size: 12px;
color: var(--text-muted);
}
.toast {
position: absolute;
left: 50%;
bottom: 96px;
transform: translateX(-50%);
background: var(--surface-3);
color: var(--text);
border: 1px solid var(--border-strong);
padding: 8px 14px;
border-radius: var(--r-pill);
font-size: 13px;
box-shadow: var(--shadow);
pointer-events: none;
opacity: 0;
transition: opacity 0.18s ease, transform 0.18s ease;
}
.toast.show {
opacity: 1;
transform: translateX(-50%) translateY(-4px);
}