Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a4d74b8

Browse files
chore(site): remove paperLight background value (#10857)
I noticed we have been overusing colors in the UI, so simplifying is better for the "look and feel" and maintaining the styles over time. ![image](https://github.com/coder/coder/assets/3165839/f70c831d-eba8-4521-820a-6257ae0bedf1) If you want to have a better sense of what it looks like, I recommend you go to the Chromatic snapshot.
1 parent c634a38 commit a4d74b8

File tree

33 files changed

+69
-94
lines changed

33 files changed

+69
-94
lines changed

site/src/@types/mui.d.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ declare module "@mui/material/styles" {
1414
experimental: NewTheme;
1515
}
1616

17-
interface TypeBackground {
18-
paperLight: string;
19-
}
20-
2117
interface Palette {
2218
neutral: PaletteColor;
2319
}

site/src/components/Dashboard/Navbar/NavbarView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,8 @@ export const NavbarView: FC<NavbarViewProps> = ({
187187
<nav
188188
css={(theme) => ({
189189
height: navHeight,
190-
background: theme.palette.background.paper,
191190
borderBottom: `1px solid ${theme.palette.divider}`,
191+
backgroundColor: theme.palette.background.paper,
192192
})}
193193
>
194194
<div css={styles.wrapper}>

site/src/components/DeploySettingsLayout/Fieldset.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ export const Fieldset: FC<FieldsetProps> = (props) => {
2929
css={{
3030
borderRadius: 8,
3131
border: `1px solid ${theme.palette.divider}`,
32-
background: theme.palette.background.paper,
3332
marginTop: 32,
3433
}}
3534
onSubmit={onSubmit}
@@ -63,7 +62,7 @@ export const Fieldset: FC<FieldsetProps> = (props) => {
6362
css={[
6463
theme.typography.body2 as CSSObject,
6564
{
66-
background: theme.palette.background.paperLight,
65+
background: theme.palette.background.paper,
6766
padding: "16px 24px",
6867
display: "flex",
6968
alignItems: "center",

site/src/components/DeploySettingsLayout/Option.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,7 @@ interface OptionConfigProps extends BoxProps {
127127
export const OptionConfig = (props: OptionConfigProps) => {
128128
const { source, sx, ...attrs } = props;
129129
const theme = useTheme();
130-
const borderColor = source
131-
? theme.palette.primary.main
132-
: theme.palette.divider;
130+
const borderColor = source ? undefined : theme.palette.divider;
133131

134132
return (
135133
<Box
@@ -139,9 +137,7 @@ export const OptionConfig = (props: OptionConfigProps) => {
139137
fontFamily: MONOSPACE_FONT_FAMILY,
140138
fontWeight: 600,
141139
backgroundColor: (theme) =>
142-
source
143-
? theme.palette.primary.dark
144-
: theme.palette.background.paperLight,
140+
source ? theme.palette.primary.dark : theme.palette.background.paper,
145141
display: "inline-flex",
146142
alignItems: "center",
147143
borderRadius: 0.25,

site/src/components/ErrorBoundary/RuntimeErrorState.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ const styles = {
160160
}),
161161

162162
stack: (theme) => ({
163-
backgroundColor: theme.palette.background.paper,
164163
border: `1px solid ${theme.palette.divider}`,
165164
borderRadius: 4,
166165
marginTop: 64,
@@ -174,7 +173,7 @@ const styles = {
174173
fontWeight: 600,
175174
letterSpacing: 1,
176175
padding: "8px 8px 8px 16px",
177-
backgroundColor: theme.palette.background.paperLight,
176+
backgroundColor: theme.palette.background.paper,
178177
borderBottom: `1px solid ${theme.palette.divider}`,
179178
color: theme.palette.text.secondary,
180179
display: "flex",

site/src/components/Filter/filter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ const BaseSkeleton = (props: SkeletonProps) => {
125125
height={36}
126126
{...props}
127127
sx={{
128-
bgcolor: (theme) => theme.palette.background.paperLight,
128+
bgcolor: (theme) => theme.palette.background.paper,
129129
borderRadius: "6px",
130130
...props.sx,
131131
}}

site/src/components/Markdown/Markdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ const markdownStyles: Interpolation<Theme> = (theme: Theme) => ({
217217
},
218218

219219
"& .prismjs": {
220-
background: theme.palette.background.paperLight,
220+
background: theme.palette.background.paper,
221221
borderRadius: 8,
222222
padding: "16px 24px",
223223
overflowX: "auto",

site/src/components/PageHeader/FullWidthPageHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const FullWidthPageHeader: FC<
1212
{
1313
...(theme.typography.body2 as CSSObject),
1414
padding: 24,
15-
background: theme.palette.background.paper,
15+
background: theme.palette.background.default,
1616
borderBottom: `1px solid ${theme.palette.divider}`,
1717
display: "flex",
1818
alignItems: "center",
Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,28 @@
11
import Button, { ButtonProps } from "@mui/material/Button";
2-
import { FC, forwardRef } from "react";
3-
4-
export const PrimaryAgentButton: FC<ButtonProps> = ({
5-
className,
6-
...props
7-
}) => {
8-
return (
9-
<Button
10-
color="neutral"
11-
{...props}
12-
sx={{
13-
backgroundColor: (theme) => theme.palette.background.default,
14-
"&:hover": {
15-
backgroundColor: (theme) => theme.palette.background.paper,
16-
},
17-
// Making them smaller since those icons don't have a padding around them
18-
"& .MuiButton-startIcon": {
19-
width: 12,
20-
height: 12,
21-
"& svg": { width: "100%", height: "100%" },
22-
},
23-
...props.sx,
24-
}}
25-
/>
26-
);
27-
};
2+
import { forwardRef } from "react";
283

294
// eslint-disable-next-line react/display-name -- Name is inferred from variable name
30-
export const SecondaryAgentButton = forwardRef<HTMLButtonElement, ButtonProps>(
31-
({ className, ...props }, ref) => {
32-
return <Button ref={ref} className={className} {...props} />;
5+
export const AgentButton = forwardRef<HTMLButtonElement, ButtonProps>(
6+
(props, ref) => {
7+
return (
8+
<Button
9+
color="neutral"
10+
{...props}
11+
ref={ref}
12+
sx={{
13+
backgroundColor: (theme) => theme.palette.background.default,
14+
"&:hover": {
15+
backgroundColor: (theme) => theme.palette.background.paper,
16+
},
17+
// Making them smaller since those icons don't have a padding around them
18+
"& .MuiButton-startIcon": {
19+
width: 12,
20+
height: 12,
21+
"& svg": { width: "100%", height: "100%" },
22+
},
23+
...props.sx,
24+
}}
25+
/>
26+
);
3327
},
3428
);

site/src/components/Resources/AgentMetadata.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ const styles = {
207207
root: (theme) => ({
208208
padding: "20px 32px",
209209
borderTop: `1px solid ${theme.palette.divider}`,
210-
background: theme.palette.background.paper,
211210
overflowX: "auto",
212211
scrollPadding: "0 32px",
213212
}),

0 commit comments

Comments
 (0)