Skip to content

emonidi/accessibility-rs

 
 

Repository files navigation

accessibility-rs

The Rust web accessibility engine.

Usage

[dependencies]
accessibility-rs = "^0.0.49"
use accessibility_rs::{audit, AuditConfig};
// pass in raw html, optional css, bounding box clips, and locale for audit
let audit = accessibility_rs::audit(&AuditConfig::new(&html, &css, false, "en"));

Documentation

Module documentation with examples.

Features

  1. Accurate web accessibility WCAG audits.
  2. Incredibly fast nanosecond audits.
  3. Ideal shapes for audits that scale.
  4. Shortest path CSS selectors for elements.
  5. i18n support for multiple languages.
  6. Re-creating layout tree to get element position coordinates.
audit-speed/core/audit: small html (4k iterations)
time: [60.988 µs 61.067 µs 61.157 µs]
audit-speed/core/audit: medium html (4k iterations)
time: [890.56 µs 905.52 µs 923.23 µs]
audit-speed/core/audit: large html (4k iterations)
time: [1.1316 ms 1.1101 ms 1.1478 ms]

Examples

  1. Wasm example view kayle_innate.
  2. Example integrating with a headless browser.

Contributing

To help improve the rules the following needs to be done:

  1. Add the rule to the tracking list - you can use the standards list and mappings here for help.
  2. Add the logic of handling the rule to wcag_rule_map and the techniques.
  3. Add unit test.

License

This project is licensed under either of

About

Web accessibility engine for Rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 99.7%
  • Other 0.3%