Skip to content

Commit

Permalink
Don't overflow x scroll on code blocks
Browse files Browse the repository at this point in the history
This runs into an issue with lighthouse accessibility scores
See dequelabs/axe-core#2483
  • Loading branch information
seancdavis committed Sep 11, 2020
1 parent 9e3545c commit 1dd3d49
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/_assets/css/global/code-blocks.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ pre {
@apply bg-gray-light
p-4
rounded-md
text-sm;
text-sm
whitespace-pre-wrap;
}

code:not(.hljs) {
@apply block
overflow-x-scroll
text-black;
text-black
whitespace-pre-wrap;
}
}

Expand Down
5 changes: 4 additions & 1 deletion src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@ Each plugin (utility) requires a **single named export** as `default`. Check out

```js
exports.default = (eleventyConfig) => {
eleventyConfig.addPairedShortcode("markdown", (input) => exports.renderMarkdown(input))
eleventyConfig.addPairedShortcode(
"markdown",
(input) => exports.renderMarkdown(input)
)
}
```

Expand Down

0 comments on commit 1dd3d49

Please sign in to comment.