conkeyref - DITA Accessibility Best Practice?
Posted: Wed Aug 03, 2022 11:41 pm
I have a DITA best practice question. I'm using Font Icons defined in a key file to conkeyref the same icon used by the application I'm documenting, thus eliminating the need for icon screen captures.
My key file contains the following:
<uicontrol id="icon-user" outputclass="icon_icon-user"/>
My oXygen custom CSS has the following:
@font-face {
font-family: proliantIcons;
src: url(fonts/Proliant_v3.ttf);
}
[outputclass^="icon_"], [outputclass*= "icon_"] {
font-family: proliantIcons;
font-weight: normal;
font-style: normal;
text-decoration: inherit;
}
[outputclass*= "_icon-user"]:before {
content: "\e9a1";
font-family: proliantIcons;
}
And a command in my task topic pulls the font icon into my topic as follows:
<cmd>Select <uicontrol conkeyref="icons/icon-user"/> to enter payroll information for a single employee.</cmd>
Everything works great for getting the icon into a topic and getting that icon to publish to all necessary output types.
However, this solution does not produce accessible content because a screen reader does not have any text to fall back on when the font icon is encountred in the output. If I were using an image of the icon, I would simply include the hover text from the application as alt text.
I considered using a conkeyref to a ph element that includes the textual description of the icon, but that's not a great solution because this icon is used in multiple places in the application and the hover text is not the same in all uses.
Can anyone think of a best practice that I'm missing? I might be able to use otherprops in some way and customize a transform to write the string used in the attribute into my output as an attribute that a screen reader can recognize, but that does not feel like a sustainable approach.
Thank you so much for your help!
My key file contains the following:
<uicontrol id="icon-user" outputclass="icon_icon-user"/>
My oXygen custom CSS has the following:
@font-face {
font-family: proliantIcons;
src: url(fonts/Proliant_v3.ttf);
}
[outputclass^="icon_"], [outputclass*= "icon_"] {
font-family: proliantIcons;
font-weight: normal;
font-style: normal;
text-decoration: inherit;
}
[outputclass*= "_icon-user"]:before {
content: "\e9a1";
font-family: proliantIcons;
}
And a command in my task topic pulls the font icon into my topic as follows:
<cmd>Select <uicontrol conkeyref="icons/icon-user"/> to enter payroll information for a single employee.</cmd>
Everything works great for getting the icon into a topic and getting that icon to publish to all necessary output types.
However, this solution does not produce accessible content because a screen reader does not have any text to fall back on when the font icon is encountred in the output. If I were using an image of the icon, I would simply include the hover text from the application as alt text.
I considered using a conkeyref to a ph element that includes the textual description of the icon, but that's not a great solution because this icon is used in multiple places in the application and the hover text is not the same in all uses.
Can anyone think of a best practice that I'm missing? I might be able to use otherprops in some way and customize a transform to write the string used in the attribute into my output as an attribute that a screen reader can recognize, but that does not feel like a sustainable approach.
Thank you so much for your help!