Feature/css upgrade#70
Merged
Merged
Conversation
…ate storybook styles - Changed storybook styles from CSS to SCSS and created a new `storybook.scss` file. - Removed the old `styles.css` file and created a new `global.scss` for global styles. - Updated the TimeWarp story to import the new SCSS file.
…tyles, and update color variables across components
There was a problem hiding this comment.
Pull request overview
This PR migrates the app and Storybook styling from a single global styles.css to a combination of a small global SCSS reset plus component-scoped SCSS modules, updating React markup and tests to be resilient to CSS-module class hashing.
Changes:
- Replaced the legacy
src/styles.cssglobal stylesheet withsrc/styles/global.scssand component-scoped*.module.scssfiles. - Updated
App,TimePilotGame, andUpdateOverlayto use SCSS modules +classnames, addingfillViewportbehavior for the PWA shell. - Updated Storybook stories/styles to use
storybook.scss, and adjusted tests to query stabledata-*hooks instead of global class names.
Reviewed changes
Copilot reviewed 27 out of 28 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| WHATSNEW.md | Notes the styling migration in release notes. |
| src/styles/global.scss | Introduces a minimal global SCSS reset/base styles. |
| src/styles.css | Removes the legacy global stylesheet. |
| src/stories/TimeWarp.stories.tsx | Switches Storybook styling import to SCSS. |
| src/stories/TimePilotGame.stories.tsx | Switches Storybook styling import to SCSS and updates card class usage. |
| src/stories/Ticker.stories.tsx | Switches Storybook styling import to SCSS. |
| src/stories/Text.stories.tsx | Switches Storybook styling import to SCSS. |
| src/stories/Sprites.stories.tsx | Switches Storybook styling import to SCSS. |
| src/stories/Preroll.stories.tsx | Switches Storybook styling import to SCSS. |
| src/stories/Palette.stories.tsx | Switches Storybook styling import to SCSS. |
| src/stories/MenuRendering.stories.tsx | Switches Storybook styling import to SCSS. |
| src/stories/InputOverlays.stories.tsx | Switches Storybook styling import to SCSS. |
| src/stories/DebugOptions.stories.tsx | Switches Storybook styling import to SCSS. |
| src/stories/Audio.stories.tsx | Switches Storybook styling import to SCSS. |
| src/stories/Achievements.stories.tsx | Switches Storybook styling import to SCSS. |
| src/stories/storybook.scss | Refactors Storybook styles to SCSS with variables/mixins and nesting. |
| src/main.tsx | Updates app entry to import the new global SCSS. |
| src/components/UpdateOverlay.tsx | Converts overlay markup to SCSS module classes and adds stable data-* hooks. |
| src/components/UpdateOverlay.module.scss | Adds component-scoped styles for the update overlay. |
| src/components/TimePilotGame.tsx | Converts game host to SCSS module classes, adds fillViewport, and adds stable data-* hooks. |
| src/components/TimePilotGame.module.scss | Adds component-scoped styles for the game host/stage/filter layers and exit fallback. |
| src/components/tests/TimePilotGame.test.tsx | Updates selectors to use stable data-* hooks instead of removed global classes. |
| src/App.tsx | Converts the main shell/about/showcase markup to SCSS module classes; enables fill-viewport PWA layout. |
| src/App.module.scss | Adds component-scoped styles replacing former global shell/showcase/about CSS. |
| README.md | Documents the move to SCSS module styling. |
| package.json | Adds classnames and sass, and bumps version to 24.0.1. |
| package-lock.json | Lockfile updates for added dependencies/version bump. |
| .storybook/preview.ts | Updates Storybook to import the new global SCSS reset. |
Comments suppressed due to low confidence (1)
src/stories/storybook.scss:380
@include panel(...)setsborder, but.achievement-sprite-cardimmediately overridesborderagain. This is a bit redundant/confusing—consider extending the mixin to accept a border color (or moving the override into the mixin call pattern) so the intent is clearer and you avoid duplicated declarations.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
This pull request modernizes the styling approach for the project by migrating from a single global CSS file to component-scoped SCSS modules and updates related dependencies and documentation. It also updates the main application code to use the new SCSS modules for styling and introduces the
classnamespackage to manage class names more effectively.Styling migration and code updates:
src/App.tsxto use SCSS modules and theclassnamesutility for cleaner, more maintainable styling. (src/App.tsx, [1] [2] [3] [4] [5] [6] [7] [8].storybook/preview.ts, .storybook/preview.tsL4-R4)Dependency and configuration changes:
classnamesandsassas dependencies to support SCSS modules and class name composition. (package.json, [1] [2]24.0.1to reflect these significant changes. (package.json, package.jsonL4-R4)Documentation updates:
README.mdto mention SCSS module styling and document the new approach. (README.md, [1] [2]WHATSNEW.mdabout the migration to SCSS modules and the new styling structure. (WHATSNEW.md, WHATSNEW.mdR9-R10)