Browse Source

feat: replace google fonts with locally hosted font

main
Inhji Y. 8 months ago
parent
commit
695b77e108
  1. 16
      assets/css/app.scss
  2. 34
      assets/package-lock.json
  3. 5
      assets/package.json
  4. BIN
      assets/static/fonts/OpenSans-Regular-webfont.woff
  5. 12
      assets/webpack.config.js

16
assets/css/app.scss

@ -1,6 +1,4 @@
/* This file is for your main application css. */
@import url('https://fonts.googleapis.com/css2?family=Fira+Sans&family=Playfair+Display&display=swap');
@import "~minireset.css/minireset.css";
/* === Variables === */
@ -10,8 +8,8 @@ $rainbow: linear-gradient(90deg,
rgba(253,29,65,1) 50%,
rgba(252,176,69,1) 100%);
$font-heading: 'Playfair Display', Georgia, serif;
$font-content: 'Fira Sans', Helvetica, sans-serif;
$font-content: 'Open Sans', Helvetica, sans-serif;
$font-heading: $font-content;
$bg-base: #111;
$bg-content: #333;
@ -26,6 +24,15 @@ $color-danger: #f2dede;
$color-text: #ddd;
$border-base: #999;
/* === Fonts ===*/
@font-face {
font-family: 'Open Sans';
src: url('../static/fonts/OpenSans-Regular-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;
}
/* === Imports === */
@import "./phoenix";
@ -172,6 +179,7 @@ button[type=submit], a.button {
h1 {
margin: 0 0 1rem 0;
font-family: $font-heading;
font-weight: bold;
&:last-child {
margin: 0;

34
assets/package-lock.json

@ -3579,6 +3579,40 @@
"integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==",
"dev": true
},
"file-loader": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/file-loader/-/file-loader-6.2.0.tgz",
"integrity": "sha512-qo3glqyTa61Ytg4u73GultjHGjdRyig3tG6lPtyX/jOEJvHif9uB0/OCI2Kif6ctF3caQTW2G5gym21oAsI4pw==",
"dev": true,
"requires": {
"loader-utils": "^2.0.0",
"schema-utils": "^3.0.0"
},
"dependencies": {
"loader-utils": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz",
"integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==",
"dev": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
},
"schema-utils": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.0.0.tgz",
"integrity": "sha512-6D82/xSzO094ajanoOSbe4YvXWMfn2A//8Y1+MUqFAJul5Bs+yn36xbK9OtNDcRVSBJ9jjeoXftM6CfztsjOAA==",
"dev": true,
"requires": {
"@types/json-schema": "^7.0.6",
"ajv": "^6.12.5",
"ajv-keywords": "^3.5.2"
}
}
}
},
"fill-range": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz",

5
assets/package.json

@ -22,11 +22,12 @@
"babel-loader": "^8.0.0",
"copy-webpack-plugin": "^5.1.1",
"css-loader": "^3.4.2",
"sass-loader": "^8.0.2",
"node-sass": "^4.13.1",
"file-loader": "^6.2.0",
"hard-source-webpack-plugin": "^0.13.1",
"mini-css-extract-plugin": "^0.9.0",
"node-sass": "^4.13.1",
"optimize-css-assets-webpack-plugin": "^5.0.1",
"sass-loader": "^8.0.2",
"terser-webpack-plugin": "^2.3.2",
"webpack": "4.41.5",
"webpack-cli": "^3.3.2"

BIN
assets/static/fonts/OpenSans-Regular-webfont.woff

Binary file not shown.

12
assets/webpack.config.js

@ -41,6 +41,18 @@ module.exports = (env, options) => {
'css-loader',
'sass-loader',
],
},
{
test: /\.(woff|woff2)(\?v=\d+\.\d+\.\d+)?$/,
use: [
{
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: '../fonts'
}
}
]
}
]
},

Loading…
Cancel
Save