cssinjs / jss

JSS is an authoring tool for CSS which uses JavaScript as a host language.
https://cssinjs.org
MIT License
7.07k stars 397 forks source link

jss-plugin-a11y - jss support for WCAG 2.1 #1411

Open tlenex opened 3 years ago

tlenex commented 3 years ago

Is your feature request related to a problem? Please describe. The idea is to help using web (built with jss), by disabled or partially-disabled end-users.

I'd like to suggest a feature request in form of plugin enabling basic a11y jss transformations.

Rules should transform jss to be as close as possible to WCAG 2.1 guideline. Mainly the plugin should support at least features like:

Any other ideas for improvements are warmly welcome.

Describe the solution you'd like When using the plugin, all CSS nodes should be transformed, based on options and end-user interactions. Options should be passed to the plugin with API like this:

jss.use(jssA11yPlugin({showWarnings: true, ...someOtherOptions});

jssA11yPlugin.scaleFontSize(0.5);
jssA11yPlugin.resetFontSize();

jssA11yPlugin.applyHighContrast();
jssA11yPlugin.resetHighContrast();

Some more methods should be available to rebuild styles and reattatch stylesheets. Same goes for exposing method for font scaling as well as contrast changing and interacting with other features. Above is just a draft-like proposal. There could be be some concerns for SRR, but I'm not sure. Performance is another thing for concerns.

Are you willing to implement it? Unfortunately, I don't have time to do it :( But wanted to make a point about a11y. Great work with jss! Using it lately a lot!

kof commented 3 years ago

I am happy if someone implements it, also it can be done in userland.