ui/packages/consul-ui/app/modifiers/fix-code-block-aria.mdx
Fixes ARIA accessibility issues in HDS CodeBlock components by adding role="region" to <pre> elements that have aria-labelledby but no role attribute.
HDS CodeBlock renders invalid ARIA markup:
<!-- Missing role attribute -->
<pre aria-labelledby="title-123">
<code>console.log('hello');</code>
</pre>
Apply to a parent element containing CodeBlock components:
<div {{fix-code-block-aria}}>
<Hds::CodeBlock
@language="javascript"
@value="console.log('Hello, World!');"
as |CB|
>
<CB.Title>Example Code</CB.Title>
</Hds::CodeBlock>
</div>
role="region" to fix ARIA violations<pre> elements with aria-labelledby and no existing roleTemporary workaround - remove when HDS is updated to include proper ARIA roles.