tweak message

pull/13130/head
Rich Harris 2 years ago
parent 860abf91c6
commit 6148893b6f

@ -24,7 +24,7 @@
## a11y_consider_explicit_label
> `<%element%>` element is empty and has no aria-label or aria-labelledby. Add content or an aria-label for better accessibility.
> Buttons and links should either contain text or have an `aria-label` or `aria-labelledby` attribute
## a11y_distracting_elements

@ -1010,7 +1010,7 @@ export function check_element(node, state) {
w.a11y_missing_content(node, node.name);
missing_content_warning_fired = true;
} else {
w.a11y_consider_explicit_label(node, node.name);
w.a11y_consider_explicit_label(node);
}
}
@ -1042,7 +1042,7 @@ export function check_element(node, state) {
if (node.name === 'button') {
if (!is_hidden && !has_content(node) && !contains_a11y_label) {
w.a11y_consider_explicit_label(node, node.name);
w.a11y_consider_explicit_label(node);
}
}

@ -176,12 +176,11 @@ export function a11y_click_events_have_key_events(node) {
}
/**
* `<%element%>` element is empty and has no aria-label or aria-labelledby. Add content or an aria-label for better accessibility.
* Buttons and links should either contain text or have an `aria-label` or `aria-labelledby` attribute
* @param {null | NodeLike} node
* @param {string} element
*/
export function a11y_consider_explicit_label(node, element) {
w(node, "a11y_consider_explicit_label", `\`<${element}>\` element is empty and has no aria-label or aria-labelledby. Add content or an aria-label for better accessibility.`);
export function a11y_consider_explicit_label(node) {
w(node, "a11y_consider_explicit_label", "Buttons and links should either contain text or have an `aria-label` or `aria-labelledby` attribute");
}
/**

Loading…
Cancel
Save