Skip to content

refactor: extract styled-components definitions to theme config - #519

Open
olutundee wants to merge 4 commits into
Heliobond:mainfrom
olutundee:refactor/issue-416-extract-styled-components-theme
Open

refactor: extract styled-components definitions to theme config#519
olutundee wants to merge 4 commits into
Heliobond:mainfrom
olutundee:refactor/issue-416-extract-styled-components-theme

Conversation

@olutundee

Copy link
Copy Markdown

Overview

Extracts scattered styled definitions, inline colors, spacing tokens, and recurring style objects into a centralized, typed theme configuration system under src/theme/.

Related Issue

Closes #416

Changes

Theme System

  • [ADD] src/theme/colors.ts
    • Defines light and dark palette constants, semantic color tokens, and CSS custom property bindings.
  • [ADD] src/theme/spacing.ts
    • Defines 4px spacing scale, layout dimensions, border radii, and z-index hierarchy.
  • [ADD] src/theme/typography.ts
    • Defines typography constants for font families, sizes, weights, and letter spacings.
  • [ADD] src/theme/shadows.ts & src/theme/breakpoints.ts
    • Defines elevation shadows and responsive breakpoint media query helpers.
  • [ADD] src/theme/styles.ts
    • Consolidates recurring typed style objects (CSSProperties) for cards, headings, inputs, tables, statistics, and forms.
  • [ADD] src/theme/theme.ts & src/theme/index.ts
    • Aggregates all token categories into a unified theme object with full TypeScript type exports.
  • [ADD] src/theme/theme.test.ts
    • Adds comprehensive unit tests verifying token values, design token parity, and style object integrity.

Screens & Components

  • [MODIFY] src/screens/sharedStyles.ts
    • Re-exports theme style definitions and tokens for backward compatibility.
  • [MODIFY] src/screens/creator/CreatorApplication.tsx, CreatorDashboard.tsx, ProjectBuilder.tsx
    • Replaced scattered local style declarations with centralized theme imports.
  • [MODIFY] src/screens/admin/AdminConsole.tsx, OracleForms.tsx, RegistryTable.tsx
    • Replaced duplicate local style constants with centralized theme imports.
  • [MODIFY] src/screens/Portfolio.tsx
    • Replaced local card title style with centralized theme import.

Verification Results

✓ 31 test files passed (265 tests)
✓ TypeScript check passed (0 errors)
Acceptance Criteria Status
Extract colors and spacing to theme configuration ✅ Done
Eliminate scattered local style duplications ✅ Done
All automated tests & typechecks pass ✅ Done

@olutundee
olutundee requested a review from dadadave80 as a code owner August 31, 2026 15:55
@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

@olutundee is attempting to deploy a commit to the David Dada's projects Team on Vercel.

A member of the Team first needs to authorize it.

@sshdopey sshdopey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a solid refactor that centralizes scattered styles into a typed theme system under src/theme/, exactly addressing issue #416. The new token files, style objects, and tests are well-organized and the screens/components are updated to use them. I see some unrelated fixes (like the Explore pagination change and translation additions) that might be from a merge, but they don't detract from the core effort. Great work on the comprehensive theme configuration and keeping everything type-safe! 💚

@sshdopey

Copy link
Copy Markdown
Contributor

Approved! 🎉 I couldn't auto-merge this just yet (it may need a rebase or have a check still running). A maintainer can merge it whenever it's ready.

@dadadave80 dadadave80 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please resolve conflicts

@drips-wave

drips-wave Bot commented Aug 31, 2026

Copy link
Copy Markdown

@olutundee Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@sshdopey sshdopey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a solid refactor that centralizes scattered styles into a well-organized theme system. The new src/theme/ directory with colors, spacing, typography, and style objects is exactly what issue #416 asked for, and the updates to screens and components show real effort in replacing local definitions. The tests and type checks passing is great to see. Nice work! 💚

@sshdopey

Copy link
Copy Markdown
Contributor

Approved! 🎉 I couldn't auto-merge this just yet (it may need a rebase or have a check still running). A maintainer can merge it whenever it's ready.

@sshdopey sshdopey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a solid refactor that centralizes scattered styles and tokens into a well-organized theme system. The new files are clean, typed, and tested, and the updates to screens and components look consistent. I noticed a few unrelated fixes bundled in (like typo corrections and i18n additions), which is fine for a hackathon PR. Great work on the theme extraction and keeping everything passing! Keep it up! ❤️

@sshdopey

Copy link
Copy Markdown
Contributor

Approved! 🎉 I couldn't auto-merge this just yet (it may need a rebase or have a check still running). A maintainer can merge it whenever it's ready.

@sshdopey sshdopey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a solid refactor that centralizes scattered styles into a typed theme system under src/theme/, exactly addressing issue #416. The new token files and style objects are well-organized, and the updates to screens and components show genuine effort to eliminate duplication. Tests and typechecks pass, which is great. I noticed a few unrelated changes mixed in (like i18n keys and a webpack config tweak), but they don't detract from the core work. Nice job! Keep up the good work! ❤️

@sshdopey

sshdopey commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Approved! 🎉 I couldn't auto-merge this just yet (it may need a rebase or have a check still running). A maintainer can merge it whenever it's ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: Styled-components definitions scattered across files — extract to theme

3 participants