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

MDL-78282 - [docs] Document sr_text output method #693

Merged
merged 1 commit into from
Aug 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions docs/apis/subsystems/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<span class="sr-only">Contents</span>
```

## See also

- [HTML Guidelines](https://docs.moodle.org/dev/HTML_Guidelines)
Expand Down
Loading