From 3ce3a886ed3691b1968b6c6d41bded2cb8754829 Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Thu, 3 Jan 2019 18:00:10 -0500 Subject: [PATCH] Loading font through CSS to avoid font loading flash --- gatsby-config.js | 11 +---------- package.json | 1 - src/site.css | 1 + yarn.lock | 13 ------------- 4 files changed, 2 insertions(+), 24 deletions(-) diff --git a/gatsby-config.js b/gatsby-config.js index 6048047..6066c63 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -11,15 +11,6 @@ module.exports = { }, plugins: [ 'gatsby-plugin-react-helmet', - 'gatsby-plugin-postcss', - { - resolve: 'gatsby-plugin-web-font-loader', - options: { - google: { - families: ['Bangers'], - text: 'Regxpr' - } - } - } + 'gatsby-plugin-postcss' ] }; diff --git a/package.json b/package.json index 3ce56ea..e945256 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,6 @@ "gatsby": "^2.0.81", "gatsby-plugin-postcss": "^2.0.2", "gatsby-plugin-react-helmet": "^3.0.5", - "gatsby-plugin-web-font-loader": "^1.0.4", "postcss-cssnext": "^3.1.0", "postcss-import": "^12.0.1", "prop-types": "^15.6.2", diff --git a/src/site.css b/src/site.css index 8c0c7ad..1c6aa2a 100644 --- a/src/site.css +++ b/src/site.css @@ -1,3 +1,4 @@ +@import url('//fonts.googleapis.com/css?family=Bangers&text=Regxpr'); @import url('./globals.module.css'); html { diff --git a/yarn.lock b/yarn.lock index fd28925..0748b7f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4711,14 +4711,6 @@ gatsby-plugin-react-helmet@^3.0.5: dependencies: "@babel/runtime" "^7.0.0" -gatsby-plugin-web-font-loader@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/gatsby-plugin-web-font-loader/-/gatsby-plugin-web-font-loader-1.0.4.tgz#c50bdb0c1980110b3fd213a5be70feb2459514c3" - integrity sha512-3c39bX9CcsYJQFhhmTyjuMJSqpld2rX+HsTOxP9k1PKFR4Rvo3lpzBW4d1tVpmUesR8BNL6u9eHT7/XksS1iog== - dependencies: - babel-runtime "^6.26.0" - webfontloader "^1.6.28" - gatsby-react-router-scroll@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/gatsby-react-router-scroll/-/gatsby-react-router-scroll-2.0.2.tgz#d8046ce2f3bfa52ef6ec55804007d976b0bb6bef" @@ -10143,11 +10135,6 @@ wbuf@^1.1.0, wbuf@^1.7.3: dependencies: minimalistic-assert "^1.0.0" -webfontloader@^1.6.28: - version "1.6.28" - resolved "https://registry.yarnpkg.com/webfontloader/-/webfontloader-1.6.28.tgz#db786129253cb6e8eae54c2fb05f870af6675bae" - integrity sha1-23hhKSU8tujq5UwvsF+HCvZnW64= - webpack-dev-middleware@3.4.0, webpack-dev-middleware@^3.0.1: version "3.4.0" resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-3.4.0.tgz#1132fecc9026fd90f0ecedac5cbff75d1fb45890"