UXInteract / task_040 /solution /code /index.html
DojiSum's picture
Publish the current 141-task UXInteract release
ef987bb verified
Raw History Blame Contribute Delete
1.05 kB
<!doctype html>
<html data-theme="light"><head><meta charset="utf-8"><title>Theme Toggle</title><style>:root{--bg:#fff;--fg:#111;--panel:#f3f4f6}html[data-theme="dark"]{--bg:#111827;--fg:#f9fafb;--panel:#1f2937}body{background:var(--bg);color:var(--fg);font-family:Arial;padding:24px}.panel{background:var(--panel);color:var(--fg);padding:16px;margin:12px 0}</style></head><body><header><button data-testid="theme-toggle">theme toggle</button></header><main><section class="panel" data-testid="question-list">Question list</section><section class="panel" data-testid="question-detail">Question detail</section><section class="panel" data-testid="comment-area">Comments</section></main><script>document.documentElement.dataset.theme=localStorage.getItem('review-theme')||'light';document.querySelector('[data-testid="theme-toggle"]').onclick=()=>{document.documentElement.dataset.theme=document.documentElement.dataset.theme==='dark'?'light':'dark';localStorage.setItem('review-theme',document.documentElement.dataset.theme);};</script></body></html>