UXInteract / task_040 /instruction.md
DojiSum's picture
Publish the current 141-task UXInteract release
ef987bb verified
|
Raw History Blame Contribute Delete
1.13 kB

Add a one-click theme switch to the discussion page

Extend the supplied index.html with a prominent button that switches the whole page between light and dark modes. Keep it usable offline.

Interface

Mark the button with data-testid="theme-toggle". Preserve the supplied contents and data-testid values question-list, question-detail and comment-area. Either theme may be initial; no CSS class, theme attribute or storage key is prescribed.

Acceptance Checklist

  • One click switches both the body and all three regions in the same direction. The dark background is less luminous than the light background in each. A brief transition is allowed if it settles within five seconds.
  • Each effective background changes by at least 32 on the weighted RGB scale 0.2126R + 0.7152G + 0.0722B, using 0–255 channel values. Transparent regions may inherit their parent backgrounds.
  • Repeated clicks alternate between the same two visual states; ten toggles restore the initial state. A refresh preserves the selected theme between clicks.
  • Toggling and refreshing do not alter page text or cause browser errors.