8000 Add purple UI theme by kylecarbs · Pull Request #18634 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

Add purple UI theme #18634

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

Closed
wants to merge 1 commit into from
Closed
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 8000
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions site/src/pages/UserSettingsPage/AppearancePage/AppearanceForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,19 @@ export const AppearanceForm: FC<AppearanceFormProps> = ({
theme={themes.dark}
onSelect={() => onChangeTheme("dark")}
/>
<ThemePreviewButton
displayName="Light"
active={currentTheme === "light"}
theme={themes.light}
onSelect={() => onChangeTheme("light")}
/>
</Stack>
<ThemePreviewButton
displayName="Light"
active={currentTheme === "light"}
theme={themes.light}
onSelect={() => onChangeTheme("light")}
/>
<ThemePreviewButton
displayName="Purple"
active={currentTheme === "purple"}
theme={themes.purple}
onSelect={() => onChangeTheme("purple")}
/>
</Stack>
</Section>
<div css={{ marginBottom: 48 }}></div>
<Section
Expand Down
6 changes: 4 additions & 2 deletions site/src/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { Theme as MuiTheme } from "@mui/material/styles";
import type * as monaco from "monaco-editor";
import type { Branding } from "./branding";
import dark from "./dark";
import purple from "./purple";
import type { NewTheme } from "./experimental";
import type { ExternalImageModeStyles } from "./externalImages";
import light from "./light";
Expand Down Expand Up @@ -31,8 +32,9 @@ export interface Theme extends Omit<MuiTheme, "palette"> {
export const DEFAULT_THEME = "dark";

const theme = {
dark,
light,
dark,
light,
purple,
} satisfies Record<string, Theme>;

export default theme;
33 changes: 33 additions & 0 deletions site/src/theme/purple/branding.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import type { Branding } from "../branding";
import colors from "../tailwindColors";

const branding: Branding = {
enterprise: {
background: colors.blue[950],
divider: colors.blue[900],
border: colors.blue[400],
text: colors.blue[50],
},
premium: {
background: colors.violet[950],
divider: colors.violet[900],
border: colors.violet[400],
text: colors.violet[50],
},

featureStage: {
background: colors.violet[950],
divider: colors.violet[900],
border: colors.violet[400],
text: colors.violet[400],

hover: {
background: colors.zinc[950],
divider: colors.zinc[900],
border: colors.violet[400],
text: colors.violet[400],
},
},
};

export default branding;
52 changes: 52 additions & 0 deletions site/src/theme/purple/experimental.ts
text: colors.white,
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import type { NewTheme } from "../experimental";
import colors from "../tailwindColors";

export default {
l1: {
background: colors.zinc[950],
outline: colors.zinc[700],
text: colors.white,
fill: {
solid: colors.zinc[600],
outline: colors.zinc[600],
text: colors.white,
},
},

l2: {
background: colors.zinc[900],
outline: colors.zinc[700],
text: colors.zinc[50],
fill: {
solid: colors.zinc[500],
outline: colors.zinc[500],
},
disabled: {
background: colors.gray[900],
outline: colors.zinc[700],
text: colors.zinc[200],
fill: {
solid: colors.zinc[500],
outline: colors.zinc[500],
text: colors.white,
},
},
hover: {
background: colors.zinc[800],
outline: colors.zinc[600],
text: colors.white,
fill: {
solid: colors.zinc[400],
outline: colors.zinc[400],
text: colors.white,
},
},
},

pillDefault: {
background: colors.zinc[800],
outline: colors.zinc[700],
text: colors.zinc[200],
},
} satisfies NewTheme;
15 changes: 15 additions & 0 deletions site/src/theme/purple/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { forDarkThemes } from "../externalImages";
import branding from "./branding";
import experimental from "./experimental";
import monaco from "./monaco";
import muiTheme from "./mui";
import roles from "./roles";

export default {
...muiTheme,
externalImages: forDarkThemes,
experimental,
branding,
monaco,
roles,
};
37 changes: 37 additions & 0 deletions site/src/theme/purple/monaco.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import type * as monaco from "monaco-editor";
import muiTheme from "./mui";

export default {
base: "vs-dark",
inherit: true,
rules: [
{
token: "comment",
foreground: "6B737C",
},
{
token: "type",
foreground: "B392F0",
},
{
token: "string",
foreground: "9DB1C5",
},
{
token: "variable",
foreground: "DDDDDD",
},
{
token: "identifier",
foreground: "B392F0",
},
{
token: "delimiter.curly",
foreground: "EBB325",
},
],
colors: {
"editor.foreground": muiTheme.palette.text.primary,
"editor.background": muiTheme.palette.background.paper,
},
} satisfies monaco.editor.IStandaloneThemeData as monaco.editor.IStandaloneThemeData;
79 changes: 79 additions & 0 deletions site/src/theme/purple/mui.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
// biome-ignore lint/nursery/noRestrictedImports: createTheme
import { createTheme } from "@mui/material/styles";
import { BODY_FONT_FAMILY, borderRadius } from "../constants";
import { components } from "../mui";
import tw from "../tailwindColors";

const muiTheme = createTheme({
palette: {
mode: "dark",
primary: {
main: tw.violet[500],
contrastText: tw.white,
light: tw.violet[400],
dark: tw.violet[600],
},
secondary: {
main: tw.zinc[500],
contrastText: tw.zinc[200],
dark: tw.zinc[400],
},
background: {
default: tw.zinc[950],
paper: tw.zinc[900],
},
text: {
primary: tw.zinc[50],
secondary: tw.zinc[400],
disabled: tw.zinc[500],
},
divider: tw.zinc[700],
warning: {
light: tw.amber[500],
main: tw.amber[800],
dark: tw.amber[950],
},
success: {
main: tw.green[500],
dark: tw.green[600],
},
info: {
light: tw.blue[400],
main: tw.blue[600],
dark: tw.blue[950],
contrastText: tw.zinc[200],
},
error: {
light: tw.red[400],
main: tw.red[500],
dark: tw.red[950],
contrastText: tw.zinc[200],
},
action: {
hover: tw.zinc[800],
},
neutral: {
main: tw.zinc[50],
},
dots: tw.zinc[500],
},
typography: {
fontFamily: BODY_FONT_FAMILY,

body1: {
fontSize: "1rem" /* 16px at default scaling */,
lineHeight: "160%",
},

body2: {
fontSize: "0.875rem" /* 14px at default scaling */,
lineHeight: "160%",
},
},
shape: {
borderRadius,
},
components,
});

export default muiTheme;
Loading
Loading
0