Skip to content

Commit

Permalink
🐛 FIX: replace createGlobalStyle from styled-components library with …
Browse files Browse the repository at this point in the history
…vanilla CSS file due to flickering on page load in production and ongoing memory leak issues with Next.js

styled-components/styled-components#3022
styled-components/styled-components#2134
vercel/next.js#7598
  • Loading branch information
ryanjwessel committed Apr 28, 2020
1 parent 86299e7 commit 4780e39
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 102 deletions.
3 changes: 1 addition & 2 deletions src/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import { ThemeProvider } from "styled-components";
import GlobalStyle from "../styles/GlobalStyle";
import "../styles/defaults.css";

const theme = {
colors: {
Expand All @@ -10,7 +10,6 @@ const theme = {

export default ({ Component, pageProps }) => (
<ThemeProvider theme={theme}>
<GlobalStyle />
<Component {...pageProps} />
</ThemeProvider>
);
100 changes: 0 additions & 100 deletions src/styles/GlobalStyle.js

This file was deleted.

93 changes: 93 additions & 0 deletions src/styles/defaults.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
* {
box-sizing: inherit;
line-height: 1.5;
transition: opacity 0.2s ease;
}
html {
box-sizing: border-box;
overflow-y: scroll;
}
body {
margin: 0;
overflow-x: hidden;
background-color: #292c3e;
color: #fff;
font-family: "Ubunto Mono", "Lucida Console", monospace;
font-size: 16px;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
a {
text-decoration: underline;
color: #fff;
}
a:hover {
opacity: 0.5;
}
img {
max-width: 100%;
}
strong {
font-weight: bold;
}
h1,
h2,
h3,
h4,
h5,
h6,
p,
li {
font-family: "Ubunto Mono", "Lucida Console", monospace;
margin-left: 0;
margin-right: 0;
margin-top: 0;
margin-bottom: 1rem;
padding-bottom: 0;
padding-left: 0;
padding-right: 0;
padding-top: 0;
letter-spacing: -0.5px;
color: inherit;
text-rendering: optimizeLegibility;
}
h1 {
font-size: 1.75rem;
}
h2 {
font-size: 1.5rem;
}
h3,
h4 {
font-size: 1.25rem;
}
code,
.code {
border: 1px solid #94959e;
border-radius: 4px;
font-size: 0.9rem;
padding: 0.1rem 0.2rem;
background-color: #3f4052;
color: #8bcc57;
}
@media (min-width: 1280px) {
h1,
h2,
h3,
h4,
h5,
h6,
p {
letter-spacing: -1px;
}
h1 {
letter-spacing: -1px;
}
h2 {
letter-spacing: -0.75px;
}
h3 {
letter-spacing: -0.5px;
font-weight: normal;
}
}

1 comment on commit 4780e39

@vercel
Copy link

@vercel vercel bot commented on 4780e39 Apr 28, 2020

Choose a reason for hiding this comment

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

Failed to assign a domain to your deployment due to the following error:

We could not create a certificate for ryanwessel.com because HTTP pretest failed. Please ensure the CNAME for ryanwessel.com points to "alias.zeit.co". You can find more information at https://err.sh/now-cli/cant-solve-challenge.

(Learn more or visit the non-aliased deployment)

Please sign in to comment.