feat: restyle the ui in gmail's design language
This commit is contained in:
parent
a6b972fec9
commit
9842302c50
3 changed files with 288 additions and 132 deletions
281
web/style.css
281
web/style.css
|
|
@ -1,151 +1,250 @@
|
|||
:root {
|
||||
--bg: #fafaf7;
|
||||
--fg: #26251f;
|
||||
--muted: #7a766b;
|
||||
--line: #dcd8cc;
|
||||
--accent: #3a5a40;
|
||||
--warn: #9c3f2c;
|
||||
--bg: #f6f8fc;
|
||||
--surface: #ffffff;
|
||||
--fg: #202124;
|
||||
--muted: #5f6368;
|
||||
--border: #dadce0;
|
||||
--accent: #1a73e8;
|
||||
--accent-soft: #e8f0fe;
|
||||
--hover: #f1f3f4;
|
||||
--warn: #d93025;
|
||||
--mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
|
||||
--radius: 8px;
|
||||
--shadow: 0 1px 3px rgba(60, 64, 67, 0.2), 0 4px 8px 3px rgba(60, 64, 67, 0.08);
|
||||
}
|
||||
|
||||
* { box-sizing: border-box; }
|
||||
[hidden] { display: none !important; }
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
font: 15px/1.5 system-ui, sans-serif;
|
||||
font: 14px/1.5 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
||||
color: var(--fg);
|
||||
background: var(--bg);
|
||||
background: var(--surface);
|
||||
}
|
||||
|
||||
button {
|
||||
font: inherit;
|
||||
padding: 4px 14px;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 4px;
|
||||
background: #fff;
|
||||
border: 0;
|
||||
border-radius: var(--radius);
|
||||
background: none;
|
||||
color: var(--accent);
|
||||
padding: 6px 14px;
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
}
|
||||
button:hover { border-color: var(--accent); color: var(--accent); }
|
||||
button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
|
||||
|
||||
header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
padding: 8px 16px;
|
||||
border-bottom: 1px solid var(--line);
|
||||
}
|
||||
header h1 { font-size: 16px; margin: 0; font-weight: 600; }
|
||||
.actions { margin-left: auto; display: flex; gap: 8px; }
|
||||
.account { font-family: var(--mono); font-size: 13px; color: var(--muted); }
|
||||
|
||||
main { flex: 1; min-height: 0; display: flex; }
|
||||
|
||||
.setup { flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; }
|
||||
.setup h2 { margin: 0; }
|
||||
.setup .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; }
|
||||
button:hover { background: var(--hover); }
|
||||
button:disabled { color: var(--muted); cursor: default; }
|
||||
|
||||
input, textarea {
|
||||
font: inherit;
|
||||
font-family: var(--mono);
|
||||
font-size: 13px;
|
||||
padding: 4px 8px;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 4px;
|
||||
background: #fff;
|
||||
padding: 6px 10px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius);
|
||||
background: var(--surface);
|
||||
color: var(--fg);
|
||||
}
|
||||
input:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
|
||||
|
||||
/* --- top bar --------------------------------------------------------------- */
|
||||
|
||||
.topbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
padding: 10px 16px;
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
.brand { font-size: 18px; font-weight: 500; letter-spacing: -0.02em; }
|
||||
.search {
|
||||
flex: 1;
|
||||
max-width: 640px;
|
||||
margin: 0 auto;
|
||||
background: var(--hover);
|
||||
border: 0;
|
||||
border-radius: var(--radius);
|
||||
padding: 8px 16px;
|
||||
}
|
||||
.search:focus { background: var(--surface); outline: 1px solid var(--border); }
|
||||
.top-actions { display: flex; align-items: center; gap: 4px; }
|
||||
.account { font-size: 13px; color: var(--muted); margin-right: 4px; }
|
||||
.avatar {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: 50%;
|
||||
background: var(--accent);
|
||||
color: #fff;
|
||||
font-size: 15px;
|
||||
font-weight: 500;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.folders {
|
||||
/* --- layout ------------------------------------------------------------------ */
|
||||
|
||||
main { flex: 1; min-height: 0; display: flex; background: var(--bg); }
|
||||
|
||||
.rail {
|
||||
width: 200px;
|
||||
padding: 12px 8px;
|
||||
background: var(--surface);
|
||||
border-right: 1px solid var(--border);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border-right: 1px solid var(--line);
|
||||
min-width: 110px;
|
||||
gap: 4px;
|
||||
}
|
||||
.folders button {
|
||||
border: 0;
|
||||
border-bottom: 1px solid var(--line);
|
||||
border-radius: 0;
|
||||
.compose {
|
||||
align-self: flex-start;
|
||||
margin: 0 8px 16px;
|
||||
padding: 12px 26px;
|
||||
border-radius: 20px;
|
||||
background: var(--accent-soft);
|
||||
color: var(--accent);
|
||||
font-weight: 500;
|
||||
box-shadow: var(--shadow);
|
||||
}
|
||||
.compose:hover { background: var(--accent); color: #fff; }
|
||||
|
||||
#folders button {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
text-align: left;
|
||||
padding: 10px 14px;
|
||||
background: none;
|
||||
padding: 8px 16px;
|
||||
color: var(--fg);
|
||||
font-weight: 500;
|
||||
}
|
||||
#folders button:hover { background: var(--hover); }
|
||||
#folders button.active { background: var(--accent-soft); color: var(--accent); }
|
||||
#folders .count { color: var(--accent); font-weight: 500; margin-left: 8px; }
|
||||
|
||||
.list {
|
||||
min-width: 280px;
|
||||
max-width: 380px;
|
||||
min-width: 360px;
|
||||
max-width: 460px;
|
||||
overflow-y: auto;
|
||||
border-right: 1px solid var(--line);
|
||||
background: var(--surface);
|
||||
border-right: 1px solid var(--border);
|
||||
}
|
||||
.item { padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
|
||||
.item:hover { background: #f1efe6; }
|
||||
.item.selected { background: #ece9dd; }
|
||||
.item .who { font-weight: 600; }
|
||||
.item .who.unread::before { content: "● "; color: var(--accent); }
|
||||
.item .subject { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.item .when { float: right; font-size: 12px; color: var(--muted); }
|
||||
|
||||
.view { flex: 1; overflow-y: auto; padding: 20px 24px; }
|
||||
.placeholder { color: var(--muted); font-style: italic; }
|
||||
.view h2 { margin: 0 0 2px; font-size: 17px; }
|
||||
.view .meta { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 16px; }
|
||||
.view .fields { font-family: var(--mono); font-size: 12px; color: var(--muted); }
|
||||
.item {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
align-items: baseline;
|
||||
padding: 9px 16px;
|
||||
border-bottom: 1px solid #eee;
|
||||
cursor: pointer;
|
||||
color: var(--muted);
|
||||
}
|
||||
.item:hover { background: var(--hover); }
|
||||
.item.selected { background: var(--accent-soft); }
|
||||
.item.unread { color: var(--fg); }
|
||||
.item .who { width: 150px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.item .mid { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||
.item .subject { font-weight: 400; }
|
||||
.item.unread .who { font-weight: 700; }
|
||||
.item.unread .subject { font-weight: 700; }
|
||||
.item .snippet { color: var(--muted); }
|
||||
.item.unread .snippet { color: var(--fg); }
|
||||
.item .when { flex: none; font-size: 12px; color: var(--muted); }
|
||||
.item button { padding: 2px 12px; font-size: 12px; }
|
||||
|
||||
.view { flex: 1; min-width: 0; overflow-y: auto; padding: 24px 28px; }
|
||||
.view h2 { margin: 0 0 10px; font-size: 20px; font-weight: 400; }
|
||||
.view .meta { font-size: 13px; color: var(--muted); margin-bottom: 14px; white-space: pre-line; }
|
||||
.view .fields { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 10px; white-space: pre-line; }
|
||||
.view pre {
|
||||
white-space: pre-wrap;
|
||||
font-family: inherit;
|
||||
margin: 12px 0 0;
|
||||
border-top: 1px solid var(--line);
|
||||
padding-top: 12px;
|
||||
margin: 14px 0 0;
|
||||
padding: 14px 0 0;
|
||||
border-top: 1px solid var(--border);
|
||||
}
|
||||
.view .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
|
||||
.view .actions button { border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--fg); }
|
||||
.view .actions button:hover { background: var(--hover); color: var(--fg); }
|
||||
|
||||
.verified {
|
||||
display: inline-block;
|
||||
font-size: 12px;
|
||||
padding: 2px 10px;
|
||||
border-radius: 12px;
|
||||
background: #e6f4ea;
|
||||
color: #137333;
|
||||
}
|
||||
.verified { color: var(--accent); font-size: 12px; }
|
||||
.warn { color: var(--warn); }
|
||||
.placeholder { color: var(--muted); font-style: italic; padding: 12px 16px; }
|
||||
|
||||
.name-sender { display: flex; gap: 8px; margin: 12px 0 0; }
|
||||
.name-sender input { flex: 1; }
|
||||
|
||||
/* --- setup -------------------------------------------------------------------- */
|
||||
|
||||
.setup {
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 12px;
|
||||
text-align: center;
|
||||
background: var(--bg);
|
||||
}
|
||||
.setup h2 { margin: 0; font-weight: 400; }
|
||||
.setup p { color: var(--muted); max-width: 480px; }
|
||||
.setup .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; }
|
||||
|
||||
/* --- dialogs --------------------------------------------------------------------- */
|
||||
|
||||
dialog {
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 8px;
|
||||
padding: 20px;
|
||||
border: 0;
|
||||
border-radius: var(--radius);
|
||||
box-shadow: var(--shadow);
|
||||
padding: 20px 24px;
|
||||
min-width: 460px;
|
||||
max-width: 640px;
|
||||
}
|
||||
dialog::backdrop { background: rgba(0, 0, 0, 0.25); }
|
||||
#compose form { display: flex; flex-direction: column; gap: 8px; }
|
||||
#compose label { display: flex; gap: 8px; align-items: center; }
|
||||
#compose input { flex: 1; }
|
||||
#compose textarea { font-family: inherit; }
|
||||
#compose footer { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
|
||||
#compose .anon { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
|
||||
.error { color: var(--warn); font-size: 13px; margin-right: auto; }
|
||||
dialog::backdrop { background: rgba(32, 33, 36, 0.3); }
|
||||
#compose form { display: flex; flex-direction: column; gap: 10px; }
|
||||
#compose input, #compose textarea { width: 100%; }
|
||||
#compose textarea { font-family: inherit; resize: vertical; }
|
||||
#compose footer { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding-top: 4px; }
|
||||
#compose .anon { font-size: 13px; color: var(--muted); margin-right: auto; display: flex; align-items: center; gap: 6px; }
|
||||
.error { color: var(--warn); font-size: 13px; }
|
||||
|
||||
#settings section { margin-bottom: 20px; }
|
||||
#settings form { display: flex; gap: 8px; margin: 8px 0; }
|
||||
#settings form input { flex: 1; }
|
||||
#settings h3 { margin: 0 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
|
||||
#settings section { margin-bottom: 22px; }
|
||||
#settings h3 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
|
||||
#settings form { display: flex; gap: 8px; margin: 6px 0; }
|
||||
#settings form input { flex: 1; font-family: var(--mono); font-size: 13px; }
|
||||
#settings footer { display: flex; justify-content: flex-end; }
|
||||
.hint { font-size: 12px; color: var(--muted); margin: 4px 0; }
|
||||
|
||||
.kv { list-style: none; padding: 0; margin: 4px 0; font-family: var(--mono); font-size: 12px; }
|
||||
.kv { list-style: none; padding: 0; margin: 6px 0; font-size: 13px; }
|
||||
.kv li { display: flex; gap: 10px; padding: 3px 0; align-items: baseline; }
|
||||
.kv li button { padding: 0 8px; font-size: 11px; }
|
||||
.kv .key { word-break: break-all; color: var(--muted); flex: 1; }
|
||||
.kv .key { font-family: var(--mono); word-break: break-all; color: var(--muted); flex: 1; }
|
||||
|
||||
#identity-card { font-family: var(--mono); font-size: 12px; }
|
||||
#identity-card div { margin: 4px 0; word-break: break-all; }
|
||||
#identity-card .seed { border: 1px dashed var(--warn); padding: 6px; }
|
||||
|
||||
.status {
|
||||
/* --- toast ------------------------------------------------------------------------ */
|
||||
|
||||
.toast {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
padding: 6px 16px;
|
||||
left: 24px;
|
||||
bottom: 24px;
|
||||
max-width: 520px;
|
||||
margin: 0;
|
||||
padding: 12px 18px;
|
||||
border-radius: var(--radius);
|
||||
background: #202124;
|
||||
color: #e8eaed;
|
||||
font-size: 13px;
|
||||
border-top: 1px solid var(--line);
|
||||
background: #fff;
|
||||
min-height: 30px;
|
||||
white-space: pre-wrap;
|
||||
box-shadow: var(--shadow);
|
||||
cursor: pointer;
|
||||
}
|
||||
.toast.warn { background: var(--warn); color: #fff; }
|
||||
.toast[hidden] { display: none; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue