Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
66 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
.. _dojo/hccss: | ||
|
||
========== | ||
dojo/hccss | ||
========== | ||
|
||
:since: v1.8 | ||
|
||
.. contents :: | ||
:depth: 2 | ||
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: | ||
|
||
.. js :: | ||
require(["dojo/hccss"]); | ||
And then reference the class name from CSS rules, etc.: | ||
|
||
.. css :: | ||
.myTitlePane .label { | ||
/* normally hide the label in preference to the icon */ | ||
display: none; | ||
} | ||
.dj_a11y .myTitlePane .label { | ||
/* but display the label in high contrast mode, since the icon won't appear */ | ||
display: block; | ||
} | ||
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: | ||
|
||
.. js :: | ||
require(["dojo/ready", "dojo/hccss"], function(ready){ | ||
ready(function(){ // wait for DOMReady and for hccss code to execute | ||
new MyTitlePane(...); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters