Skip to content

Commit

Permalink
regenerate for highlight assertive alerts pink, phetsims/chipper#991
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Feb 2, 2021
1 parent c24fb65 commit ac4a0f9
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions friction_a11y_view.html
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@
font-weight: bold;
}

.assertive {
background-color: pink; /* do not change color without changing the doc in "About Interactive Alerts" */
border-radius: .2em;
}

/* ************SAFARI ONLY *********************** */
.left-safari {
display: inline-block;
Expand Down Expand Up @@ -179,8 +184,9 @@ <h1>A11y View: Friction</h1>
<h3>Activity log of Interactive Alerts</h3>
<details>
<summary>About Interactive Alerts</summary>
Interactive alerts are read out as the user interacts providing a description of what is happening in
real-time. Alerts appear in reverse chronological order with the latest on top.
Interactive alerts (powered by aria-live) are read out as the user interacts providing a description of what
is happening in real-time. Alerts appear in reverse chronological order with the latest on top. In general
all aria-live alerts are polite, but assertive alerts are highlighted with pink.
</details>
<div id='alert-copy-container' class='alert_copy_container' role='presentation'>
<div id='polite-element-container'>
Expand Down Expand Up @@ -435,6 +441,10 @@ <h3>PDOM & Descriptions for Friction</h3>
const listItem = document.createElement( 'li' );
listItem.style.opacity = 1.0;
listItem.textContent = alertText;
if ( mutation.target.id.includes( 'assertive' ) ) {
listItem.classList.add( 'assertive' );
}

listElement.insertBefore( listItem, listElement.children[ 0 ] );

// items fade out as they get older
Expand Down

0 comments on commit ac4a0f9

Please sign in to comment.