From 8807fea05a53e85958ea50851a8ea66e7b664b02 Mon Sep 17 00:00:00 2001 From: Parul Chandel Date: Mon, 28 Sep 2020 13:07:03 +0530 Subject: [PATCH] fix(gatsby-remark-autolink-headers): option to disable "position: relative" when icon is not present (#27022) --- .../src/__tests__/__snapshots__/index.js.snap | 1 - packages/gatsby-remark-autolink-headers/src/index.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/gatsby-remark-autolink-headers/src/__tests__/__snapshots__/index.js.snap b/packages/gatsby-remark-autolink-headers/src/__tests__/__snapshots__/index.js.snap index 80f26fe056b92..45b4182438a97 100644 --- a/packages/gatsby-remark-autolink-headers/src/__tests__/__snapshots__/index.js.snap +++ b/packages/gatsby-remark-autolink-headers/src/__tests__/__snapshots__/index.js.snap @@ -225,7 +225,6 @@ Object { "data": Object { "hProperties": Object { "id": "heading-uno", - "style": "position:relative;", }, "htmlAttributes": Object { "id": "heading-uno", diff --git a/packages/gatsby-remark-autolink-headers/src/index.js b/packages/gatsby-remark-autolink-headers/src/index.js index b15ade2ced198..8389184e303ad 100644 --- a/packages/gatsby-remark-autolink-headers/src/index.js +++ b/packages/gatsby-remark-autolink-headers/src/index.js @@ -60,9 +60,9 @@ module.exports = ( patch(data, `hProperties`, {}) patch(data.htmlAttributes, `id`, id) patch(data.hProperties, `id`, id) - patch(data.hProperties, `style`, `position:relative;`) if (icon !== false) { + patch(data.hProperties, `style`, `position:relative;`) const label = id.split(`-`).join(` `) const method = isIconAfterHeader ? `push` : `unshift` node.children[method]({