Skip to content

refactor: Initial color palette changes #3087

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

Merged
merged 4 commits into from
Jul 21, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Initial color palette changes
  • Loading branch information
hkfoster committed Jul 20, 2022
commit 29b100a429b89253d6e2d823e714c782a54099ff
1 change: 1 addition & 0 deletions site/src/components/AvatarData/AvatarData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,6 @@ const useStyles = makeStyles((theme) => ({
},
avatar: {
marginRight: theme.spacing(1.5),
background: "hsl(219, 8%, 52%)",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we could have it as a palette object like theme.palette.paper.dark? Or something like that?

},
}))
2 changes: 1 addition & 1 deletion site/src/components/BuildsTable/BuildsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export const BuildsTable: FC<BuildsTableProps> = ({ builds, className }) => {
const useStyles = makeStyles((theme) => ({
clickableTableRow: {
"&:hover td": {
backgroundColor: fade(theme.palette.primary.light, 0.1),
backgroundColor: fade(theme.palette.primary.dark, .1),
},

"&:focus": {
Expand Down
4 changes: 2 additions & 2 deletions site/src/components/NavbarView/NavbarView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ const useStyles = makeStyles((theme) => ({
},
link: {
alignItems: "center",
color: "#A7A7A7",
color: "hsl(220, 11%, 71%)",
display: "flex",
fontSize: 16,
height: navHeight,
Expand All @@ -113,7 +113,7 @@ const useStyles = makeStyles((theme) => ({
transition: "background-color 0.3s ease",

"&:hover": {
backgroundColor: fade(theme.palette.primary.light, 0.1),
backgroundColor: fade(theme.palette.primary.light, 0.05),
},

// NavLink adds this class when the current route matches.
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/UserDropdown/UsersDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const useStyles = makeStyles((theme) => ({
padding: `${theme.spacing(1.5)}px ${theme.spacing(2.75)}px`,

"&:hover": {
backgroundColor: fade(theme.palette.primary.light, 0.1),
backgroundColor: fade(theme.palette.primary.light, 0.05),
transition: "background-color 0.3s ease",
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ const useStyles = makeStyles((theme) => ({
padding: `${theme.spacing(1.5)}px ${theme.spacing(2.75)}px`,

"&:hover": {
backgroundColor: fade(theme.palette.primary.light, 0.1),
backgroundColor: fade(theme.palette.primary.light, 0.05),
transition: "background-color 0.3s ease",
},
},
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/WorkspacesTable/WorkspacesRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export const WorkspacesRow: FC<{ workspaceRef: WorkspaceItemMachineRef }> = ({ w
const useStyles = makeStyles((theme) => ({
clickableTableRow: {
"&:hover td": {
backgroundColor: fade(theme.palette.primary.light, 0.1),
backgroundColor: fade(theme.palette.primary.dark, .1),
},

"&:focus": {
Expand Down
2 changes: 1 addition & 1 deletion site/src/pages/TemplatesPage/TemplatesPageView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ const useStyles = makeStyles((theme) => ({
},
clickableTableRow: {
"&:hover td": {
backgroundColor: fade(theme.palette.primary.light, 0.1),
backgroundColor: fade(theme.palette.primary.dark, .1),
},

"&:focus": {
Expand Down
23 changes: 19 additions & 4 deletions site/src/theme/overrides.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,22 @@ import { MONOSPACE_FONT_FAMILY } from "./constants"
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
export const getOverrides = (palette: PaletteOptions) => {
return {
MuiCssBaseline: {
'@global': {
body: {
backgroundImage: "linear-gradient(to right bottom, hsl(223, 38%, 14%), hsl(221, 53%, 3%))",
backgroundRepeat: "no-repeat",
backgroundAttachment: "fixed",
letterSpacing: "-0.015em",
},
},
},
MuiAvatar: {
root: {
borderColor: palette.divider,
width: 36,
height: 36,
fontSize: 20,
fontSize: 18,
},
},
MuiButton: {
Expand All @@ -26,7 +36,7 @@ export const getOverrides = (palette: PaletteOptions) => {
contained: {
boxShadow: "none",
color: palette.text?.primary,
backgroundColor: "#151515",
backgroundColor: "hsl(223, 27%, 3%)",
"&:hover": {
boxShadow: "none",
backgroundColor: "#000000",
Expand Down Expand Up @@ -62,11 +72,12 @@ export const getOverrides = (palette: PaletteOptions) => {
root: {
// Gives the appearance of a border!
borderRadius: 2,
border: `1px solid ${palette.divider}`,
background: "hsla(222, 31%, 19%, .5)",

"& td": {
paddingTop: 16,
paddingBottom: 16,
background: "transparent"
},
},
},
Expand Down Expand Up @@ -97,11 +108,15 @@ export const getOverrides = (palette: PaletteOptions) => {
},
MuiOutlinedInput: {
root: {
"& .MuiOutlinedInput-notchedOutline": {
borderColor: palette.divider,
},

"& input:-webkit-autofill": {
WebkitBoxShadow: `0 0 0 1000px ${palette.background?.paper} inset`,
},
"&:hover .MuiOutlinedInput-notchedOutline": {
borderColor: (palette.primary as SimplePaletteColorOptions).light,
borderColor: palette.divider,
},
},
},
Expand Down
28 changes: 14 additions & 14 deletions site/src/theme/palettes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@ import { PaletteOptions } from "@material-ui/core/styles/createPalette"
export const darkPalette: PaletteOptions = {
type: "dark",
primary: {
main: "#409BF4",
contrastText: "#f8f8f8",
light: "#79B8FF",
dark: "#1976D2",
main: "hsl(215, 81%, 63%)",
contrastText: "hsl(218, 44%, 92%)",
light: "hsl(215, 83%, 70%)",
dark: "hsl(215, 74%, 51%)",
},
secondary: {
main: "#008510",
contrastText: "#f8f8f8",
dark: "#7057FF",
main: "hsl(142, 64%, 34%)",
contrastText: "hsl(218, 44%, 92%)",
dark: "hsl(233, 73%, 63%)",
},
background: {
default: "#1F1F1F",
paper: "#292929",
default: "hsl(222, 38%, 14%)",
paper: "hsl(222, 32%, 19%)",
},
text: {
primary: "#F8F8F8",
secondary: "#C1C1C1",
primary: "hsl(218, 44%, 92%)",
secondary: "hsl(218, 32%, 77%)",
},
divider: "#383838",
divider: "hsl(221, 32%, 26%)",
warning: {
main: "#C16800",
main: "hsl(20, 79%, 53%)",
},
success: {
main: "#6BBE00",
main: "hsl(142, 58%, 41%)",
},
}