Skip to content

Commit 1c05791

Browse files
committed
fix: Theming adjustments and incorrect color fixes
1 parent 334885a commit 1c05791

File tree

14 files changed

+123
-83
lines changed

14 files changed

+123
-83
lines changed
Lines changed: 2 additions & 2 deletions
Loading

apps/frontend/src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import '@fontsource/poppins/600.css';
1010
import 'virtual:uno.css';
1111
import '@unocss/reset/tailwind.css';
1212
import 'overlayscrollbars/overlayscrollbars.css';
13-
import '~styles/themes.scss';
13+
import '~styles/themes/index.scss';
1414
import '~styles/globals.scss';
1515
import '~styles/highlightjs.css';
1616

apps/frontend/src/styles/globals.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
html, body, :root {
2+
@apply bg-page;
3+
}
4+
15
body {
26
@apply font-sans text-fg-primary text-md;
37
}

apps/frontend/src/styles/themes.scss renamed to apps/frontend/src/styles/themes/_OneLauncher.scss

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
@mixin define-theme($name, $selectors: "") {
2-
$selector: "#{$selectors} [data-theme="#{$name}"], .theme-#{$name}";
1+
@use "_helpers.scss" as * with (
2+
$name: "OneLauncher"
3+
);
34

4-
#{$selector} {
5-
@content;
6-
}
7-
}
5+
@include variant("Dark", ":root,") {
86

9-
@include define-theme("dark", ":root,") {
107
--clr-white: 255, 255, 255;
118
--clr-black: 0, 0, 0;
129

@@ -65,7 +62,7 @@
6562
--clr-secondary: 25, 32, 38;
6663
}
6764

68-
@include define-theme("light") {
65+
@include variant("Light") {
6966
--clr-white: 255, 255, 255;
7067
--clr-black: 0, 0, 0;
7168

@@ -122,5 +119,4 @@
122119
--clr-page-pressed: 230, 230, 230;
123120

124121
--clr-secondary: 220, 220, 220;
125-
126122
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
$name: "UNSET" !default;
2+
3+
@mixin variant($variant, $selectors: "") {
4+
#{$selectors} [data-theme="#{$name}-#{$variant}"], .theme-#{$name}-#{$variant} {
5+
@content;
6+
}
7+
}
8+
9+
@mixin extends-variant($variant, $extends, $selectors: "") {
10+
#{$selectors} [data-theme="#{$name}-#{$variant}"], .theme-#{$name}-#{$variant} {
11+
@extend [data-theme="#{$name}-#{$extends}"], .theme-#{$name}-#{$extends};
12+
@content;
13+
}
14+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@use "OneLauncher";

apps/frontend/src/ui/components/base/SelectList.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
@apply [&:nth-child(even)]:bg-white/01 hover:bg-component-bg-hover active:bg-component-bg-pressed;
77

88
&.selected {
9-
@apply bg-white/10;
9+
@apply bg-border/10;
1010
}
1111
}
1212
}

apps/frontend/src/ui/components/content/LauncherIcon.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import MultiMCImage from '~assets/logos/launchers/multimc.png';
77
import PrismIcon from '~assets/logos/launchers/prismlauncher.svg?component-solid';
88
import TechnicImage from '~assets/logos/launchers/technic.png';
99
import TLauncherImage from '~assets/logos/launchers/tlauncher.png';
10-
import ModrinthIcon from '~assets/logos/modrinth.svg?component-solid';
1110
import UnknownImage from '~assets/logos/minecraft.png';
11+
import ModrinthIcon from '~assets/logos/modrinth.svg?component-solid';
1212
import { type JSX, type JSXElement, Show, splitProps } from 'solid-js';
1313

1414
type ElementType = (props: any) => JSXElement;

apps/frontend/src/ui/components/game/LoaderIcon.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,18 @@ type LoaderIconProp = JSX.HTMLAttributes<HTMLImageElement> & {
2727

2828
function LoaderIcon(props: LoaderIconProp) {
2929
const [{ loader = 'vanilla' }, rest] = splitProps(props, ['loader']);
30+
31+
const isMonochrome = () => loader === 'forge';
32+
3033
return (
31-
<img {...rest} alt={`${loader}'s logo`} src={getLoaderLogoSrc(loader)} />
34+
<img
35+
{...rest}
36+
alt={`${loader}'s logo`}
37+
classList={{
38+
'filter-brightness-0': isMonochrome() && document.body.getAttribute('data-theme-type') === 'light',
39+
}}
40+
src={getLoaderLogoSrc(loader)}
41+
/>
3242
);
3343
}
3444

apps/frontend/src/ui/components/overlay/cluster/ClusterCreationModal.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,17 +167,17 @@ export function createClusterStep(props: CreateClusterStepType): () => JSX.Eleme
167167

168168
return (
169169
<div class="min-w-sm flex flex-col rounded-lg bg-page text-center">
170-
<div class="relative h-25 flex">
170+
<div class="theme-OneLauncher-Dark relative h-25 flex">
171171
<div class="absolute left-0 top-0 h-full w-full">
172172
<img alt="Header Image" class="h-full w-full rounded-t-lg" src={HeaderImage} />
173173
</div>
174174
<div
175175
class="absolute left-0 top-0 h-full flex flex-row items-center justify-start gap-x-4 bg-[radial-gradient(at_center,#00000077,transparent)] px-10"
176176
>
177-
<Server01Icon class="h-8 w-8" />
177+
<Server01Icon class="h-8 w-8 text-fg-primary" />
178178
<div class="flex flex-col items-start justify-center">
179-
<h1 class="h-10 -mt-2">New Cluster</h1>
180-
<span>{props.message}</span>
179+
<h1 class="h-10 text-fg-primary -mt-2">New Cluster</h1>
180+
<span class="text-fg-primary">{props.message}</span>
181181
</div>
182182
</div>
183183
</div>

0 commit comments

Comments
 (0)