A11Y: composer tip close link should be a button (#23731)

This commit is contained in:
Kris 2023-10-03 09:09:54 -04:00 committed by GitHub
parent 70be873b9c
commit c9db9e9319
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 40 additions and 58 deletions

View File

@ -0,0 +1,7 @@
<DButton
@action={{@action}}
@icon="times"
@label="composer.esc"
@ariaLabel="composer.esc_label"
class="btn-flat close"
/>

View File

@ -1,12 +1,4 @@
<a <ComposerTipCloseButton @action={{fn this.closeMessage this.message}} />
href
{{on "click" (fn this.closeMessage this.message)}}
class="close"
aria-label={{i18n "composer.esc_label"}}
>
{{i18n "composer.esc"}}
{{d-icon "times"}}
</a>
{{html-safe this.message.body}} {{html-safe this.message.body}}

View File

@ -1,12 +1,4 @@
<a <ComposerTipCloseButton @action={{fn this.closeMessage this.message}} />
href
{{on "click" (fn this.closeMessage this.message)}}
class="close"
aria-label={{i18n "composer.esc_label"}}
>
{{i18n "composer.esc"}}
{{d-icon "times"}}
</a>
{{#if this.message.title}} {{#if this.message.title}}
<h3>{{this.message.title}}</h3> <h3>{{this.message.title}}</h3>

View File

@ -1,12 +1,4 @@
<a <ComposerTipCloseButton @action={{fn this.closeMessage this.message}} />
href
{{on "click" (fn this.closeMessage this.message)}}
class="close"
aria-label={{i18n "composer.esc_label"}}
>
{{i18n "composer.esc"}}
{{d-icon "times"}}
</a>
{{html-safe this.message.body}} {{html-safe this.message.body}}

View File

@ -1,11 +1,5 @@
<a <ComposerTipCloseButton @action={{fn this.closeMessage this.message}} />
href
{{on "click" (fn this.closeMessage this.message)}}
class="close"
aria-label={{i18n "composer.esc_label"}}
>
{{i18n "composer.esc"}}
{{d-icon "times"}}
</a>
{{html-safe this.message.body}} <p>
{{html-safe this.message.body}}
</p>

View File

@ -1,12 +1,4 @@
<a <ComposerTipCloseButton @action={{fn this.closeMessage this.message}} />
href
{{on "click" (fn this.closeMessage this.message)}}
class="close"
aria-label={{i18n "composer.esc_label"}}
>
{{i18n "composer.esc"}}
{{d-icon "times"}}
</a>
<h3>{{i18n "composer.similar_topics"}}</h3> <h3>{{i18n "composer.similar_topics"}}</h3>

View File

@ -92,6 +92,14 @@
box-shadow: var(--shadow-dropdown); box-shadow: var(--shadow-dropdown);
background: var(--highlight-bg); background: var(--highlight-bg);
> p,
h3 {
&:first-of-type {
margin-top: 0;
margin-right: 3em;
}
}
&.urgent { &.urgent {
background: var(--danger-low); background: var(--danger-low);
} }
@ -105,10 +113,9 @@
bottom: unset; bottom: unset;
padding: 2.25em 6em 2.5em 2.25em; padding: 2.25em 6em 2.5em 2.25em;
p { p {
margin-top: 0;
font-size: var(--font-up-1); font-size: var(--font-up-1);
} }
button { button:not(.close) {
margin-top: 0.5em; margin-top: 0.5em;
} }
} }
@ -117,21 +124,27 @@
margin-bottom: 10px; margin-bottom: 10px;
} }
a.close { .btn.close {
display: flex; flex-direction: row-reverse;
align-items: center; align-items: center;
position: absolute; position: absolute;
right: 10px; right: 0.67em;
top: 10px; top: 0.67em;
color: var(--primary); color: var(--primary-medium);
opacity: 0.5;
font-size: var(--font-0); font-size: var(--font-0);
.d-icon { .d-icon {
color: currentColor;
font-size: var(--font-up-1); font-size: var(--font-up-1);
margin-left: 0.25em; margin: 0 0 0 0.25em;
} }
&:hover { .discourse-no-touch & {
opacity: 1; &:active,
&:focus {
background: transparent;
.d-icon {
color: var(--primary);
}
}
} }
} }

View File

@ -2353,7 +2353,7 @@ en:
drafts_offline: "drafts offline" drafts_offline: "drafts offline"
edit_conflict: "edit conflict" edit_conflict: "edit conflict"
esc: "esc" esc: "esc"
esc_label: "Click or press Esc to dismiss" esc_label: "dismiss message"
ok_proceed: "Ok, proceed" ok_proceed: "Ok, proceed"
group_mentioned_limit: group_mentioned_limit: