Skip to content

Commit 1528041

Browse files
committed
Merge branch 'release/1.1.0'
2 parents a49ae8b + 6734623 commit 1528041

40 files changed

+29009
-1594
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Production:
2222
- [Gatsby](https://github.com/gatsbyjs/gatsby)
2323
- [React](https://github.com/facebook/react)
2424
- [React-spring](https://github.com/pmndrs/react-spring) for animations
25-
- [Styled Components](https://www.styled-components.com/)
25+
- [Emotion](https://emotion.sh/)
2626

2727
### Data
2828

gatsby-config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module.exports = {
1010
description: "Danv's personal website",
1111
},
1212
plugins: [
13+
'gatsby-plugin-emotion',
1314
'gatsby-plugin-react-helmet',
1415
{
1516
resolve: 'gatsby-plugin-manifest',
@@ -79,7 +80,6 @@ module.exports = {
7980
'gatsby-plugin-sharp',
8081
'gatsby-plugin-catch-links',
8182
'gatsby-plugin-offline',
82-
'gatsby-plugin-styled-components',
8383
'gatsby-plugin-gatsby-cloud',
8484
],
8585
};

package-lock.json

Lines changed: 27220 additions & 85 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "website",
3-
"version": "1.0.0",
3+
"version": "1.1.0",
44
"description": "Danv's personal website",
55
"scripts": {
66
"build": "gatsby build",
@@ -13,16 +13,19 @@
1313
"prepare": "husky install"
1414
},
1515
"dependencies": {
16+
"@emotion/css": "^11.1.3",
17+
"@emotion/react": "^11.1.5",
18+
"emotion-theming": "^11.0.0",
1619
"gatsby": "^3.2.1",
1720
"gatsby-plugin-catch-links": "^3.2.0",
21+
"gatsby-plugin-emotion": "^6.2.0",
1822
"gatsby-plugin-gdpr-cookies": "^1.0.14",
1923
"gatsby-plugin-manifest": "^3.2.0",
2024
"gatsby-plugin-nprogress": "^3.2.0",
2125
"gatsby-plugin-offline": "^4.2.0",
2226
"gatsby-plugin-react-helmet": "^4.2.0",
2327
"gatsby-plugin-react-svg": "^3.0.0",
2428
"gatsby-plugin-sharp": "^3.2.0",
25-
"gatsby-plugin-styled-components": "^4.2.0",
2629
"gatsby-remark-copy-linked-files": "^3.2.0",
2730
"gatsby-remark-images": "^4.2.0",
2831
"gatsby-source-filesystem": "^3.2.0",
@@ -39,11 +42,9 @@
3942
"react-responsive-carousel": "^3.2.18",
4043
"react-spring": "^9.0.0-rc.3",
4144
"react-use": "^17.2.1",
42-
"react-use-gesture": "^9.1.3",
43-
"styled-components": "^5.2.3"
45+
"react-use-gesture": "^9.1.3"
4446
},
4547
"devDependencies": {
46-
"babel-plugin-styled-components": "1.12.0",
4748
"eslint": "^7.23.0",
4849
"eslint-config-prettier": "^8.1.0",
4950
"eslint-plugin-import": "^2.22.1",

src/components/GlobalStyle.jsx

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,45 @@
11
import React, { memo, useEffect } from 'react';
22
import { Helmet } from 'react-helmet';
3-
import { createGlobalStyle } from 'styled-components';
3+
import { Global, css } from '@emotion/react';
44
import { Globals } from 'react-spring';
55
import { CookieBanner } from './common/cookie/CookieBanner';
66
import 'normalize.css';
77
import 'react-responsive-carousel/lib/styles/carousel.min.css';
88
import { useReducedMotion } from '../hooks/useReducedMotion';
99

10-
const GlobalStylesComponent = createGlobalStyle`
11-
:root {
12-
--text-color-primary: #282C36;
13-
--text-color-secondary: #767B91;
14-
--background-color: white;
15-
--background-color-dark: #f5f5f5;
16-
--shadow-color: #E0E0E0;
17-
--marker-green: #A9E5BB;
18-
--marker-yellow: #FCF6B1;
19-
--marker-red: #F78888;
20-
--marker-blue: #BCE5FF;
21-
--marker-purple: #C3A9FF;
22-
--border-radius: 3px;
23-
--page-size: 45em;
24-
--color-red: #EF3934;
25-
--color-green: #44C95C;
26-
--color-yellow: #FFB402;
27-
--color-blue: #2F86EB;
28-
29-
}
10+
const globalStyles = css`
11+
:root {
12+
--text-color-primary: #282c36;
13+
--text-color-secondary: #434750;
14+
--background-color: white;
15+
--background-color-dark: #f5f5f5;
16+
--shadow-color: #e0e0e0;
17+
--marker-green: #a9e5bb;
18+
--marker-yellow: #fcf6b1;
19+
--marker-red: #f78888;
20+
--marker-blue: #bce5ff;
21+
--marker-purple: #c3a9ff;
22+
--border-radius: 3px;
23+
--page-size: 45em;
24+
--color-red: #ef3934;
25+
--color-green: #44c95c;
26+
--color-yellow: #ffb402;
27+
--color-blue: #2f86eb;
28+
}
3029
31-
body {
32-
font-size: 16px;
33-
background-color: var(--background-color);
34-
font-family: -apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', Helvetica, Arial, sans-serif;
35-
line-height: 1.5;
36-
color: var(--text-color-primary);
37-
}
30+
body {
31+
font-size: 16px;
32+
background-color: var(--background-color);
33+
font-family: -apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI',
34+
Roboto, Ubuntu, 'Helvetica Neue', Helvetica, Arial, sans-serif;
35+
line-height: 1.5;
36+
color: var(--text-color-primary);
37+
}
3838
39-
main {
40-
padding: 0;
41-
position: relative;
42-
}
39+
main {
40+
padding: 0;
41+
position: relative;
42+
}
4343
`;
4444

4545
const GlobalStyles = () => {
@@ -51,7 +51,7 @@ const GlobalStyles = () => {
5151
});
5252
}, [prefersReducedMotion]);
5353

54-
return <GlobalStylesComponent />;
54+
return <Global styles={globalStyles} />;
5555
};
5656

5757
const OGP = memo(({ title, description, image = '/icon_ogp.png' }) => {

0 commit comments

Comments
 (0)