Commit 453c3ac4 authored by jun's avatar jun
Browse files

MDL-75055 templates: Apply the .alert-dismissible class

- Apply the .alert-dismissible class for notification alerts with
close button to fix its positioning. As an added bonus, the
.alert-dismissible class also enlarges the clickable area of the
close button which is great for accessibility.
- Improve example context for the notification alerts templates.
parent 3ce2cde7
......@@ -34,9 +34,14 @@
* announce Whether the notification should be announced to screen readers.
Example context (json):
{ "message": "Your pants are on fire!", "closebutton": 1, "announce": 1, "extraclasses": "foo bar"}
"message": "<p>Hello <a href=\"#\">World!</a></p><p>Your pants are on fire!</p>",
"closebutton": 1,
"announce": 1,
"extraclasses": "foo bar"
<div class="alert {{$alertclass}}alert-secondary{{/alertclass}} alert-block fade in {{ extraclasses }}" {{!
<div class="alert {{$alertclass}}alert-secondary{{/alertclass}} alert-block fade in {{ extraclasses }} {{#closebutton}}alert-dismissible{{/closebutton}}" {{!
}}{{# announce }} role="alert" data-aria-autofocus="true"{{/ announce }}>
{{{ message }}}
{{# closebutton }}{{!
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment