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(ui): add dark mode #1998

Merged
merged 53 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
135b187
Add next-themes package dependency
RichardKruemmel May 7, 2024
23fc1c2
Add dark mode theme provider component
RichardKruemmel May 7, 2024
a43e375
Add theming guidelines to CONTRIBUTING.md
RichardKruemmel May 7, 2024
73a1a10
Update web/src/pages/_app.tsx
RichardKruemmel May 8, 2024
4b1a079
Update theming approach to include shadcn color palette.
RichardKruemmel May 8, 2024
903d819
Merge branch 'main' into richard/lfe-1082
RichardKruemmel May 14, 2024
b098256
Update theming guidelines and add new color definitions
RichardKruemmel May 14, 2024
bc23596
feat(ui): implement dark mode (#2013)
RichardKruemmel May 15, 2024
294cc89
Add muted-gray color to tailwind.config.ts
RichardKruemmel May 17, 2024
cb00e30
Update badge color in StatusBadge component
RichardKruemmel May 17, 2024
390b196
Refactor UI styling in IOPreview and OpenAiMessageView components
RichardKruemmel May 17, 2024
4e31235
Update text color in ObservationTree component
RichardKruemmel May 17, 2024
6f54412
Update dialog overlay background opacity
RichardKruemmel May 17, 2024
325cb64
Refactor input component styles
RichardKruemmel May 17, 2024
81ac3f7
Refactor NoData component styling
RichardKruemmel May 17, 2024
9776cb7
Update color variables in globals.css
RichardKruemmel May 17, 2024
937b474
Update color variables in globals.css and tailwind.config.ts
RichardKruemmel May 21, 2024
26598f0
Update TableLink styles
RichardKruemmel May 21, 2024
09bab1d
Update styling for IOPreview and OpenAiMessageView components
RichardKruemmel May 21, 2024
15edd71
Refactor CodeJsonViewer component
RichardKruemmel May 21, 2024
cd37bfd
Merge branch 'main' into richard/lfe-1082
RichardKruemmel May 21, 2024
c7cf199
Update layout styling in layout.tsx
RichardKruemmel May 21, 2024
dbc39d5
Add muted-primary-accent color to globals.css and tailwind.config.ts
RichardKruemmel May 21, 2024
39633ce
Update text color for disabled elements in ModelParameters component
RichardKruemmel May 21, 2024
f97af97
Refactor DataTable styling
RichardKruemmel May 21, 2024
1c14a86
Update table header background color
RichardKruemmel May 21, 2024
24075aa
Update Divider color in Variables component
RichardKruemmel May 21, 2024
c80a737
Update text color and class names in AuthCloudRegionSwitch component
RichardKruemmel May 21, 2024
e398208
Refactor tab component styles
RichardKruemmel May 21, 2024
96e67bf
Update sign-up link styling
RichardKruemmel May 21, 2024
1a471e4
Reorder class names in Sign Up page link
RichardKruemmel May 21, 2024
b4cd8a3
Update '@tanstack/react-virtual' version to 3.5.0
RichardKruemmel May 21, 2024
5ead61f
Update color variables in globals.css and tailwind.config.ts
RichardKruemmel May 21, 2024
14a8652
Update hover text color in sign-in and sign-up links
RichardKruemmel May 21, 2024
a835919
Update DatasetActionButton styles
RichardKruemmel May 21, 2024
144229f
Fix styling issue in UserPage component
RichardKruemmel May 21, 2024
c4f90df
Update tab component styles
RichardKruemmel May 21, 2024
f1e1a8f
Update class names and remove unnecessary styling in AuthCloudRegionS…
RichardKruemmel May 21, 2024
d9c50d0
Update TableLink styling
RichardKruemmel May 21, 2024
95e32cb
Fix styling issue in OpenAiMessageView component
RichardKruemmel May 21, 2024
5ad2f3c
Refactor CodeJsonViewer component
RichardKruemmel May 21, 2024
2c23ae5
Update CSS variables and color conventions
RichardKruemmel May 21, 2024
3f5692f
Update layout styling in Layout component
RichardKruemmel May 21, 2024
2cfe139
Update status colors in DatasetItemsTable
RichardKruemmel May 21, 2024
9d0c4f1
Refactor TagInput component styles
RichardKruemmel May 21, 2024
08cfa1a
Merge branch 'main' into richard/lfe-1082
RichardKruemmel May 21, 2024
faf3052
Update Card class in TraceCardList component
RichardKruemmel May 21, 2024
ebd751b
Update Langchain input in QuickstartExamples.tsx
RichardKruemmel May 21, 2024
0b1aa06
use typing
marcklingen May 21, 2024
1420639
Fix typo
RichardKruemmel May 22, 2024
3bc892d
Change to default light mode
RichardKruemmel May 22, 2024
6f193ca
Fix userNavigation
RichardKruemmel May 22, 2024
3e06c59
Revert default theme to system
RichardKruemmel May 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 28 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,34 @@ When a new release is tagged on the `main` branch (excluding prereleases), it tr
1. The Docker image is published to GitHub Packages with the version number and `latest` tag.
2. The deployment is carried out on Langfuse Cloud. This is done by force pushing the `main` branch to the `production` branch during every release, using the [`release.yml`](.github/workflows/release.yml) GitHub Action.

## Theming

At Langfuse, we utilize CSS variables to manage our theme settings across the platform.

Our approach leverages separate CSS variables for backgrounds (--background) and foregrounds (--foreground), fully adhering to the [shadcn/ui](https://ui.shadcn.com/docs/theming) color conventions. We recommend using HSL values for these colors to enhance consistency and customization.

### Adding New Colors

1. Global Definitions: Add new CSS variable definitions in the global.css file.
2. Tailwind Configuration: Reflect these new colors in the tailwind.config.js to maintain alignment with Tailwind's utility classes.

### Utility Classes
RichardKruemmel marked this conversation as resolved.
Show resolved Hide resolved

- Border Color: `border`
- Primary Text: `primary`
- Secondary Text: `muted-foreground`
- Hover States: Use `primary-foreground` or `accent`
- Background: `background`
- Main Content: `foreground`
- Primary Color: `primary`
- Accents: `primary-accent`
- Selectable Items: `input`
- Link Background: `muted-indigo`
RichardKruemmel marked this conversation as resolved.
Show resolved Hide resolved
- Link Text: `accent-dark-blue`
- Link Hover: `accent-light-blue`

By following these guidelines, you can ensure that any contributions to our theme are consistent, maintainable, and aligned with our design system.

## Using secrets stored in 1Password

When applying changes to non-local environments, you may need to use secrets stored in 1Password. We use the 1Password CLI for this purpose.
Expand Down
13 changes: 13 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
"next": "^14.2.3",
"next-auth": "^4.24.7",
"next-query-params": "^5.0.0",
"next-themes": "^0.3.0",
"nodemailer": "^6.9.13",
"posthog-js": "^1.122.0",
"posthog-node": "^3.6.3",
Expand Down
9 changes: 9 additions & 0 deletions web/src/features/darkmode/ThemeProvider.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"use client";

import * as React from "react";
import { ThemeProvider as NextThemesProvider } from "next-themes";
import { type ThemeProviderProps } from "next-themes/dist/types";

export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
return <NextThemesProvider {...props}>{children}</NextThemesProvider>;
}
16 changes: 12 additions & 4 deletions web/src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import "core-js/features/array/to-sorted";
import "react18-json-view/src/style.css";
import { DetailPageListsProvider } from "@/src/features/navigate-detail-pages/context";
import { env } from "@/src/env.mjs";
import { ThemeProvider } from "@/src/features/darkmode/ThemeProvider";

const setProjectInPosthog = () => {
// project
Expand Down Expand Up @@ -87,10 +88,17 @@ const MyApp: AppType<{ session: Session | null }> = ({
<PostHogProvider client={posthog}>
<SessionProvider session={session} refetchOnWindowFocus={true}>
<DetailPageListsProvider>
<Layout>
<Component {...pageProps} />
<UserTracking />
</Layout>
<ThemeProvider
attribute="class"
defaultTheme="light"
enableSystem={false}
disableTransitionOnChange
>
<Layout>
<Component {...pageProps} />
<UserTracking />
</Layout>
</ThemeProvider>
<CrispWidget />
</DetailPageListsProvider>
</SessionProvider>
Expand Down