Skip to main content

Crate ravenrs_app_a11y

Crate ravenrs_app_a11y 

Source
Expand description

The accessibility of a RavenRS business application, so that every application made with ravenrs-app reaches screen readers and the keyboard with nothing written for them.

  • AccessibleText says what a field or an action is called and what is said after it, from the model: the caption, unless the declaration or the model says otherwise.
  • Announcer says what changed, such as a record kept or deleted, through a LiveRegion.
  • AccessWords are the words of those announcements, by key, in each language.
  • Audit walks an application with no window and says what keeps someone out: a control with no name, focus that is held, contrast too low on its themes, two commands on the same keys. A test of any example calls it.
use ravenrs_app_a11y::{AccessibleText, Audit};
use ravenrs_app::{FieldInfo, FieldKind};

let until = FieldInfo::new("until", FieldKind::Date).caption("Até").accessible_name("Fim do período");
assert_eq!(AccessibleText::of_field(&until, None, "Até").name, "Fim do período");

let mut ui = ravenrs_widgets::Ui::new(ravenrs_widgets::Button::new("Salvar"), ravenrs_style::Theme::raven_light());
Audit::new().screen(&mut ui, "início").assert_clean();

Re-exports§

pub use words::AccessWords;

Modules§

words
What screen readers hear from the framework itself, in each language.

Structs§

AccessibleText
The name and the description screen readers get for a field or an action.
Announcement
One thing said to screen readers.
Announcer
Where an application says what changed. A handle: clones say it in the same place.
Audit
How to walk an application, and what to look at.
Finding
A problem, and where it was found.
LiveRegion
What an Announcer says, as a node of the accessibility tree and nothing on the screen.
Report
What an audit found, and where it looked.

Enums§

Problem
What keeps someone out.
Urgency
How soon an announcement is heard.

Constants§

TEXT_CONTRAST
The least contrast for text, as WCAG asks of normal text (AA).
UI_CONTRAST
The least contrast for what is not text but has to be seen, such as the focus ring (AA).

Functions§

check_focus
Presses Tab across the screen and says whether the focus moves and reaches every control. The focus is left where the last press put it.
check_shortcuts
Commands of the latest frame that answer to the same keys.
check_theme
The pairs of colors of theme that are too close to read.
check_tree
What is wrong with the names and ids of a tree.
is_control
Roles that are operated, so they must say what they are.