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

Polish error page styling #50912

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 3 additions & 6 deletions packages/next/src/client/components/error-boundary.tsx
Expand Up @@ -15,14 +15,11 @@ const styles = {
alignItems: 'center',
justifyContent: 'center',
},
desc: {
textAlign: 'left',
},
text: {
fontSize: '14px',
fontWeight: 400,
lineHeight: '3em',
margin: 0,
lineHeight: '2em',
margin: '0 8px',
},
} as const

Expand Down Expand Up @@ -108,7 +105,7 @@ export default function GlobalError({ error }: { error: any }) {
<head></head>
<body>
<div style={styles.error}>
<div style={styles.desc}>
<div>
<h2 style={styles.text}>
Application error: a client-side exception has occurred (see the
browser console for more information).
Expand Down
13 changes: 3 additions & 10 deletions packages/next/src/pages/_error.tsx
Expand Up @@ -36,12 +36,6 @@ const styles: Record<string, React.CSSProperties> = {
alignItems: 'center',
justifyContent: 'center',
},

desc: {
display: 'inline-block',
textAlign: 'left',
},

h1: {
display: 'inline-block',
margin: '0 20px 0 0',
Expand All @@ -51,12 +45,11 @@ const styles: Record<string, React.CSSProperties> = {
verticalAlign: 'top',
lineHeight: '49px',
},

h2: {
fontSize: 14,
fontWeight: 400,
lineHeight: '49px',
margin: 0,
lineHeight: '2em',
Copy link
Member

Choose a reason for hiding this comment

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

Should we also update the lineHeight for h1 as it was previously matching?

margin: '0 8px',
},
}

Expand Down Expand Up @@ -118,7 +111,7 @@ export default class Error<P = {}> extends React.Component<P & ErrorProps> {
{statusCode}
</h1>
) : null}
<div style={styles.desc}>
<div>
<h2 style={styles.h2}>
{this.props.title || statusCode ? (
title
Expand Down