Skip to content
This repository has been archived by the owner on Jun 9, 2023. It is now read-only.

add globalstyles and minimal css reset #148

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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ import App from 'next/app';
import React from 'react';
import { ThemeProvider } from 'styled-components';
import theme from 'styles/theme';
import { GlobalStyles } from 'styles/global';

export default class MyApp extends App {
render() {
const { Component, pageProps } = this.props;
return (
<ThemeProvider theme={theme}>
<Component {...pageProps} />
<GlobalStyles />
ThomasRoest marked this conversation as resolved.
Show resolved Hide resolved
<Component {...pageProps} />
</ThemeProvider>
);
}
Expand Down
50 changes: 50 additions & 0 deletions styles/global.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { createGlobalStyle } from 'styled-components';

export const GlobalStyles = createGlobalStyle`
html {
box-sizing: border-box;
}

*,
*::before,
*::after {
box-sizing: inherit;
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
ul,
ol,
li,
p,
pre,
blockquote,
figure,
hr {
margin: 0;
padding: 0;
}

input,
textarea,
select,
button {
color: inherit;
font: inherit;
letter-spacing: inherit;
}

embed,
iframe,
img,
object,
video {
Copy link
Member

Choose a reason for hiding this comment

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

Also, add the following tags:

article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
nav,
section,
summary

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what do you mean by adding these elements? Do they need some reset in some form?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not sure about IE6/7/8/9. I don't think we should bother supporting those browsers

Copy link
Contributor

Choose a reason for hiding this comment

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

We have a browser support conversation on #144.

Copy link
Member

Choose a reason for hiding this comment

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

what do you mean by adding these elements? Do they need some reset in some form?

Yes, I meant adding reset rules for the mentioned tags

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's not necessary

display: block;
max-width: 100%;
}
`;