Skip to content
Gaël Poupard edited this page Sep 15, 2022 · 8 revisions

You can use a11y.css in multiple ways.

Add-on for Firefox and Chrome

Thanks to @notabene, a webextension is available for both Chrome and Firefox. Check out a11y.css webextension's repository.

It provides some nice features not included in the main CSS file (for now), such as:

  • force focus visibility;
  • show lang attributes;
  • check images' alternatives by displaying them;
  • increase text spacings.

As a WebExtension, it also enables to:

  • toggle CSS and change level on the fly,
  • remember settings for each tab,
  • automatically update in the background.

Bookmarklet

You can easily use the latest version of this stylesheet by adding this bookmarklet to your bookmarks:

javascript:(function(){a11ycss=document.createElement('LINK');a11ycss.href='https://rawgit.com/ffoodd/a11y.css/master/css/a11y-en.css';a11ycss.rel='stylesheet';a11ycss.media='all';document.body.appendChild(a11ycss);})();

You can use any of the compiled CSS files as a bookmarklet, to chose language and minimum level.

However, you'll need to refresh your page to get rid off this CSS…

A note on CSP

CSP are awesome, but may prevent bookmarklets usage. Let’s be honest, in theory you should not update your CSP directives to allow bookmarklets.

However it appears that some browsers have bugs when implementing CSP, preventing us from simply use bookmarklets. Here are two directives you need to add, while waiting for browsers to fix their bugs:

  • script-src 'unsafe-inline'
  • style-src https://rawgit.com/

And you should be good! If you want to know more about bugs I mentioned (and discover great resources to help you with CSP usage) I suggest you read issue #201 opened and documented by the awesome Nicolas Hoffmann.

CSS file

You will find static CSS files in the /css folder. CSS files are available in French, English, Spanish, Greek, Arabic, Portugese, Russian, Chinese and Polish — and leveled or full.

Direct download

You can simply download it and add it to your usual stack, just like any CSS.

Package manager

You may use a11y.css as any dependency, through npm:

npm install a11y.css

Or Yarn — or Bower if you're stuck in 2009.