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 #50916

Merged
merged 1 commit into from Jun 7, 2023
Merged
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: '28px',
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
17 changes: 7 additions & 10 deletions packages/next/src/pages/_error.tsx
Expand Up @@ -36,27 +36,24 @@ const styles: Record<string, React.CSSProperties> = {
alignItems: 'center',
justifyContent: 'center',
},

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

h1: {
display: 'inline-block',
margin: '0 20px 0 0',
paddingRight: 23,
fontSize: 24,
fontWeight: 500,
verticalAlign: 'top',
lineHeight: '49px',
},

h2: {
fontSize: 14,
fontWeight: 400,
lineHeight: '49px',
margin: 0,
lineHeight: '28px',
},
wrap: {
display: 'inline-block',
},
}

Expand Down Expand Up @@ -85,7 +82,7 @@ export default class Error<P = {}> extends React.Component<P & ErrorProps> {
: 'Application error: a client-side exception has occurred'}
</title>
</Head>
<div>
<div style={styles.desc}>
<style
dangerouslySetInnerHTML={{
/* CSS minified from
Expand Down Expand Up @@ -118,7 +115,7 @@ export default class Error<P = {}> extends React.Component<P & ErrorProps> {
{statusCode}
</h1>
) : null}
<div style={styles.desc}>
<div style={styles.wrap}>
<h2 style={styles.h2}>
{this.props.title || statusCode ? (
title
Expand Down