Skip to content

Commit

Permalink
more themes
Browse files Browse the repository at this point in the history
  • Loading branch information
sphinxrave committed Oct 25, 2024
1 parent fc56fd5 commit 922d26b
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/react/src/components/layout/InlayContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export function InlayContainer({ routes }: InlayContainerProps) {
{t("component.mainNav.back")}
</Button>
</div>
<div className="w-full rounded-lg bg-base-2 p-2 md:p-4 xl:p-8">
<div className="w-full rounded-lg bg-baseA-2 p-2 md:p-4 xl:p-8">
<Suspense fallback={<Loading size="xl" />}>
<Outlet />
</Suspense>
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/hooks/useTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export function useThemeInit() {

useEffect(() => {
setCssVariable("base", BASE_MAPPING[primary] || primary);
setCssVariable("base", BASE_MAPPING[primary] || primary, true);
setCssVariable("primary", primary);
setCssVariable("primary", primary, true);
}, [primary]);
Expand Down
35 changes: 33 additions & 2 deletions packages/react/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,40 @@ High Constrast Color Theme management:
*/

body {
--primary-fg: var(--primary-12);
--secondary-fg: var(--secondary-12);
--primary-fg: var(--primary-1);
--secondary-fg: var(--secondary-1);
}

body.dark {
background:
radial-gradient(
circle at 20% 20%,
var(--primary-1) 0%,
transparent 50%
),
radial-gradient(
circle at 80% 80%,
var(--secondary-1) 0%,
transparent 50%
),
var(--base-1);
}

body {
background:
radial-gradient(
circle at 20% 20%,
var(--primary-1) 0%,
transparent 50%
),
radial-gradient(
circle at 80% 80%,
var(--secondary-1) 0%,
transparent 50%
),
var(--base-1);
}

body.hc-secondary {
--secondary-fg: var(--base-1)
}
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/routes/settings/appearance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const SettingsTheme = () => {
const [dark, setDark] = useAtom(darkAtom);
const [primary, setPrimary] = useAtom(primaryAtom);
const [secondary, setSecondary] = useAtom(secondaryAtom);
const { size, setSize } = useVideoCardSizes(["lg", "md", "sm"]);
const { size, setSize } = useVideoCardSizes(["lg", "md", "list"]);
const [hideThumbnail, setHideThumbnail] = useAtom(hideThumbnailAtom);
const [useENName, setUseENName] = useAtom(englishNameAtom);

Expand All @@ -45,7 +45,7 @@ export const SettingsTheme = () => {
icon: "i-lucide:grid-3x3",
},
{
value: "sm",
value: "list",
label: t("views.settings.gridSize.2"),
icon: "i-lucide:list",
},
Expand Down
2 changes: 2 additions & 0 deletions packages/react/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ function configureDefaultColorSpaceForTextOnSolid(level) {
},
secondaryA: { DEFAULT: `var(--secondary-a${level})` },
base: { DEFAULT: `var(--base-${level})` },
baseA: { DEFAULT: `var(--baseA-${level})` },
};
}

Expand Down Expand Up @@ -63,6 +64,7 @@ const config = {
colors: {
muted: "var(--base-8)", // muted is the same as base-8
base: getColorSpace("base"),
baseA: getColorSpace("baseA"),
primary: getColorSpace("primary"),
primaryA: getColorSpace("primaryA"),
secondary: getColorSpace("secondary"),
Expand Down

0 comments on commit 922d26b

Please sign in to comment.