diff --git a/src/components/BackToTop.tsx b/src/components/BackToTop.tsx index bae85f21..e11bf6a2 100644 --- a/src/components/BackToTop.tsx +++ b/src/components/BackToTop.tsx @@ -38,7 +38,7 @@ const BackToTop = (): JSX.Element | null => { animate={{ opacity: 1, y: 0 }} exit={{ opacity: 0, y: 50 }} transition={{ duration: 0.3 }} - className="fixed bottom-28 right-11 z-50 bg-black text-white px-4 py-3 rounded-full shadow-lg hover:scale-105 transition" + className="fixed bottom-28 right-11 z-50 rounded-full border border-cyan-200/70 bg-cyan-600 px-4 py-3 text-white shadow-lg shadow-cyan-900/30 transition hover:scale-105 hover:bg-cyan-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-cyan-300 focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:border-cyan-300/30 dark:bg-cyan-500 dark:hover:bg-cyan-400 dark:focus-visible:ring-offset-[#0a0e27]" aria-label="Back to Top" > ↑ diff --git a/tests/test_back_to_top_styles.py b/tests/test_back_to_top_styles.py new file mode 100644 index 00000000..5abef710 --- /dev/null +++ b/tests/test_back_to_top_styles.py @@ -0,0 +1,14 @@ +from pathlib import Path + + +REPO_ROOT = Path(__file__).resolve().parents[1] + + +def test_back_to_top_button_uses_high_contrast_theme_safe_styles(): + source = (REPO_ROOT / "src/components/BackToTop.jsx").read_text(encoding="utf-8") + + assert "bg-cyan-600" in source + assert "hover:bg-cyan-500" in source + assert "dark:bg-cyan-500" in source + assert "dark:hover:bg-cyan-400" in source + assert "focus-visible:ring-cyan-300" in source