From a162f57d12911a4a8fe3f7315059bc060616f612 Mon Sep 17 00:00:00 2001 From: Ferran Recio Date: Wed, 26 Jul 2023 15:56:23 +0200 Subject: [PATCH] [docs] Document sr_text output method --- docs/apis/subsystems/output.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/apis/subsystems/output.md b/docs/apis/subsystems/output.md index c99f01bc60..16b8191b1c 100644 --- a/docs/apis/subsystems/output.md +++ b/docs/apis/subsystems/output.md @@ -313,6 +313,26 @@ Some interesting parameters for this function are: - `classes`: The classes of the paragraph. Note that this parameter is a comma-separated list of classes, not an array. - `id`: An optional id of the paragraph. +#### sr_text() + +```php +function sr_text(string $contents): string +``` + +This function should be used to: + +- Print an inline text for screen readers only. + +Some interesting parameters for this function are: + +- `contents`: The contents fo screen readers. + +In the standard Boost theme this method will output a span using the [Bootstrap screen reader class](https://getbootstrap.com/docs/4.0/getting-started/accessibility/#visually-hidden-content): + +```html +Contents +``` + ## See also - [HTML Guidelines](https://docs.moodle.org/dev/HTML_Guidelines)