Skip to content

Commit

Permalink
fix(gatsby-remark-autolink-headers): option to disable "position: rel…
Browse files Browse the repository at this point in the history
…ative" when icon is not present (#27022)
  • Loading branch information
parulc7 authored Sep 28, 2020
1 parent b7e2857 commit 8807fea
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ Object {
"data": Object {
"hProperties": Object {
"id": "heading-uno",
"style": "position:relative;",
},
"htmlAttributes": Object {
"id": "heading-uno",
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-remark-autolink-headers/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]({
Expand Down

0 comments on commit 8807fea

Please sign in to comment.