Skip to content

Latest commit

 

History

History
60 lines (40 loc) · 1.49 KB

hccss.rst

File metadata and controls

60 lines (40 loc) · 1.49 KB

dojo/hccss

since

v1.8

Introduction

By doing a require() of "dojo/hccss", the "dj_a11y" CSS class will be added to your document's <body> tag if the machine is in high contrast mode, and thus the browser doesn't display background images.

This is useful for Internet Explorer and Firefox running on Windows. It doesn't apply to Chrome or Safari (on mobile, mac, or desktop), which always display background images.

hccss will also set the has("highcontrast") flag so code can check directly whether or not it's in high contrast mode.

Usage

Simply require the module:

And then reference the class name from CSS rules, etc.:

Execution Time

Note that the dojo/domReady! dependency (if present) will resolve before the CSS class is added. Thus if your widget has JavaScript sizing code, it's not sufficient to wait for dojo/domReady!. Rather, the widget should be instantiated inside of a ready() call: