Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADR 2.0.1 <pre> URI's have wrong highlighting creating A11Y contrast issues #642

Open
bwbroersma opened this issue Jan 13, 2025 · 0 comments

Comments

@bwbroersma
Copy link

bwbroersma commented Jan 13, 2025

Currently <pre>URI</pre> is used, see DesignRules.md#L51:

<pre>https://api.example.org/v1/gebouwen<br/>https://api.example.org/v1/vergunningen</pre>

In the published ADR 2.0.0 this results in no contrast issues, but highlightjs will wrongly auto detected this as JavaScript, so https: as label and the following // as comment:

<code class="hljs javascript">https:<span class="hljs-comment">//api.example.org/v1/gebouwen</span>
https:<span class="hljs-comment">//api.example.org/v1/vergunningen</span></code>

There is no contrast issue in ADR 2.0.0, but in ADR 2.0.1 is probably generated with a newer highlightjs version, since the generated HTML now also has the hljs-attr styling class:

<code class="hljs javascript"><span class="hljs-attr">https</span>:<span class="hljs-comment">//api.example.org/v1/gebouwen</span>
<span class="hljs-attr">https</span>:<span class="hljs-comment">//api.example.org/v1/vergunningen</span></code>

Together with a color change, the contrast of the 'comment part' of the URI against the background is 2.32, which is too low for WCAG AA rating.

Maybe the nohighlight class should be used? E.g.

<pre class="nohighlight">https://uri</pre>

BTW If your unfamiliar, see the Firefox Developer Tools, Accessibility tab and check for contrast:
Screenshot of Firefox Developer Tools Accessibility tab
Also see MDN about WCAG ratings for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant