Demo-Anwendung Merkzettel auf Basis des Styleguides

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-16 14:00:05 +01:00
parent 0e7a39344f
commit 82e5dd5cea
5 changed files with 470 additions and 1 deletions

114
demo/app.css Normal file
View File

@ -0,0 +1,114 @@
/* Demo-Anwendung: nutzt ausschließlich Tokens aus ../tokens.css */
* { box-sizing: border-box; }
html { font-size: var(--font-size-base); }
body {
margin: 0; background: var(--bg); color: var(--text); font: 1rem/var(--line-height-base) var(--font-sans);
background-image: radial-gradient(60rem 20rem at 50% -6rem, var(--bg-glow), transparent); background-repeat: no-repeat;
}
h1, h2, h3 { line-height: var(--line-height-heading); margin: 0; }
h1 { font-size: var(--font-size-page-title); }
h2 { font-size: var(--font-size-section-title); }
small, .small { font-size: var(--font-size-small); color: var(--muted); }
a { color: var(--accent-strong); }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent-strong); color: var(--accent-text); padding: .5rem .8rem; z-index: var(--z-tooltip); }
.skip:focus { left: .5rem; top: .5rem; }
.bar { position: sticky; top: 0; z-index: var(--z-sticky); background: var(--surface); border-bottom: 1px solid var(--border); }
.bar .in { max-width: var(--content-max); margin: 0 auto; padding: .6rem var(--content-gutter); display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; align-items: center; justify-content: space-between; }
.wordmark { font-size: var(--font-size-wordmark); font-weight: 700; letter-spacing: -.01em; }
.wordmark b { color: var(--accent-strong); }
.controls { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--border-field); border-radius: var(--radius-pill); overflow: hidden; }
.seg button { font: inherit; font-size: var(--font-size-small); color: var(--text); background: transparent; border: 0; padding: .3rem .8rem; cursor: pointer; transition: background var(--transition); }
.seg button[aria-checked="true"] { background: var(--accent-strong); color: var(--accent-text); font-weight: 600; }
.seg button[aria-checked="true"]::before { content: "✓ "; }
.wrap { max-width: 44rem; margin: 0 auto; padding: 1.2rem var(--content-gutter) 2rem; display: grid; gap: var(--card-gap); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--card-pad-y) var(--card-pad-x); box-shadow: var(--shadow); }
.card h2 { margin-bottom: .8rem; }
label { display: block; font-size: var(--font-size-small); font-weight: 600; margin-bottom: .25rem; }
input[type="text"], input:not([type]), select { width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-field); border-radius: var(--radius-field); padding: .45rem .65rem; }
input.invalid { border-color: var(--danger); }
.help { font-size: var(--font-size-small); color: var(--muted); margin-top: .25rem; }
.err { color: var(--danger); font-size: var(--font-size-small); margin-top: .25rem; }
.addform { display: grid; gap: .8rem; grid-template-columns: 1fr auto auto; align-items: start; }
.addform .btn { margin-top: 1.4rem; }
.btn { font: inherit; font-weight: 600; border-radius: var(--radius-button); padding: .45rem .9rem; cursor: pointer; border: 1px solid var(--border-field); background: var(--surface-2); color: var(--text); transition: border-color var(--transition), background var(--transition); display: inline-flex; align-items: center; gap: .45rem; }
.btn:hover { border-color: var(--accent-strong); }
.btn.primary { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-text); }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.icon { width: var(--icon-md); height: var(--icon-md); fill: none; stroke: currentColor; stroke-width: var(--icon-stroke); stroke-linecap: round; stroke-linejoin: round; flex: none; }
.iconbtn { display: inline-grid; place-items: center; width: var(--icon-button); height: var(--icon-button); padding: 0; border: 1px solid transparent; border-radius: var(--radius-button); background: transparent; color: var(--muted); cursor: pointer; transition: border-color var(--transition), color var(--transition); }
.iconbtn:hover { border-color: var(--danger); color: var(--danger); }
.choice { font-weight: 400; font-size: 1rem; margin-bottom: 0; display: inline-flex; align-items: center; gap: .55rem; min-height: var(--target-min); cursor: pointer; }
.choice input { appearance: none; -webkit-appearance: none; margin: 0; flex: none; position: relative; cursor: pointer; width: var(--control-size); height: var(--control-size); background: var(--surface); border: 1.5px solid var(--border-field); transition: background var(--transition), border-color var(--transition); }
.choice input[type="checkbox"] { border-radius: 4px; }
.choice input:checked { background: var(--accent-strong); border-color: var(--accent-strong); }
.choice input[type="checkbox"]:not([role="switch"]):checked::after { content: ""; position: absolute; left: 32%; top: 12%; width: 28%; height: 52%; border: solid var(--accent-text); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.choice input[role="switch"] { width: var(--switch-width); height: var(--switch-height); border-radius: var(--radius-pill); background: var(--surface-2); }
.choice input[role="switch"]::after { content: ""; position: absolute; top: 50%; left: 3px; width: calc(var(--switch-height) - 10px); height: calc(var(--switch-height) - 10px); border-radius: 50%; background: var(--muted); transform: translateY(-50%); transition: left var(--transition), background var(--transition); }
.choice input[role="switch"]:checked::after { left: calc(100% - (var(--switch-height) - 10px) - 3px); background: var(--accent-text); }
.listhead { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.listhead h2 { margin: 0; }
.listtools { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tabs button { font: inherit; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 6px 12px; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent-strong); font-weight: 600; }
.count { font-size: var(--font-size-small); font-variant-numeric: tabular-nums; }
#panel { padding-top: .6rem; min-height: 8rem; }
ul.tasks { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
ul.tasks li { display: flex; align-items: center; gap: .6rem; padding: .35rem .4rem; border-radius: var(--radius-field); }
ul.tasks li:hover { background: var(--surface-2); }
ul.tasks .choice { flex: 1; min-width: 0; overflow-wrap: anywhere; }
ul.tasks li.done .label { color: var(--muted); text-decoration: line-through; }
.compact ul.tasks li { padding-block: 0; }
.prio { font-size: var(--font-size-small); border: 1px solid var(--border-field); border-radius: var(--radius-pill); padding: 0 .6rem; white-space: nowrap; }
.prio.high { border-color: var(--danger); color: var(--danger); font-weight: 600; }
.prio.low { color: var(--muted); }
.state { border: 1px dashed var(--border-field); border-radius: var(--radius-card); padding: 1.2rem; text-align: center; color: var(--muted); display: grid; gap: .4rem; justify-items: center; }
.state strong { color: var(--text); }
.skeleton { display: grid; gap: .6rem; padding: .4rem 0; }
.skeleton i { display: block; height: 1rem; border-radius: var(--skeleton-radius); background: var(--surface-2); background-image: linear-gradient(90deg, transparent, var(--border), transparent); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; }
.skeleton i:nth-child(2) { width: 80%; } .skeleton i:nth-child(3) { width: 55%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton i { animation: none; } * { transition: none !important; } }
.summary { display: grid; gap: .4rem; margin-top: .8rem; font-size: var(--font-size-small); color: var(--muted); }
progress { width: 100%; height: .6rem; accent-color: var(--accent-strong); }
.menu { position: relative; display: inline-block; }
.menu .list { position: absolute; top: calc(100% + 4px); z-index: var(--z-dropdown); min-width: 15rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-field); box-shadow: var(--shadow-menu); padding: 4px; display: grid; gap: 1px; }
.menu .list.right { right: 0; }
.menu .list[hidden] { display: none; }
.menu .list button { font: inherit; border: 0; background: none; color: var(--text); text-align: left; display: grid; gap: 1px; padding: 6px 10px; border-radius: 6px; cursor: pointer; }
.menu .list button:hover:not(:disabled), .menu .list button:focus-visible { background: var(--accent-soft); }
.menu .list small { font-size: var(--font-size-small); }
.menu .list hr { border: 0; border-top: 1px solid var(--border); margin: 3px 4px; width: calc(100% - 8px); }
.backdrop { position: fixed; inset: 0; z-index: var(--z-modal); background: var(--backdrop); display: grid; place-items: center; padding: 16px; }
.backdrop[hidden] { display: none; }
.dialog { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-button); width: min(var(--dialog-width), 100%); max-height: 94vh; overflow-y: auto; padding: var(--dialog-pad); box-shadow: var(--shadow-dialog); display: grid; gap: var(--dialog-gap); }
.dialog:focus { outline: none; }
.dialog p { margin: 0; }
.acts { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .4rem; }
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: var(--z-toast); display: flex; gap: 10px; align-items: center; max-width: min(90vw, 760px); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-button); padding: 8px 14px; box-shadow: var(--shadow-toast); font-size: .86rem; overflow-wrap: anywhere; }
.toast[hidden] { display: none; }
.toast button { border: 0; background: none; cursor: pointer; color: var(--muted); font: inherit; }
#tooltip { position: fixed; z-index: var(--z-tooltip); max-width: var(--tooltip-max); background: var(--text); color: var(--bg); font-size: var(--font-size-small); padding: .3rem .6rem; border-radius: 6px; overflow-wrap: anywhere; }
#tooltip[hidden] { display: none; }
@media (max-width: 40rem) {
h1 { font-size: var(--font-size-page-title-compact); }
.card { padding: var(--card-pad-y) 1rem; }
.addform { grid-template-columns: 1fr; }
.addform .btn { margin-top: 0; justify-self: start; }
}