diff --git a/packages/gatsby-remark-images/src/__tests__/gatsby-node.js b/packages/gatsby-remark-images/src/__tests__/gatsby-node.js index 9a2dbf9a2b3a9..99f7dd2a01b0a 100644 --- a/packages/gatsby-remark-images/src/__tests__/gatsby-node.js +++ b/packages/gatsby-remark-images/src/__tests__/gatsby-node.js @@ -9,7 +9,7 @@ describe(`pluginOptionsSchema`, () => { `"showCaptions" must be a boolean`, `"markdownCaptions" must be a boolean`, `"sizeByPixelDensity" must be a boolean`, - `"wrapperStyle" must be one of [object]`, + `"wrapperStyle" must be one of [object, string]`, `"backgroundColor" must be a string`, `"quality" must be a number`, `"withWebp" must be a boolean`, @@ -26,7 +26,7 @@ describe(`pluginOptionsSchema`, () => { showCaptions: `This should be a boolean`, markdownCaptions: `This should be a boolean`, sizeByPixelDensity: `This should be a boolean`, - wrapperStyle: `This should be an object`, + wrapperStyle: true, backgroundColor: 123, quality: `This should be a number`, withWebp: `This should be a boolean`, diff --git a/packages/gatsby-remark-images/src/gatsby-node.js b/packages/gatsby-remark-images/src/gatsby-node.js index fa437b99d2112..04c7d4b3c0d80 100644 --- a/packages/gatsby-remark-images/src/gatsby-node.js +++ b/packages/gatsby-remark-images/src/gatsby-node.js @@ -27,7 +27,8 @@ exports.pluginOptionsSchema = function ({ Joi }) { ), wrapperStyle: Joi.alternatives().try( Joi.object({}).unknown(true), - Joi.function().maxArity(1) + Joi.function().maxArity(1), + Joi.string() ), backgroundColor: Joi.string().default(`white`) .description(`Set the background color of the image to match the background image of your design.