2016-09-09 06:48:17 +02:00
---
layout: docs
2019-02-07 10:29:06 +01:00
title: Screen readers
description: Use screen reader utilities to hide elements on all devices except screen readers.
2019-05-23 11:56:03 +02:00
group: helpers
2016-09-09 06:48:17 +02:00
---
2020-07-03 13:38:11 +02:00
Hide an element to all devices **except screen readers** with `.visually-hidden` . Use `.visually-hidden-focusable` to show the element only when it's focused (e.g. by a keyboard-only user). Can also be used as mixins.
2016-09-09 06:48:17 +02:00
2019-01-08 17:33:28 +01:00
{{< example > }}
2020-07-03 13:38:11 +02:00
< h2 class = "visually-hidden" > Title for screen readers< / h2 >
< a class = "visually-hidden-focusable" href = "#content" > Skip to main content< / a >
2019-01-08 17:33:28 +01:00
{{< / example > }}
2016-09-09 06:48:17 +02:00
2019-01-08 17:33:28 +01:00
{{< highlight scss > }}
2016-09-09 06:48:17 +02:00
// Usage as a mixin
2019-05-20 10:03:51 +02:00
2020-07-03 13:38:11 +02:00
.visually-hidden-title {
@include visually-hidden;
2019-05-20 10:03:51 +02:00
}
.skip-navigation {
2020-07-03 13:38:11 +02:00
@include visually-hidden-focusable;
2016-09-09 06:48:17 +02:00
}
2019-01-08 17:33:28 +01:00
{{< / highlight > }}