-
Notifications
You must be signed in to change notification settings - Fork 0
Modernize UI design and accessibility #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,19 @@ | ||
| @import "tailwindcss"; | ||
|
|
||
| @theme inline { | ||
| --color-background: #0a0a14; | ||
| --color-surface: #12121f; | ||
| --color-surface-light: #1e1e30; | ||
| --color-foreground: #ffffff; | ||
| --color-foreground-muted: #a0a0b8; | ||
| --color-primary: #3b82f6; | ||
| --color-primary-hover: #2563eb; | ||
| --color-accent: #8b5cf6; | ||
| --color-border: #2a2a40; | ||
| --color-border-hover: #3b3b55; | ||
| --radius-sm: 0.375rem; | ||
| --radius-md: 0.5rem; | ||
| --radius-lg: 0.75rem; | ||
| :root { | ||
| --bg-base: #09090b; | ||
| --bg-surface: #18181b; | ||
| --bg-elevated: #27272a; | ||
| --text-primary: #fafafa; | ||
| --text-secondary: #a1a1aa; | ||
| --text-muted: #71717a; | ||
| --border-default: #3f3f46; | ||
| --border-subtle: #27272a; | ||
| --accent-blue: #3b82f6; | ||
| --accent-blue-hover: #2563eb; | ||
| --accent-blue-active: #1d4ed8; | ||
| --accent-violet: #8b5cf6; | ||
| --focus-ring: #60a5fa; | ||
| } | ||
|
|
||
| * { | ||
|
|
@@ -23,60 +23,220 @@ | |
| } | ||
|
|
||
| html { | ||
| background-color: var(--color-background); | ||
| background-color: var(--bg-base); | ||
| color-scheme: dark; | ||
| scroll-behavior: smooth; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: Consider honoring Global smooth scrolling can be uncomfortable for users with motion sensitivity. Wrap this in a media query, e.g. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1. Reduced-motion preference ignored app/globals.css enables smooth scrolling and motion effects unconditionally, which can cause discomfort for users who set prefers-reduced-motion. There is no CSS override to disable these behaviors when that accessibility preference is enabled. Agent Prompt
|
||
| } | ||
|
Comment on lines
+28
to
29
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add Smooth scrolling and global transitions/transforms are applied unconditionally. Add a reduced-motion override to avoid motion-triggered accessibility issues. Proposed fix html {
background-color: var(--bg-base);
color-scheme: dark;
scroll-behavior: smooth;
}
+
+@media (prefers-reduced-motion: reduce) {
+ html {
+ scroll-behavior: auto;
+ }
+
+ *,
+ *::before,
+ *::after {
+ animation: none !important;
+ transition: none !important;
+ }
+}Also applies to: 107-113, 131-166 🤖 Prompt for AI Agents |
||
|
|
||
| body { | ||
| color: var(--color-foreground); | ||
| background-color: var(--color-background); | ||
| color: var(--text-primary); | ||
| background-color: var(--bg-base); | ||
| font-family: | ||
| system-ui, | ||
| -apple-system, | ||
| BlinkMacSystemFont, | ||
| "Segoe UI", | ||
| Roboto, | ||
| "Helvetica Neue", | ||
| sans-serif; | ||
| line-height: 1.6; | ||
| -webkit-font-smoothing: antialiased; | ||
| -moz-osx-font-smoothing: grayscale; | ||
| } | ||
|
|
||
| /* Typography */ | ||
| h1, | ||
| h2, | ||
| h3, | ||
| h4, | ||
| h5, | ||
| h6 { | ||
| color: var(--color-foreground); | ||
| /* ======================================== | ||
| TYPOGRAPHY HIERARCHY | ||
| ======================================== */ | ||
|
|
||
| h1 { | ||
| font-size: 2rem; | ||
| font-weight: 700; | ||
| letter-spacing: -0.025em; | ||
| line-height: 1.2; | ||
| color: var(--text-primary); | ||
| } | ||
|
|
||
| h1 { | ||
| font-size: 2.5rem; | ||
| font-weight: 800; | ||
| letter-spacing: -0.025em; | ||
| @media (min-width: 640px) { | ||
| h1 { | ||
| font-size: 2.5rem; | ||
| } | ||
| } | ||
|
|
||
| h2 { | ||
| font-size: 1.25rem; | ||
| font-weight: 600; | ||
| letter-spacing: -0.01em; | ||
| line-height: 1.3; | ||
| color: var(--text-primary); | ||
| } | ||
|
|
||
| h3 { | ||
| font-size: 1.125rem; | ||
| font-weight: 600; | ||
| line-height: 1.4; | ||
| color: var(--text-primary); | ||
| } | ||
|
|
||
| p { | ||
| color: var(--color-foreground-muted); | ||
| line-height: 1.6; | ||
| color: var(--text-secondary); | ||
| line-height: 1.65; | ||
| } | ||
|
|
||
| /* Transitions */ | ||
| button, | ||
| a { | ||
| transition: all 0.2s ease-in-out; | ||
| /* ======================================== | ||
| FOCUS & ACCESSIBILITY | ||
| ======================================== */ | ||
|
|
||
| :focus-visible { | ||
| outline: 2px solid var(--focus-ring); | ||
| outline-offset: 2px; | ||
| } | ||
|
|
||
| /* Focus styles for accessibility */ | ||
| button:focus-visible, | ||
|
Comment on lines
+87
to
94
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| a:focus-visible { | ||
| outline: 2px solid var(--color-primary); | ||
| a:focus-visible, | ||
| input:focus-visible, | ||
| select:focus-visible, | ||
| textarea:focus-visible { | ||
| outline: 2px solid var(--focus-ring); | ||
| outline-offset: 2px; | ||
| } | ||
|
|
||
|
Comment on lines
100
to
+102
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 Info: The rule at Was this helpful? React with 👍 or 👎 to provide feedback. |
||
| /* ======================================== | ||
| INTERACTIVE ELEMENTS | ||
| ======================================== */ | ||
|
|
||
| button, | ||
| a, | ||
| input, | ||
| select, | ||
| textarea { | ||
| transition: all 0.15s ease-in-out; | ||
| } | ||
|
|
||
| /* Primary Button Base */ | ||
| .btn-primary { | ||
| display: inline-flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| padding: 0.625rem 1rem; | ||
| font-size: 0.875rem; | ||
| font-weight: 600; | ||
| color: white; | ||
| background-color: var(--accent-blue); | ||
| border: none; | ||
| border-radius: 0.5rem; | ||
| cursor: pointer; | ||
| transition: all 0.15s ease-in-out; | ||
| } | ||
|
|
||
| .btn-primary:hover { | ||
| background-color: var(--accent-blue-hover); | ||
| transform: translateY(-1px); | ||
| box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3); | ||
| } | ||
|
|
||
| .btn-primary:active { | ||
| background-color: var(--accent-blue-active); | ||
| transform: translateY(0); | ||
| box-shadow: none; | ||
| } | ||
|
|
||
| .btn-primary:focus-visible { | ||
| outline: 2px solid var(--focus-ring); | ||
| outline-offset: 2px; | ||
| } | ||
|
|
||
| /* ======================================== | ||
| CARD / PANEL STYLING | ||
| ======================================== */ | ||
|
|
||
| .card { | ||
| background-color: var(--bg-surface); | ||
| border: 1px solid var(--border-subtle); | ||
| border-radius: 0.75rem; | ||
| overflow: hidden; | ||
| transition: all 0.2s ease-in-out; | ||
| } | ||
|
|
||
| .card:hover { | ||
| border-color: var(--border-default); | ||
| box-shadow: | ||
| 0 8px 24px rgba(0, 0, 0, 0.4), | ||
| 0 0 0 1px rgba(255, 255, 255, 0.05); | ||
| transform: translateY(-2px); | ||
| } | ||
|
|
||
| /* ======================================== | ||
| HEADER / NAVIGATION | ||
| ======================================== */ | ||
|
|
||
| .site-header { | ||
| background-color: rgba(24, 24, 27, 0.85); | ||
| backdrop-filter: blur(12px); | ||
| -webkit-backdrop-filter: blur(12px); | ||
| border-bottom: 1px solid var(--border-subtle); | ||
| position: sticky; | ||
| top: 0; | ||
| z-index: 50; | ||
| } | ||
|
|
||
| /* ======================================== | ||
| BADGE / TAG STYLING | ||
| ======================================== */ | ||
|
|
||
| .badge { | ||
| display: inline-flex; | ||
| align-items: center; | ||
| padding: 0.25rem 0.625rem; | ||
| font-size: 0.75rem; | ||
| font-weight: 600; | ||
| letter-spacing: 0.01em; | ||
| border-radius: 0.375rem; | ||
| background-color: var(--accent-violet); | ||
| color: white; | ||
| box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); | ||
| } | ||
|
|
||
| /* ======================================== | ||
| SKIP LINK (Accessibility) | ||
| ======================================== */ | ||
|
|
||
| .skip-link { | ||
| position: absolute; | ||
| top: -100%; | ||
| left: 1rem; | ||
| z-index: 100; | ||
| padding: 0.75rem 1rem; | ||
| font-weight: 600; | ||
| color: white; | ||
| background-color: var(--accent-blue); | ||
| border-radius: 0.5rem; | ||
| text-decoration: none; | ||
| } | ||
|
|
||
| .skip-link:focus { | ||
| top: 1rem; | ||
|
Comment on lines
+211
to
+217
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 Info: CSS class The naming between CSS utility classes and CSS custom properties is mismatched: Was this helpful? React with 👍 or 👎 to provide feedback. |
||
| } | ||
|
|
||
| /* ======================================== | ||
| UTILITY CLASSES | ||
| ======================================== */ | ||
|
|
||
| .text-muted { | ||
| color: var(--text-secondary); | ||
| } | ||
|
|
||
| .text-subtle { | ||
| color: var(--text-muted); | ||
| } | ||
|
|
||
| .bg-base { | ||
| background-color: var(--bg-base); | ||
| } | ||
|
|
||
| .bg-surface { | ||
| background-color: var(--bg-surface); | ||
| } | ||
|
|
||
| .bg-elevated { | ||
| background-color: var(--bg-elevated); | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -48,35 +48,36 @@ | |||||||||||
| export default function Home() { | ||||||||||||
| return ( | ||||||||||||
| <> | ||||||||||||
| <a | ||||||||||||
| href="#game-list" | ||||||||||||
| className="sr-only focus:not-sr-only focus:absolute focus:top-4 focus:left-4 focus:z-50 focus:rounded-lg focus:bg-primary focus:px-4 focus:py-2 focus:text-white focus:font-semibold" | ||||||||||||
| > | ||||||||||||
| <a href="#game-list" className="skip-link"> | ||||||||||||
|
Check notice on line 51 in app/page.tsx
|
||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prevent skip-link target from being hidden by the sticky header.
Proposed fix- <ul
+ <ul
id="game-list"
- className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6"
+ className="scroll-mt-28 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6"
aria-label="Available games"
style={{ listStyle: "none", padding: 0, margin: 0 }}
>Also applies to: 77-79 🧰 Tools🪛 GitHub Check: Codacy Static Code Analysis[notice] 51-51: app/page.tsx#L51 [warning] 51-51: app/page.tsx#L51 🤖 Prompt for AI Agents |
||||||||||||
| Skip to game list | ||||||||||||
| </a> | ||||||||||||
|
|
||||||||||||
| <header className="sticky top-0 z-40 bg-surface/95 backdrop-blur-sm border-b border-border"> | ||||||||||||
| <div className="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-6"> | ||||||||||||
| <h1 className="text-3xl sm:text-4xl font-extrabold text-white tracking-tight"> | ||||||||||||
| Game Collection | ||||||||||||
| </h1> | ||||||||||||
| <p className="text-foreground-muted mt-2 text-base"> | ||||||||||||
| Discover our selection of fun and challenging games | ||||||||||||
| <header className="site-header"> | ||||||||||||
| <div className="max-w-6xl mx-auto px-6 py-8"> | ||||||||||||
|
Check notice on line 56 in app/page.tsx
|
||||||||||||
| <h1 className="text-balance">Game Collection</h1> | ||||||||||||
|
Check warning on line 57 in app/page.tsx
|
||||||||||||
| <p className="mt-3 text-base text-muted max-w-xl"> | ||||||||||||
|
Check warning on line 58 in app/page.tsx
|
||||||||||||
| Discover our selection of fun and challenging games to play | ||||||||||||
| </p> | ||||||||||||
| </div> | ||||||||||||
| </header> | ||||||||||||
|
|
||||||||||||
| <main id="main-content" className="min-h-screen bg-background"> | ||||||||||||
| <div className="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-12"> | ||||||||||||
| <main id="main-content" className="bg-base min-h-screen"> | ||||||||||||
|
Check notice on line 64 in app/page.tsx
|
||||||||||||
| <div className="max-w-6xl mx-auto px-6 py-10"> | ||||||||||||
|
Check notice on line 65 in app/page.tsx
|
||||||||||||
| <section aria-labelledby="games-heading"> | ||||||||||||
| <h2 id="games-heading" className="sr-only"> | ||||||||||||
| Available Games | ||||||||||||
| </h2> | ||||||||||||
| <div className="flex items-center justify-between mb-8"> | ||||||||||||
|
Check notice on line 67 in app/page.tsx
|
||||||||||||
| <h2 id="games-heading" className="text-xl font-semibold"> | ||||||||||||
|
Check warning on line 68 in app/page.tsx
|
||||||||||||
| All Games | ||||||||||||
| </h2> | ||||||||||||
| <span className="text-sm text-subtle"> | ||||||||||||
| {games.length} games available | ||||||||||||
| </span> | ||||||||||||
| </div> | ||||||||||||
|
|
||||||||||||
| <ul | ||||||||||||
| id="game-list" | ||||||||||||
| className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6 list-none p-0 m-0" | ||||||||||||
| className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6" | ||||||||||||
| aria-label="Available games" | ||||||||||||
| style={{ listStyle: "none", padding: 0, margin: 0 }} | ||||||||||||
| > | ||||||||||||
|
Comment on lines
79
to
81
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid using inline styles for layout and reset properties. These should be handled via Tailwind utility classes (e.g.,
Suggested change
|
||||||||||||
| {games.map((game) => ( | ||||||||||||
| <li key={game.id}> | ||||||||||||
|
|
@@ -87,6 +88,17 @@ | |||||||||||
| </section> | ||||||||||||
| </div> | ||||||||||||
| </main> | ||||||||||||
|
|
||||||||||||
| <footer | ||||||||||||
| className="bg-surface border-t" | ||||||||||||
|
Check notice on line 93 in app/page.tsx
|
||||||||||||
| style={{ borderColor: "var(--border-subtle)" }} | ||||||||||||
| > | ||||||||||||
| <div className="max-w-6xl mx-auto px-6 py-6"> | ||||||||||||
|
Check notice on line 96 in app/page.tsx
|
||||||||||||
| <p className="text-sm text-subtle text-center"> | ||||||||||||
|
Check warning on line 97 in app/page.tsx
|
||||||||||||
| Game Collection - Built with Next.js | ||||||||||||
| </p> | ||||||||||||
| </div> | ||||||||||||
| </footer> | ||||||||||||
| </> | ||||||||||||
| ); | ||||||||||||
| } | ||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 Info: Removal of
@theme inlinemeans custom colors are no longer available as Tailwind utilitiesThe old code registered custom colors via
@theme inline { ... }which allowed Tailwind v4 to generate utility classes likebg-background,text-foreground-muted,bg-primary, etc. The new code uses plain:rootCSS variables and hand-rolled utility classes instead. I verified that no old Tailwind theme utility class names are referenced anywhere in the codebase — the migration is complete. However, this is a deliberate architectural shift: future developers cannot use Tailwind's utility syntax (e.g.,bg-base/50for opacity variants or responsive variants likesm:bg-surface) with these custom colors. They must use the custom CSS classes or inline styles instead.Was this helpful? React with 👍 or 👎 to provide feedback.