Skip to content
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

feat: migration to scss #1441

Merged
merged 18 commits into from
Feb 3, 2025
Merged

feat: migration to scss #1441

merged 18 commits into from
Feb 3, 2025

Conversation

zamitto
Copy link
Collaborator

@zamitto zamitto commented Feb 2, 2025

No description provided.

Hachi-R and others added 8 commits February 1, 2025 16:34
# Conflicts:
#	src/renderer/src/app.css.ts
#	src/renderer/src/components/toast/toast.tsx
#	src/renderer/src/pages/game-details/modals/repacks-modal.scss
#	src/renderer/src/pages/game-details/modals/repacks-modal.tsx
#	src/renderer/src/pages/game-details/sidebar/how-long-to-beat-section.tsx
#	src/renderer/src/pages/home/home.tsx
#	src/renderer/src/theme.css.ts
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR implements a comprehensive migration from Vanilla Extract CSS-in-TS to SCSS across the entire application. Here's a concise summary of the key changes:

  • Removed all Vanilla Extract dependencies (@vanilla-extract/css, @vanilla-extract/dynamic, @vanilla-extract/recipes) and added sass-embedded for SCSS support
  • Migrated all .css.ts files to .scss, implementing BEM methodology for class naming and proper SCSS nesting
  • Replaced theme.css.ts variables with SCSS global variables in globals.scss
  • Updated electron.vite.config.ts with SCSS preprocessor configuration
  • Converted inline styles to SCSS classes across components

Key points to review:

  • Verify that hardcoded color values (e.g. '#1c1c1c' in profile.tsx) are moved to SCSS variables for consistency
  • Check that fixed widths (e.g. 500px in add-download-source-modal.scss) are responsive
  • Ensure all animations and transitions are properly migrated from keyframes
  • Review accessibility of color contrast with new SCSS implementation
  • Test responsive layouts thoroughly as spacing units changed from dynamic to static values

172 file(s) reviewed, 144 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines +16 to +17
backdrop-filter: blur(2px);
transition: all ease 0.2s;
Copy link
Contributor

Choose a reason for hiding this comment

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

style: transition: all is expensive for performance. Consider transitioning only backdrop-filter and background-color properties.

@@ -7,5 +7,6 @@
border: solid 1px globals.$muted-color;
border-radius: 4px;
display: flex;
gap: 4px;
Copy link
Contributor

Choose a reason for hiding this comment

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

style: consider using globals.$spacing-unit / 2 to maintain consistency with the padding definition on line 6

Comment on lines +27 to +29
&:hover:not(:has(input:disabled)) {
border-color: rgba(255, 255, 255, 0.5);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

style: The hover state uses a hardcoded rgba value instead of a global variable. Consider using a theme variable for consistency.

justify-content: center;
align-items: center;
position: relative;
transition: all ease 0.2s;
Copy link
Contributor

Choose a reason for hiding this comment

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

style: transition: all is performance-intensive. Consider specifying only the properties that need to transition (border-color, opacity).

<div className={styles.checkbox({ checked: props.checked })}>
<div className="checkbox-field">
<div
className={`checkbox-field__checkbox ${props.checked ? "checked" : ""}`}
Copy link
Contributor

Choose a reason for hiding this comment

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

style: template literal could be simplified to use BEM modifier class instead

flex-direction: column;
gap: calc(globals.$spacing-unit * 2);
max-height: 400px;
overflow-y: scroll;
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Use overflow-y: auto instead of scroll to prevent showing scrollbar when not needed

Suggested change
overflow-y: scroll;
overflow-y: auto;

Comment on lines +14 to +16
&__submit-button {
align-self: flex-end;
width: 100%;
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: The submit button has both align-self: flex-end and width: 100%, which appears contradictory since a full-width element cannot be aligned to the end

}

&__button {
align-self: end;
Copy link
Contributor

Choose a reason for hiding this comment

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

style: align-self: end is not as widely supported as align-self: flex-end

Suggested change
align-self: end;
align-self: flex-end;

display: flex;
gap: calc(globals.$spacing-unit / 2);
align-items: center;
transition: all ease 0.2s;
Copy link
Contributor

Choose a reason for hiding this comment

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

style: transition: all ease 0.2s is performance-intensive. Consider transitioning only the color property since that's all that changes on hover.

Suggested change
transition: all ease 0.2s;
transition: color ease 0.2s;

Comment on lines +17 to +28
&__friend-code-button {
color: globals.$body-color;
cursor: pointer;
display: flex;
gap: calc(globals.$spacing-unit / 2);
align-items: center;
transition: all ease 0.2s;

&:hover {
color: globals.$muted-color;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: friend-code-button lacks focus styles for keyboard navigation. Should match hover state for accessibility.

Suggested change
&__friend-code-button {
color: globals.$body-color;
cursor: pointer;
display: flex;
gap: calc(globals.$spacing-unit / 2);
align-items: center;
transition: all ease 0.2s;
&:hover {
color: globals.$muted-color;
}
}
&__friend-code-button {
color: globals.$body-color;
cursor: pointer;
display: flex;
gap: calc(globals.$spacing-unit / 2);
align-items: center;
transition: color ease 0.2s;
&:hover,
&:focus {
color: globals.$muted-color;
}
}

@zamitto zamitto requested a review from Hachi-R February 3, 2025 01:02
Copy link

sonarqubecloud bot commented Feb 3, 2025

Copy link
Collaborator

@Hachi-R Hachi-R left a comment

Choose a reason for hiding this comment

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

LGTM

@zamitto zamitto merged commit 70fcc6e into main Feb 3, 2025
4 checks passed
@zamitto zamitto deleted the feat/migration-to-scss-3-remake branch February 3, 2025 01:49
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.

2 participants