-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A11y/announce placeholders #1801
Conversation
🧪 Review environmenthttps://umc2kl5u6zgtof3agf7ucnmmia0kyxap.lambda-url.ca-central-1.on.aws/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't appear to work, <span class="placeholder">...</span>
is still in the template preview. I think you'd need to modify utils to change the way template previews are rendered.
That said, this technique buries language strings inside of CSS, which may make them hard to find for future developers. I wonder if there is a way to keep the language strings outside of CSS?
Could an alternative be to output these strings into the markup using the sr-only
class?
We have a matching utils PR. Since this PR has no effect, it would be safer to merge before.
Discussing this further, we also don't really want to start adding translations in utils, and try to keep most of it in admin.
A few things to think through:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works well, just a few questions about how we refer to variables and some commented out markup that should likely be removed.
@@ -29,4 +29,5 @@ <h2 class="heading-medium">{{ _('Ready to send?') }}</h2> | |||
{{ template|string|translate_preview_template }} | |||
</div> | |||
|
|||
<!-- <div id="placeholder_tag" role="tooltip" aria-hidden="true">Placeholder variable</div> --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! Thanks
|
||
/* BEGINS or ENDS */ | ||
[lang*="en"] mark[class*="placeholder"]::before { | ||
content: " [" var(--name) " begins] "; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of the square brackets here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe they ensure a short pause. Looking at this table, only Voiceover would pause. NVDA and JAWS would announce "brackets" twice.
JAWS always announces everything. Only pauses at commas, semicolons and ellipses
NVDA would pause with regular parenthesis ()
I don't mind using semicolons, nobody will see them!
|
||
/* PLACEHOLDER TYPES */ | ||
[lang*="en"] mark.placeholder { | ||
--name: "custom content"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The phrase "custom content" confused me here. Why not call this "variable" or "variable content" instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just looked through the guidance and see that we do indeed call this "custom content" - but I still this think is a confusing way to refer to it. Maybe we should update the guidance? @YedidaZalik what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whenever we do update the guidance, we'll have other things to clean up within admin. I suggest we be consistent for now, and decide if we want to re-consider this term. We also have similar work planned in cds-snc/notification-planning#1350
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah makes sense to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 "custom content" was chosen by Yael a year or so ago
0bb133b
to
0a47076
Compare
This reverts commit f6670a4.
Summary | Résumé
Fixes cds-snc/notification-planning#1456
This slightly overhauls how placeholders are rendered in the admin interface.
SPAN
elements withMARK
, which is apparently more suited for this type of thingMARK
elements to announce the placeholder.Test instructions | Instructions pour tester la modification
2. SMS template with a conditional and custom content
3. Email template with a conditional and custom content