Skip to content

Commit 7d6567e

Browse files
committed
Add default image config (including proper background color)
1 parent b616b2d commit 7d6567e

File tree

5 files changed

+15
-14
lines changed

5 files changed

+15
-14
lines changed

gatsby-config.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,16 @@ module.exports = {
2525
DEV_SSR: false
2626
},
2727
plugins: [
28-
'gatsby-plugin-sharp',
29-
'gatsby-transformer-yaml',
28+
{
29+
resolve: 'gatsby-plugin-sharp',
30+
options: {
31+
defaults: {
32+
placeholder: 'none',
33+
backgroundColor: '#005580',
34+
quality: 100
35+
}
36+
}
37+
},
3038
'gatsby-transformer-sharp',
3139
'gatsby-plugin-image',
3240
{
@@ -47,6 +55,7 @@ module.exports = {
4755
'gatsby-plugin-styled-components',
4856
'gatsby-plugin-react-helmet',
4957
'gatsby-plugin-scroll-reveal',
58+
'gatsby-transformer-yaml',
5059
{
5160
resolve: 'gatsby-source-filesystem',
5261
options: {

src/sections/about.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,6 @@ export default function About() {
9393
layout: FIXED,
9494
width: 300,
9595
aspectRatio: 1,
96-
placeholder: DOMINANT_COLOR,
97-
quality: 100,
9896
transformOptions: {duotone: {highlight: "#0088ff", shadow: "#000000"}}
9997
)
10098
}

src/sections/hero.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,24 +73,20 @@ export default function Hero() {
7373
childImageSharp {
7474
gatsbyImageData(
7575
layout: FULL_WIDTH,
76-
placeholder: DOMINANT_COLOR,
77-
quality: 100
76+
placeholder: DOMINANT_COLOR
7877
)
7978
}
8079
}
8180
desktop: file(relativePath: {eq: "images/fractal-desktop.png"}) {
8281
childImageSharp {
8382
gatsbyImageData(
8483
layout: FULL_WIDTH,
85-
placeholder: DOMINANT_COLOR,
86-
quality: 100
84+
placeholder: DOMINANT_COLOR
8785
)
8886
}
8987
}
9088
}
9189
`)
92-
console.log(getImage(hero.desktop))
93-
console.log(getImage(hero.mobile))
9490

9591
const responsiveImages = withArtDirection(getImage(hero.desktop), [
9692
{

src/sections/projects.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ export default function Projects() {
2424
image {
2525
childImageSharp {
2626
gatsbyImageData(
27-
layout: CONSTRAINED,
28-
placeholder: DOMINANT_COLOR,
29-
quality: 100,
27+
layout: CONSTRAINED,
3028
transformOptions: {duotone: {highlight: "#0088ff", shadow: "#000000"}}
3129
)
3230
}

src/styling/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { createGlobalStyle } from 'styled-components'
22

33
export const primary = '#00aaff'
4-
export const darkPrimary = '#00a33ee'
4+
export const darkPrimary = '#005580'
55
export const secondary = '#ffdd00'
66

77
export default createGlobalStyle`

0 commit comments

Comments
 (0)