Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
inter mac
  • Loading branch information
rohanray committed Mar 25, 2019
1 parent 0fd7774 commit 2913592
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 52 deletions.
6 changes: 6 additions & 0 deletions next.config.js
@@ -0,0 +1,6 @@
const withFonts = require('next-fonts');
module.exports = withFonts({
webpack(config, options) {
return config;
}
});
47 changes: 14 additions & 33 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 14 additions & 18 deletions pages/_document.js
@@ -1,6 +1,16 @@
import Document, { Html, Head, Main, NextScript } from "next/document";
import Document, { Html, Head, Main, NextScript } from 'next/document';

import { ServerStyleSheet } from "styled-components";
import { ServerStyleSheet, createGlobalStyle } from 'styled-components';

const GlobalStyle = createGlobalStyle`
@font-face {
font-family: 'Pangram';
src: url('/static/fonts/Pangram-Regular.ttf');
src: url('/static/fonts/Pangram-Bold.ttf');
src: url('/static/fonts/Pangram-Black.ttf');
src: url('/static/fonts/Pangram-ExtraLight.ttf');
}
`;

export default class MyDocument extends Document {
static async getInitialProps(ctx) {
Expand Down Expand Up @@ -38,25 +48,11 @@ export default class MyDocument extends Document {
content="width=device-width, initial-scale=1, shrink-to-fit=no, user-scalable=0"
/>
</Head>
<body className="custom_class">
<body>
<GlobalStyle />
<Main />
<NextScript />
</body>
<style jsx global>{`
html {
font-size: 16px;
}
body {
font-family: Pangram;
margin: 0;
background-color: white;
}
@media only screen and (min-width: 64.063em) {
html {
font-size: 18px;
}
}
`}</style>
</Html>
);
}
Expand Down
9 changes: 8 additions & 1 deletion pages/index.js
@@ -1,5 +1,12 @@
import styled from 'styled-components';

const CustomFont = styled.div`
color: red;
font-family: 'Pangram';
`;

function Index() {
return <div>Welcome to next.js!</div>;
return <CustomFont>Welcome === to next.js!</CustomFont>;
}

export default Index;
Binary file added static/.DS_Store
Binary file not shown.

0 comments on commit 2913592

Please sign in to comment.