Phase 7.2a: Migrate Page Components from styled-components to plain CSS#3054
Open
OpenStaxClaude wants to merge 4 commits into
Open
Phase 7.2a: Migrate Page Components from styled-components to plain CSS#3054OpenStaxClaude wants to merge 4 commits into
OpenStaxClaude wants to merge 4 commits into
Conversation
Migrated 5 Page/* component files to use plain CSS instead of styled-components: - MediaModal.tsx - Full-screen modal for enlarged media - MinPageHeight.tsx - Minimum page height container - PageNotFound.tsx - 404 error page display - PageToasts.tsx - Toast notification container with complex positioning - RedoPadding.tsx - Wrapper padding component Changes: - Created accompanying .css files for each migrated component - Replaced styled-components with plain CSS classes and CSS variables - Updated components to use classNames utility for className composition - Migrated from React.FC to normal function declarations - Added React.forwardRef where components receive refs - Updated connector.ts to use React.ComponentType instead of StyledComponent Following hybrid migration approach from PLAIN_CSS_MIGRATION_LEARNINGS.md: - Used CSS variables for dynamic values (theme colors, z-indices, spacing) - Documented media query breakpoints with calculations - Maintained all existing functionality and styling - No breaking changes to component APIs 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Migrates several src/app/content/components/Page/* components from styled-components to plain CSS, introducing co-located .css files and CSS-variable-based dynamic values while keeping component APIs largely intact.
Changes:
- Replaced styled-components wrappers with plain elements +
classNamecomposition and new.cssfiles for Page-level UI components (modal, padding/min-height containers, 404 page, toast container). - Introduced CSS variables (via inline
style) to preserve dynamic theme/constants-driven values (z-indexes, breakpoints, spacing, computed offsets). - Updated typing in the Page connector and refreshed Jest snapshots impacted by the styling migration.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/app/content/components/Page/RedoPadding.tsx | Replaces styled wrapper with forwardRef div + CSS variables and className. |
| src/app/content/components/Page/RedoPadding.css | Adds plain CSS equivalent of wrapper padding + responsive rules. |
| src/app/content/components/Page/PageToasts.tsx | Replaces styled toast container with plain div + CSS variables and className. |
| src/app/content/components/Page/PageToasts.css | Adds plain CSS for sticky toast positioning and responsive calculations. |
| src/app/content/components/Page/PageNotFound.tsx | Replaces styled 404 layout with class-based markup + CSS variable for text color. |
| src/app/content/components/Page/PageNotFound.css | Adds plain CSS for 404 layout + mobile margin adjustment. |
| src/app/content/components/Page/MinPageHeight.tsx | Replaces styled min-height wrapper with forwardRef div + CSS variables. |
| src/app/content/components/Page/MinPageHeight.css | Adds plain CSS for min-height calculation (desktop/mobile). |
| src/app/content/components/Page/MediaModal.tsx | Replaces styled modal structure with class-based markup + CSS variables for computed sizing. |
| src/app/content/components/Page/MediaModal.css | Adds plain CSS for modal layout, close button positioning, and scrollable content. |
| src/app/content/components/Page/connector.ts | Adjusts ToastOverride typing away from styled-components-specific types. |
| src/app/content/components/Page/snapshots/PageToasts.spec.tsx.snap | Snapshot updates reflecting className/CSS-variable rendering. |
| src/app/content/components/Page/snapshots/MediaModal.spec.tsx.snap | Snapshot updates reflecting className/CSS-variable rendering. |
| src/app/content/snapshots/routes.spec.tsx.snap | Snapshot updates reflecting downstream rendered markup changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
87d7f56 to
e4fcbdf
Compare
b90f5e4 to
bf3d4a9
Compare
bf3d4a9 to
a0cd43c
Compare
Update routes.spec.tsx.snap Co-Authored-By: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
a0cd43c to
b7f8142
Compare
10 tasks
OpenStaxClaude
added a commit
that referenced
this pull request
Jul 2, 2026
Migrated BookBanner.tsx (~350 lines) from styled-components to plain CSS: - Converted 8 styled-components to plain CSS + React components - Inlined applyBookTextColor utility (only used in BookBanner) - Maintained gradient backgrounds, scroll animations, and two variants (big/mini) - Preserved all responsive behavior and accessibility features Key Changes: - Created BookBanner.css with comprehensive styles for both variants - Replaced styled-components with functional components using classNames - Used CSS variables for dynamic values (gradients, colors, z-indices, heights) - Maintained scroll-based transition behavior between big/mini variants - Added React.forwardRef to BarWrapper for proper ref forwarding Technical Details: - Gradient backgrounds computed dynamically from theme and colorSchema prop - Text colors applied via CSS variables from theme.color.primary[colorSchema].foreground - Responsive breakpoints documented with calculations - Preserved disabled print styling via CSS @media print rules - ChevronLeftIcon migrated to plain SVG component Following patterns from PLAIN_CSS_MIGRATION_LEARNINGS.md 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
33e0684 to
d51d1ab
Compare
RoyEJohnson
pushed a commit
that referenced
this pull request
Jul 2, 2026
Migrated BookBanner.tsx (~350 lines) from styled-components to plain CSS: - Converted 8 styled-components to plain CSS + React components - Inlined applyBookTextColor utility (only used in BookBanner) - Maintained gradient backgrounds, scroll animations, and two variants (big/mini) - Preserved all responsive behavior and accessibility features Key Changes: - Created BookBanner.css with comprehensive styles for both variants - Replaced styled-components with functional components using classNames - Used CSS variables for dynamic values (gradients, colors, z-indices, heights) - Maintained scroll-based transition behavior between big/mini variants - Added React.forwardRef to BarWrapper for proper ref forwarding Technical Details: - Gradient backgrounds computed dynamically from theme and colorSchema prop - Text colors applied via CSS variables from theme.color.primary[colorSchema].foreground - Responsive breakpoints documented with calculations - Preserved disabled print styling via CSS @media print rules - ChevronLeftIcon migrated to plain SVG component Following patterns from PLAIN_CSS_MIGRATION_LEARNINGS.md 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
jivey
reviewed
Jul 3, 2026
jivey
left a comment
Member
There was a problem hiding this comment.
Is it possible something is passing down an ariaLabel prop? Locally I see this in the console - it's not in production, so if not introduced here, maybe in a different PR?
Warning: Invalid ARIA attribute `ariaLabel`. Did you mean `aria-label`?
in div (at PopupStyles.tsx:94)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR migrates Page component files and BookBanner from styled-components to plain CSS as part of Phase 7.2 of the CSS migration effort (CORE-2283).
Scope
Migrated 6 component files:
Page/ components:*
Migration Approach
Following the hybrid approach documented in
PLAIN_CSS_MIGRATION_LEARNINGS.md:.tsxfiles.cssfiles with plain CSS stylesKey Changes
Component Updates
styled-componentswithclassNamesutility for className compositionReact.FCto normal function declarations (following best practices)React.forwardReffor components that receive refs (MinPageHeight, RedoPadding, BarWrapper)CSS Implementation
@mediaqueries are at top level (not nested)Type Updates
connector.tsto useReact.ComponentTypeinstead ofStyledComponenttypeTesting Checklist
Related Jira Ticket
CORE-2283: Phase 7.2: Migrate Page & Toolbar Components
Notes
🤖 Generated with Claude Code