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

Feature/custom themes #1409

Draft
wants to merge 85 commits into
base: main
Choose a base branch
from
Draft

Feature/custom themes #1409

wants to merge 85 commits into from

Conversation

Hachi-R
Copy link
Collaborator

@Hachi-R Hachi-R commented Jan 19, 2025

this pr add the possibility of create, import, edit and manage custom themes

@Hachi-R Hachi-R marked this pull request as draft January 19, 2025 00:36
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 migrates the application's styling system from CSS-in-JS (vanilla-extract) to SCSS to support custom theme functionality.

  • Added new customStyles field in settings-general.tsx but implementation is incomplete - value is stored but not used for theme application
  • Potential accessibility issues with hardcoded colors in new SCSS files (e.g. link.scss using #c0c1c7) instead of theme variables
  • Backdrop blur effects in backdrop.scss may cause performance issues on lower-end devices
  • Container query in profile-content.css.ts uses hardcoded 'app-container' string instead of imported variable
  • Toast component positioning relies on hardcoded bottom panel height (26px) which could break if panel height changes

💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!

46 file(s) reviewed, 49 comment(s)
Edit PR Review Bot Settings | Greptile

z-index: globals.$backdrop-z-index;
top: 0;
padding: calc(globals.$spacing-unit * 3);
backdrop-filter: blur(2px);
Copy link
Contributor

Choose a reason for hiding this comment

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

style: backdrop-filter has limited browser support and can cause performance issues. Consider adding -webkit-backdrop-filter for Safari support and a fallback for unsupported browsers.

top: 0;
padding: calc(globals.$spacing-unit * 3);
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: transitioning 'all' properties can impact performance. Consider transitioning only specific properties like opacity and backdrop-filter.

.backdrop {
animation-name: backdrop-fade-in;
animation-duration: 0.4s;
background-color: rgba(0, 0, 0, 0.7);
Copy link
Contributor

Choose a reason for hiding this comment

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

style: background-color values should be defined in globals.scss for theme customization support


body {
overflow: hidden;
user-select: none;
Copy link
Contributor

Choose a reason for hiding this comment

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

style: user-select: none may cause accessibility issues by preventing text selection. Consider making this more selective or removing it.

Comment on lines +132 to +134
background: linear-gradient(270deg, #16b195 50%, #3e62c0 100%);
background-clip: text;
color: transparent;
Copy link
Contributor

Choose a reason for hiding this comment

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

syntax: background-clip: text requires -webkit prefix for full browser support

Suggested change
background: linear-gradient(270deg, #16b195 50%, #3e62c0 100%);
background-clip: text;
color: transparent;
-webkit-background-clip: text;
background-clip: text;
color: transparent;

Comment on lines 41 to 46
&::-webkit-progress-bar {
background-color: globals.$dark-background-color;
}
&::-webkit-progress-value {
background-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.

style: Progress bar styles only work in WebKit browsers. Consider adding standard progress element styles for cross-browser compatibility

@@ -32,6 +32,8 @@ export function SettingsGeneral() {
repackUpdatesNotificationsEnabled: false,
achievementNotificationsEnabled: false,
language: "",

customStyles: window.localStorage.getItem("customStyles") || "",
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: customStyles is initialized from localStorage but never persisted back when changed via handleChange

@@ -136,7 +138,7 @@ export function SettingsGeneral() {
}))}
/>

<h3>{t("notifications")}</h3>
<p>{t("notifications")}</p>
Copy link
Contributor

Choose a reason for hiding this comment

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

style: changing from h3 to p reduces semantic meaning and affects page hierarchy

"toast--closing": isClosing,
})}
>
<div className="toast__content">
<div style={{ display: "flex", gap: `${SPACING_UNIT}px` }}>
Copy link
Contributor

Choose a reason for hiding this comment

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

style: inline styles should be moved to SCSS for consistency with the theming system

$body-font-size: 14px;
$small-font-size: 12px;

$app-container: app-container;
Copy link
Contributor

Choose a reason for hiding this comment

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

style: $app-container should be prefixed with a namespace like $container-name-app to avoid potential naming collisions with other libraries

Hachi-R and others added 29 commits January 23, 2025 15:45
Copy link

sonarqubecloud bot commented Feb 1, 2025

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.

4 participants