Skip to content
← Public packages

@kody/mailroom

Offline-first PWA for your Kody mailbox: sent and received threads, copy-prompt for agents, no send.

src/ui/styles.ts

165 lines · 6.5 KB · TypeScript
export const styles = `
:root {
  color-scheme: light dark;
  --green: #12813f;
  --green-deep: #0c5a2c;
  --bg: #eef1f0;
  --bg-elev: #ffffff;
  --ink: #22262b;
  --muted: #5c6570;
  --line: #dfe4e2;
  --shadow: 0 16px 40px color-mix(in oklab, #12813f 10%, transparent);
  --sans: "Wix Madefor Text", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  --display: "Bricolage Grotesque", "Avenir Next", ui-sans-serif, system-ui, sans-serif;
  --radius: 14px;
  --pad: clamp(0.9rem, 2.5vw, 1.6rem);
}
@media (prefers-color-scheme: dark) {
  :root {
    --green: #6fd08c;
    --green-deep: #12813f;
    --bg: #16191c;
    --bg-elev: #23272b;
    --ink: #f0f2f3;
    --muted: #b3bac1;
    --line: #34393e;
    --shadow: 0 16px 40px rgb(0 0 0 / 0.35);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font-family: var(--sans); }
a { color: var(--green); }
button, input { font: inherit; }
.app {
  width: min(860px, calc(100% - 1.2rem));
  margin: 0 auto;
  padding: 0.85rem 0 3rem;
}
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
}
.brand { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.mark {
  width: 2.4rem; height: 2.4rem; border-radius: 0.7rem;
  flex: 0 0 auto; object-fit: cover;
}
.brand-copy h1 {
  font-family: var(--display);
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  line-height: 1; margin: 0;
}
.status-text { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.92rem; min-height: 1.2em; }
.actions { display: flex; gap: 0.5rem; align-items: center; }
.status-mark {
  width: 0.55rem; height: 0.55rem; border-radius: 999px;
  flex: 0 0 auto; background: transparent;
}
.actions.is-updating .status-mark {
  background: var(--green);
  animation: status-pulse 1.1s ease-in-out infinite;
}
@keyframes status-pulse {
  0%, 100% { transform: scale(0.75); opacity: 0.45; }
  50% { transform: scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .actions.is-updating .status-mark { animation: none; opacity: 1; }
}
.ghost, .install, .copy {
  border: 1px solid var(--line); background: var(--bg-elev); color: var(--ink);
  border-radius: 999px; padding: 0.45rem 0.85rem; cursor: pointer;
}
.install { background: var(--green); color: #fff; border-color: transparent; }
.copy { font-size: 0.9rem; }
.install-wrap { position: relative; }
.install-popover {
  position: absolute; right: 0; top: calc(100% + 0.4rem);
  width: min(16rem, 80vw); padding: 0.85rem;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); display: none; z-index: 4;
}
.install-popover.is-open, .install-popover:popover-open { display: block; }
.install-steps { color: var(--muted); font-size: 0.92rem; }
.install-steps p, .install-steps ol { margin: 0.45rem 0 0.7rem; padding-left: 1.15rem; }
.install-steps li { margin: 0.2rem 0; }
.install-popover [hidden] { display: none; }
.install-hint {
  display: flex; gap: 0.6rem; align-items: flex-start;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 0.7rem 0.85rem; margin-bottom: 0.85rem;
}
.install-hint[hidden] { display: none; }
.install-hint-dismiss { border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.mailbox {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 999px; padding: 0.2rem; margin-bottom: 0.85rem;
}
.mailbox button {
  border: 0; background: transparent; color: var(--muted);
  border-radius: 999px; padding: 0.5rem 0.7rem; cursor: pointer;
}
.mailbox button[aria-current="true"] {
  background: var(--green); color: #fff;
}
.search {
  width: 100%; border: 1px solid var(--line); background: var(--bg-elev);
  color: var(--ink); border-radius: 999px; padding: 0.7rem 1rem; margin-bottom: 0.85rem;
}
.list { display: grid; gap: 0.65rem; }
.card {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 0.9rem 1rem;
}
.card[aria-current="true"] { border-color: var(--green); box-shadow: var(--shadow); }
.card-meta { display: flex; justify-content: space-between; gap: 0.75rem; color: var(--muted); font-size: 0.82rem; }
.card h2 { margin: 0.25rem 0 0.2rem; font-size: 1.05rem; font-family: var(--display); }
.card p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.empty { color: var(--muted); padding: 2rem 0; text-align: center; }
.sheet {
  position: fixed; inset: 0; background: color-mix(in oklab, #000 35%, transparent);
  display: grid; place-items: end center; padding: 0; z-index: 6;
}
.sheet[hidden] { display: none; }
.sheet-card {
  width: min(760px, 100%); max-height: min(92vh, 920px); overflow: auto;
  background: var(--bg-elev); border-radius: 18px 18px 0 0;
  padding: var(--pad); box-shadow: var(--shadow);
}
.sheet-card h2 { font-family: var(--display); margin: 0 0 0.4rem; }
.sheet-toolbar { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0 0 1rem; }
.meta { color: var(--muted); font-size: 0.9rem; margin: 0 0 1rem; }
.message {
  border: 1px solid var(--line); border-radius: 12px; padding: 0.85rem;
  margin: 0 0 0.75rem; background: var(--bg);
}
.message h3 { margin: 0 0 0.3rem; font-size: 0.95rem; }
.message-body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0.6rem 0; }
.preview {
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: #eef1f0; min-height: 8rem; margin-top: 0.5rem;
}
.preview iframe { width: 100%; min-height: 16rem; border: 0; background: #eef1f0; }
.toast {
  position: fixed; left: 50%; bottom: 1.1rem; transform: translateX(-50%);
  width: min(28rem, calc(100% - 1.2rem));
  display: flex; justify-content: space-between; gap: 0.8rem; align-items: center;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 16px;
  padding: 0.8rem 1rem; box-shadow: var(--shadow); z-index: 8;
}
.toast[hidden] { display: none; }
.toast-actions { display: flex; gap: 0.4rem; }
.about-dl {
  display: grid; gap: 0.75rem; margin: 0.8rem 0 1rem;
}
.about-dl div { display: grid; gap: 0.15rem; }
.about-dl dt { color: var(--muted); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; }
.about-dl dd { margin: 0; font-family: var(--display); font-size: 1.05rem; overflow-wrap: anywhere; }
.about-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; }
html.is-modal-open, html.is-modal-open body { overflow: hidden; }
`