Skip to content

Commit

Permalink
Fix brittleness during builds
Browse files Browse the repository at this point in the history
91f4667 introduced a hacky solution, that unfortunatly caused the build/dev server to fail, when `/website/src/fonts` doesn't exist. This removes the coupling of `fonts.sass` to other features while keeping it optional.
  • Loading branch information
essenmitsosse committed Jan 17, 2023
1 parent 8f29389 commit b96b14e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions website/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ const plugins = [
`gatsby-plugin-offline`,
]

plugins.push({
resolve: `gatsby-plugin-sass-resources`,
options: {
resources: ['./src/styles/base.sass'],
},
})

if (fs.existsSync('./src/fonts')) {
plugins.push({
resolve: `gatsby-plugin-sass-resources`,
Expand Down
2 changes: 0 additions & 2 deletions website/src/components/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import React from 'react'

import SEO from './seo'

import '../styles/base.sass'

const Layout = ({ title, description, className, children }) => (
<>
<SEO title={title} description={description} />
Expand Down
3 changes: 3 additions & 0 deletions website/src/styles/base.sass
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@

@use 'sass:math'

\:root
--font-primary: 'Calibre', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'
--font-code: 'IBM Plex Mono', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace
Expand Down
1 change: 0 additions & 1 deletion website/src/styles/fonts.sass
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* Fonts */
@use 'sass:math'

@font-face
font-family: "Calibre"
Expand Down

0 comments on commit b96b14e

Please sign in to comment.