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

Dark mode fixes #714

Merged
merged 3 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions client/src/javascript/ui/components/Panel.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import classnames from 'classnames';
import {FC, ReactNode} from 'react';
import ConfigStore from '@client/stores/ConfigStore';

interface PanelProps {
children: ReactNode;
theme?: 'light' | 'dark';
spacing?: 'small' | 'medium' | 'large';
transparent?: boolean;
}

const Panel: FC<PanelProps> = ({children, theme, spacing, transparent}: PanelProps) => {
const classes = classnames(`panel panel--${theme}`, `panel--${spacing}`, {
const Panel: FC<PanelProps> = ({children, spacing, transparent}: PanelProps) => {
const classes = classnames(`panel`, `panel--${spacing}`, {
'panel--transparent': transparent,
inverse: ConfigStore.isPreferDark,
});

return <div className={classes}>{children}</div>;
};

Panel.defaultProps = {
theme: 'light',
spacing: 'medium',
transparent: false,
};
Expand Down
3 changes: 2 additions & 1 deletion client/src/sass/components/_app-wrapper.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
@use '../tools/colors';
@use '../tools/themes';

.application {
&__loading-overlay {
align-items: center;
background: colors.$light-blue;
@include themes.theme('background', 'loading--background');
display: flex;
flex-direction: column;
font-size: 0.8em;
Expand Down
10 changes: 10 additions & 0 deletions client/src/sass/tools/_themes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ $themes: (
1px 0 colors.$action--border--hover,
-1px 0 colors.$action--border--hover,
),
auth-form--background: colors.$light-blue,
loading--background: colors.$light-blue,
torrent-view--background: #e9eef2,
torrent-list--background: #fff,
torrent-list--border: -1px 0 0 0 rgba(colors.$sidebar--background, 0.15),
Expand Down Expand Up @@ -86,6 +88,9 @@ $themes: (
0 0 30px rgba(#1a2f3d, 0.2),
0 0 0 1px rgba(#1a2f3d, 0.1),
),
panel--background: colors.$white,
panel--border: 1px solid colors.$grey--lighter,
panel--foreground: inherit,
progress-bar--fill: colors.$green,
progress-bar--fill--checking: #8899a8,
progress-bar--fill--completed: colors.$blue,
Expand Down Expand Up @@ -126,6 +131,8 @@ $themes: (
0px,
0px,
),
auth-form--background: colors.$background,
loading--background: colors.$background,
torrent-view--background: colors-dark.$md-surface-dark-e08,
torrent-list--background: colors-dark.$md-surface-dark,
torrent-list--border: -1px 0 0 0 rgba(colors.$sidebar--background, 0.15),
Expand Down Expand Up @@ -179,6 +186,9 @@ $themes: (
0 0 30px rgba(#1a2f3d, 0.2),
0 0 0 1px rgba(#1a2f3d, 0.1),
),
panel--background: colors.$another-grey,
panel--border: 1px solid colors.$dark-grey--light,
panel--foreground: color.adjust(#6c7e92, $lightness: 6%),
progress-bar--fill: colors.$green,
progress-bar--fill--checking: #8899a8,
progress-bar--fill--completed: colors.$blue,
Expand Down
9 changes: 4 additions & 5 deletions client/src/sass/ui/components/panel.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@use '../../tools/colors';
@use '../../tools/themes';

@use '../config/border-radius.scss';
@use '../config/spacing.scss';
Expand All @@ -10,9 +11,11 @@ $panel--spacing--horizontal--large: spacing.$spacing--xxx-large;
$panel--spacing--vertical--large: spacing.$spacing--xx-large;

.panel {
border: 1px solid colors.$grey--lighter;
@include themes.theme('background', 'panel--background');
@include themes.theme('border', 'panel--border');
border-radius: border-radius.$border-radius--medium;
box-shadow: panel--box-shadow(colors.$grey--lighter);
@include themes.theme('color', 'panel--foreground');
overflow: hidden;

&--medium {
Expand Down Expand Up @@ -105,8 +108,4 @@ $panel--spacing--vertical--large: spacing.$spacing--xx-large;
border-top: 1px solid colors.$grey--soft;
}
}

&--light {
background: #fff;
}
}
3 changes: 2 additions & 1 deletion client/src/sass/views/_login.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@use '../tools/colors';
@use '../tools/themes';
@use '../tools/variables';

$authentication--form--border: #d4dbe0;
Expand All @@ -14,7 +15,7 @@ $authentication--label--foreground: #3a5567;
.application {
&__view {
&--auth-form {
background: colors.$light-blue;
@include themes.theme('background', 'auth-form--background');
}
}
}
Expand Down
Loading