Skip to content

Instantly share code, notes, and snippets.

@joelhsmith
Last active July 13, 2018 19:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joelhsmith/0ceeff9393c1bfde6af2f00ebfb89b7d to your computer and use it in GitHub Desktop.
Save joelhsmith/0ceeff9393c1bfde6af2f00ebfb89b7d to your computer and use it in GitHub Desktop.
Interactive element manual audit for Lighthouse
/**
* Interactive Element Affordance
*/
'use strict';
import ManualAudit from 'lighthouse-core'
const ManualAudit = require('../node_modules/lighthouse/lighthouse-core/audits/manual/manual-audit');
/**
* @fileoverview Manual A11y audit for interactive link states.
*/
class LinkStates extends ManualAudit {
/**
* @return {LH.Audit.Meta}
*/
static get meta() {
return Object.assign({
name: 'interactive-element-affordance',
helpText: 'Interactive elements like links and buttons should indicate their state and be distinguishable from non-interactive elements. It is difficult for users to navigate a website when they cannot tell if an element is clickable or when they are hovering over an interactive element. [Learn more](https://webaim.org/blog/wcag-2-0-and-link-colors/).',
description: 'Interactive elements are distinguishable from non-interactive elements',
}, super.partialMeta);
}
}
module.exports = interactiveElementAffordance;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment