Add webfontloader
This commit is contained in:
parent
1e117f1ad0
commit
4602aa23ae
4 changed files with 27 additions and 95 deletions
|
|
@ -14,7 +14,8 @@
|
||||||
"react-helmet": "^5",
|
"react-helmet": "^5",
|
||||||
"react-router-dom": "^4.0.0",
|
"react-router-dom": "^4.0.0",
|
||||||
"react-snapshot": "^1.0.4",
|
"react-snapshot": "^1.0.4",
|
||||||
"styled-components": "^1.4.4"
|
"styled-components": "^1.4.4",
|
||||||
|
"webfontloader": "^1.6.27"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "react-scripts start",
|
"start": "react-scripts start",
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import NoMatch from './views/NoMatch'
|
||||||
import Nav from './components/Nav'
|
import Nav from './components/Nav'
|
||||||
import NavLink from './components/NavLink'
|
import NavLink from './components/NavLink'
|
||||||
import Logo from './components/Logo'
|
import Logo from './components/Logo'
|
||||||
import globalStyles from './globalStyles'
|
import globalStyles, { loadFonts } from './globalStyles'
|
||||||
|
|
||||||
const siteTitle = 'HyperStatic'
|
const siteTitle = 'HyperStatic'
|
||||||
const routes = [
|
const routes = [
|
||||||
|
|
@ -27,6 +27,7 @@ const routes = [
|
||||||
class App extends Component {
|
class App extends Component {
|
||||||
componentDidMount () {
|
componentDidMount () {
|
||||||
globalStyles()
|
globalStyles()
|
||||||
|
loadFonts()
|
||||||
}
|
}
|
||||||
render () {
|
render () {
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,15 @@
|
||||||
import { injectGlobal } from 'styled-components'
|
import { injectGlobal } from 'styled-components'
|
||||||
|
import WebFont from 'webfontloader'
|
||||||
|
|
||||||
|
export const loadFonts = () => WebFont.load({
|
||||||
|
google: {
|
||||||
|
families: ['Cabin']
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
export const font = {
|
||||||
|
primary: `'Cabin', sans-serif`
|
||||||
|
}
|
||||||
|
|
||||||
export const color = {
|
export const color = {
|
||||||
primary: '#FA5463',
|
primary: '#FA5463',
|
||||||
|
|
@ -6,10 +17,6 @@ export const color = {
|
||||||
lightGrey: 'whitesmoke'
|
lightGrey: 'whitesmoke'
|
||||||
}
|
}
|
||||||
|
|
||||||
export const font = {
|
|
||||||
primary: `'Avenir', sans-serif`
|
|
||||||
}
|
|
||||||
|
|
||||||
export default () => injectGlobal`
|
export default () => injectGlobal`
|
||||||
html{
|
html{
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
|
||||||
101
yarn.lock
101
yarn.lock
|
|
@ -1550,7 +1550,7 @@ defined@^1.0.0:
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693"
|
resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693"
|
||||||
|
|
||||||
deglob@^2.0.0, deglob@^2.1.0:
|
deglob@^2.1.0:
|
||||||
version "2.1.0"
|
version "2.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/deglob/-/deglob-2.1.0.tgz#4d44abe16ef32c779b4972bd141a80325029a14a"
|
resolved "https://registry.yarnpkg.com/deglob/-/deglob-2.1.0.tgz#4d44abe16ef32c779b4972bd141a80325029a14a"
|
||||||
dependencies:
|
dependencies:
|
||||||
|
|
@ -1839,18 +1839,10 @@ eslint-config-react-app@^0.6.2:
|
||||||
version "0.6.2"
|
version "0.6.2"
|
||||||
resolved "https://registry.yarnpkg.com/eslint-config-react-app/-/eslint-config-react-app-0.6.2.tgz#ee535cbaaf9e3576ea16b99afe720353d8730ec0"
|
resolved "https://registry.yarnpkg.com/eslint-config-react-app/-/eslint-config-react-app-0.6.2.tgz#ee535cbaaf9e3576ea16b99afe720353d8730ec0"
|
||||||
|
|
||||||
eslint-config-standard-jsx@3.2.0:
|
|
||||||
version "3.2.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/eslint-config-standard-jsx/-/eslint-config-standard-jsx-3.2.0.tgz#c240e26ed919a11a42aa4de8059472b38268d620"
|
|
||||||
|
|
||||||
eslint-config-standard-jsx@3.3.0:
|
eslint-config-standard-jsx@3.3.0:
|
||||||
version "3.3.0"
|
version "3.3.0"
|
||||||
resolved "https://registry.yarnpkg.com/eslint-config-standard-jsx/-/eslint-config-standard-jsx-3.3.0.tgz#cab0801a15a360bf63facb97ab22fbdd88d8a5e0"
|
resolved "https://registry.yarnpkg.com/eslint-config-standard-jsx/-/eslint-config-standard-jsx-3.3.0.tgz#cab0801a15a360bf63facb97ab22fbdd88d8a5e0"
|
||||||
|
|
||||||
eslint-config-standard@6.2.1:
|
|
||||||
version "6.2.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-6.2.1.tgz#d3a68aafc7191639e7ee441e7348739026354292"
|
|
||||||
|
|
||||||
eslint-config-standard@7.1.0:
|
eslint-config-standard@7.1.0:
|
||||||
version "7.1.0"
|
version "7.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-7.1.0.tgz#47e769ea0739f5b2d5693b1a501c21c9650fafcf"
|
resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-7.1.0.tgz#47e769ea0739f5b2d5693b1a501c21c9650fafcf"
|
||||||
|
|
@ -1921,13 +1913,6 @@ eslint-plugin-react@6.4.1:
|
||||||
doctrine "^1.2.2"
|
doctrine "^1.2.2"
|
||||||
jsx-ast-utils "^1.3.1"
|
jsx-ast-utils "^1.3.1"
|
||||||
|
|
||||||
eslint-plugin-react@~6.7.1:
|
|
||||||
version "6.7.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-6.7.1.tgz#1af96aea545856825157d97c1b50d5a8fb64a5a7"
|
|
||||||
dependencies:
|
|
||||||
doctrine "^1.2.2"
|
|
||||||
jsx-ast-utils "^1.3.3"
|
|
||||||
|
|
||||||
eslint-plugin-react@~6.9.0:
|
eslint-plugin-react@~6.9.0:
|
||||||
version "6.9.0"
|
version "6.9.0"
|
||||||
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-6.9.0.tgz#54c2e9906b76f9d10142030bdc34e9d6840a0bb2"
|
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-6.9.0.tgz#54c2e9906b76f9d10142030bdc34e9d6840a0bb2"
|
||||||
|
|
@ -1979,45 +1964,6 @@ eslint@3.16.1:
|
||||||
text-table "~0.2.0"
|
text-table "~0.2.0"
|
||||||
user-home "^2.0.0"
|
user-home "^2.0.0"
|
||||||
|
|
||||||
eslint@~3.10.2:
|
|
||||||
version "3.10.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.10.2.tgz#c9a10e8bf6e9d65651204778c503341f1eac3ce7"
|
|
||||||
dependencies:
|
|
||||||
babel-code-frame "^6.16.0"
|
|
||||||
chalk "^1.1.3"
|
|
||||||
concat-stream "^1.4.6"
|
|
||||||
debug "^2.1.1"
|
|
||||||
doctrine "^1.2.2"
|
|
||||||
escope "^3.6.0"
|
|
||||||
espree "^3.3.1"
|
|
||||||
estraverse "^4.2.0"
|
|
||||||
esutils "^2.0.2"
|
|
||||||
file-entry-cache "^2.0.0"
|
|
||||||
glob "^7.0.3"
|
|
||||||
globals "^9.2.0"
|
|
||||||
ignore "^3.2.0"
|
|
||||||
imurmurhash "^0.1.4"
|
|
||||||
inquirer "^0.12.0"
|
|
||||||
is-my-json-valid "^2.10.0"
|
|
||||||
is-resolvable "^1.0.0"
|
|
||||||
js-yaml "^3.5.1"
|
|
||||||
json-stable-stringify "^1.0.0"
|
|
||||||
levn "^0.3.0"
|
|
||||||
lodash "^4.0.0"
|
|
||||||
mkdirp "^0.5.0"
|
|
||||||
natural-compare "^1.4.0"
|
|
||||||
optionator "^0.8.2"
|
|
||||||
path-is-inside "^1.0.1"
|
|
||||||
pluralize "^1.2.1"
|
|
||||||
progress "^1.1.8"
|
|
||||||
require-uncached "^1.0.2"
|
|
||||||
shelljs "^0.7.5"
|
|
||||||
strip-bom "^3.0.0"
|
|
||||||
strip-json-comments "~1.0.1"
|
|
||||||
table "^3.7.8"
|
|
||||||
text-table "~0.2.0"
|
|
||||||
user-home "^2.0.0"
|
|
||||||
|
|
||||||
eslint@~3.18.0:
|
eslint@~3.18.0:
|
||||||
version "3.18.0"
|
version "3.18.0"
|
||||||
resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.18.0.tgz#647e985c4ae71502d20ac62c109f66d5104c8a4b"
|
resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.18.0.tgz#647e985c4ae71502d20ac62c109f66d5104c8a4b"
|
||||||
|
|
@ -2058,7 +2004,7 @@ eslint@~3.18.0:
|
||||||
text-table "~0.2.0"
|
text-table "~0.2.0"
|
||||||
user-home "^2.0.0"
|
user-home "^2.0.0"
|
||||||
|
|
||||||
espree@^3.3.1, espree@^3.4.0:
|
espree@^3.4.0:
|
||||||
version "3.4.0"
|
version "3.4.0"
|
||||||
resolved "https://registry.yarnpkg.com/espree/-/espree-3.4.0.tgz#41656fa5628e042878025ef467e78f125cb86e1d"
|
resolved "https://registry.yarnpkg.com/espree/-/espree-3.4.0.tgz#41656fa5628e042878025ef467e78f125cb86e1d"
|
||||||
dependencies:
|
dependencies:
|
||||||
|
|
@ -2493,7 +2439,7 @@ glob@^7.0.0, glob@^7.0.3, glob@^7.0.5:
|
||||||
once "^1.3.0"
|
once "^1.3.0"
|
||||||
path-is-absolute "^1.0.0"
|
path-is-absolute "^1.0.0"
|
||||||
|
|
||||||
globals@^9.0.0, globals@^9.14.0, globals@^9.2.0:
|
globals@^9.0.0, globals@^9.14.0:
|
||||||
version "9.14.0"
|
version "9.14.0"
|
||||||
resolved "https://registry.yarnpkg.com/globals/-/globals-9.14.0.tgz#8859936af0038741263053b39d0e76ca241e4034"
|
resolved "https://registry.yarnpkg.com/globals/-/globals-9.14.0.tgz#8859936af0038741263053b39d0e76ca241e4034"
|
||||||
|
|
||||||
|
|
@ -3362,7 +3308,7 @@ jsprim@^1.2.2:
|
||||||
json-schema "0.2.3"
|
json-schema "0.2.3"
|
||||||
verror "1.3.6"
|
verror "1.3.6"
|
||||||
|
|
||||||
jsx-ast-utils@^1.0.0, jsx-ast-utils@^1.3.1, jsx-ast-utils@^1.3.3, jsx-ast-utils@^1.3.4:
|
jsx-ast-utils@^1.0.0, jsx-ast-utils@^1.3.1, jsx-ast-utils@^1.3.4:
|
||||||
version "1.3.5"
|
version "1.3.5"
|
||||||
resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-1.3.5.tgz#9ba6297198d9f754594d62e59496ffb923778dd4"
|
resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-1.3.5.tgz#9ba6297198d9f754594d62e59496ffb923778dd4"
|
||||||
dependencies:
|
dependencies:
|
||||||
|
|
@ -4066,7 +4012,7 @@ pkg-conf@^2.0.0:
|
||||||
find-up "^2.0.0"
|
find-up "^2.0.0"
|
||||||
load-json-file "^2.0.0"
|
load-json-file "^2.0.0"
|
||||||
|
|
||||||
pkg-config@^1.0.1, pkg-config@^1.1.0:
|
pkg-config@^1.1.0:
|
||||||
version "1.1.1"
|
version "1.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/pkg-config/-/pkg-config-1.1.1.tgz#557ef22d73da3c8837107766c52eadabde298fe4"
|
resolved "https://registry.yarnpkg.com/pkg-config/-/pkg-config-1.1.1.tgz#557ef22d73da3c8837107766c52eadabde298fe4"
|
||||||
dependencies:
|
dependencies:
|
||||||
|
|
@ -5122,17 +5068,6 @@ sshpk@^1.7.0:
|
||||||
jsbn "~0.1.0"
|
jsbn "~0.1.0"
|
||||||
tweetnacl "~0.14.0"
|
tweetnacl "~0.14.0"
|
||||||
|
|
||||||
standard-engine@~5.2.0:
|
|
||||||
version "5.2.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/standard-engine/-/standard-engine-5.2.0.tgz#400660ae5acce8afd4db60ff2214a9190ad790a3"
|
|
||||||
dependencies:
|
|
||||||
deglob "^2.0.0"
|
|
||||||
find-root "^1.0.0"
|
|
||||||
get-stdin "^5.0.1"
|
|
||||||
home-or-tmp "^2.0.0"
|
|
||||||
minimist "^1.1.0"
|
|
||||||
pkg-config "^1.0.1"
|
|
||||||
|
|
||||||
standard-engine@~5.4.0:
|
standard-engine@~5.4.0:
|
||||||
version "5.4.0"
|
version "5.4.0"
|
||||||
resolved "https://registry.yarnpkg.com/standard-engine/-/standard-engine-5.4.0.tgz#e0e86959ea0786425d3383e40c1bf70d2f985579"
|
resolved "https://registry.yarnpkg.com/standard-engine/-/standard-engine-5.4.0.tgz#e0e86959ea0786425d3383e40c1bf70d2f985579"
|
||||||
|
|
@ -5149,19 +5084,7 @@ standard-json@^1.0.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
concat-stream "^1.5.0"
|
concat-stream "^1.5.0"
|
||||||
|
|
||||||
standard@*:
|
standard@*, standard@^9.0.2:
|
||||||
version "8.6.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/standard/-/standard-8.6.0.tgz#635132be7bfb567c2921005f30f9e350e4752aad"
|
|
||||||
dependencies:
|
|
||||||
eslint "~3.10.2"
|
|
||||||
eslint-config-standard "6.2.1"
|
|
||||||
eslint-config-standard-jsx "3.2.0"
|
|
||||||
eslint-plugin-promise "~3.4.0"
|
|
||||||
eslint-plugin-react "~6.7.1"
|
|
||||||
eslint-plugin-standard "~2.0.1"
|
|
||||||
standard-engine "~5.2.0"
|
|
||||||
|
|
||||||
standard@^9.0.2:
|
|
||||||
version "9.0.2"
|
version "9.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/standard/-/standard-9.0.2.tgz#9bd3b9467492e212b1914d78553943ff9b48fd99"
|
resolved "https://registry.yarnpkg.com/standard/-/standard-9.0.2.tgz#9bd3b9467492e212b1914d78553943ff9b48fd99"
|
||||||
dependencies:
|
dependencies:
|
||||||
|
|
@ -5245,7 +5168,7 @@ strip-bom@^3.0.0:
|
||||||
version "3.0.0"
|
version "3.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3"
|
resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3"
|
||||||
|
|
||||||
strip-json-comments@~1.0.1, strip-json-comments@~1.0.4:
|
strip-json-comments@~1.0.4:
|
||||||
version "1.0.4"
|
version "1.0.4"
|
||||||
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-1.0.4.tgz#1e15fbcac97d3ee99bf2d73b4c656b082bbafb91"
|
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-1.0.4.tgz#1e15fbcac97d3ee99bf2d73b4c656b082bbafb91"
|
||||||
|
|
||||||
|
|
@ -5591,6 +5514,10 @@ watchpack@^0.2.1:
|
||||||
chokidar "^1.0.0"
|
chokidar "^1.0.0"
|
||||||
graceful-fs "^4.1.2"
|
graceful-fs "^4.1.2"
|
||||||
|
|
||||||
|
webfontloader@^1.6.27:
|
||||||
|
version "1.6.27"
|
||||||
|
resolved "https://registry.yarnpkg.com/webfontloader/-/webfontloader-1.6.27.tgz#c3899649b0653aa57d0a23388f82409e0df224ba"
|
||||||
|
|
||||||
webidl-conversions@^3.0.0, webidl-conversions@^3.0.1:
|
webidl-conversions@^3.0.0, webidl-conversions@^3.0.1:
|
||||||
version "3.0.1"
|
version "3.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"
|
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"
|
||||||
|
|
@ -5679,14 +5606,10 @@ whatwg-encoding@^1.0.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
iconv-lite "0.4.13"
|
iconv-lite "0.4.13"
|
||||||
|
|
||||||
whatwg-fetch@2.0.2:
|
whatwg-fetch@2.0.2, whatwg-fetch@>=0.10.0:
|
||||||
version "2.0.2"
|
version "2.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.2.tgz#fe294d1d89e36c5be8b3195057f2e4bc74fc980e"
|
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.2.tgz#fe294d1d89e36c5be8b3195057f2e4bc74fc980e"
|
||||||
|
|
||||||
whatwg-fetch@>=0.10.0:
|
|
||||||
version "1.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-1.0.0.tgz#01c2ac4df40e236aaa18480e3be74bd5c8eb798e"
|
|
||||||
|
|
||||||
whatwg-url@^4.1.0:
|
whatwg-url@^4.1.0:
|
||||||
version "4.3.0"
|
version "4.3.0"
|
||||||
resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-4.3.0.tgz#92aaee21f4f2a642074357d70ef8500a7cbb171a"
|
resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-4.3.0.tgz#92aaee21f4f2a642074357d70ef8500a7cbb171a"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue