Skip to content

Commit 8807fea

Browse files
authored
fix(gatsby-remark-autolink-headers): option to disable "position: relative" when icon is not present (#27022)
1 parent b7e2857 commit 8807fea

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

packages/gatsby-remark-autolink-headers/src/__tests__/__snapshots__/index.js.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,6 @@ Object {
225225
"data": Object {
226226
"hProperties": Object {
227227
"id": "heading-uno",
228-
"style": "position:relative;",
229228
},
230229
"htmlAttributes": Object {
231230
"id": "heading-uno",

packages/gatsby-remark-autolink-headers/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ module.exports = (
6060
patch(data, `hProperties`, {})
6161
patch(data.htmlAttributes, `id`, id)
6262
patch(data.hProperties, `id`, id)
63-
patch(data.hProperties, `style`, `position:relative;`)
6463

6564
if (icon !== false) {
65+
patch(data.hProperties, `style`, `position:relative;`)
6666
const label = id.split(`-`).join(` `)
6767
const method = isIconAfterHeader ? `push` : `unshift`
6868
node.children[method]({

0 commit comments

Comments
 (0)