Skip to content

Commit

Permalink
Improve accessibility of code snippets
Browse files Browse the repository at this point in the history
‘@11ty/eleventy-plugin-syntaxhighlight’ recently [added][1] support for
preAttributes that can be used to put a tabindex attributes on a
scrollable (`overflow: auto;`) `<pre>` element. It's not yet the default
setting for these elements, but this sets it through the eleventy
config.

[1]: 11ty/eleventy-plugin-syntaxhighlight#48
  • Loading branch information
matijs committed May 26, 2021
1 parent 993354d commit f2b58e0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ module.exports = (config) => {
linkify: false,
}).use(markdownItFootnote)
);
config.addPlugin(require('@11ty/eleventy-plugin-syntaxhighlight'));
config.addPlugin(require('@11ty/eleventy-plugin-syntaxhighlight'), {
preAttributes: { tabindex: 0 },
});
config.addPassthroughCopy('src/site/robots.txt');
config.addWatchTarget('src/utils');

Expand Down

0 comments on commit f2b58e0

Please sign in to comment.