diff --git a/11ty-extensions/markdown-it-config.js b/11ty-extensions/markdown-it-config.js index c43eabaea..ec354357b 100644 --- a/11ty-extensions/markdown-it-config.js +++ b/11ty-extensions/markdown-it-config.js @@ -86,7 +86,11 @@ export default function(eleventyConfig) { //Configure markdown-it plugins mdLib.use(markdownItAttrs); - mdLib.use(markdownItAnchor, { tabIndex: false, slugify: s => slugify(s) }); + mdLib.use(markdownItAnchor, { + tabIndex: false, + slugify: s => slugify(s), + permalink: markdownItAnchor.permalink.headerLink(), + }); mdLib.use(markdownItContainer, "intro"); mdLib.use(markdownItContainer, "orientation"); mdLib.use(markdownItContainer, "storystep"); diff --git a/src/scss/_base-element-styles.scss b/src/scss/_base-element-styles.scss index 0e3902950..e60aeaa0d 100644 --- a/src/scss/_base-element-styles.scss +++ b/src/scss/_base-element-styles.scss @@ -50,6 +50,23 @@ a { svg { height: 100%; } + + &.header-anchor { + text-decoration: none; + color: inherit; + + &:hover, &:focus { + text-decoration: underline; + + &::before { + display: block; + float: left; + width: 0.75em; + margin-left: -0.75em; + content: '#'; + } + } + } } button {