Skip to content

Commit

Permalink
Use standard WP component to hide things
Browse files Browse the repository at this point in the history
  • Loading branch information
getdave committed Aug 10, 2023
1 parent 37748a1 commit 93e0f7f
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
/**
* WordPress dependencies
*/
import { VisuallyHidden } from '@wordpress/components';

export default function AccessibleDescription( { id, children } ) {
return (
<div
id={ id }
className="wp-block-navigation__description screen-reader-text"
>
{ children }
</div>
<VisuallyHidden>
<div id={ id } className="wp-block-navigation__description">
{ children }
</div>
</VisuallyHidden>
);
}

0 comments on commit 93e0f7f

Please sign in to comment.