Skip to content

Commit

Permalink
Add documentation for accessibility linting rules
Browse files Browse the repository at this point in the history
  • Loading branch information
khiga8 committed Jun 23, 2023
1 parent b79fec8 commit 8535bac
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
15 changes: 15 additions & 0 deletions docs/content/guides/accessibility/tooltipped_migration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: Tooltipped migration
---

## Rule Details

The Primer CSS tooltip set via `.tooltipped` has been deprecated. There are major accessibility concerns with using this deprecated tooltip, including the inability to

There are two migrations paths:

1. Don't use a tooltip.
2. Migrate to the newer tooltip.

## Examples

4 changes: 1 addition & 3 deletions lib/primer/view_components/linters/tooltipped_migration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ class TooltippedMigration < Linter
include LinterRegistry
include Helpers::RuleHelpers

MIGRATE_TO_NEWER_TOOLTIP = ".tooltipped has been deprecated. Tooltip should never be set on a non-interactive element (e.g. <span>, <div>, <li>). " \
"Find alternatives in https://primer.style/design/guides/accessibility/tooltip-alternatives/. " \
"If you're setting a tooltip on an interactive element, use the latest tooltip in https://primer.style/view-components."
MIGRATE_TO_NEWER_TOOLTIP = ".tooltipped has been deprecated. See https://github.com/primer/view_components/blob/main/docs/content/guides/accessibility/tooltipped_migration.md"
TOOLTIPPED_RUBY_PATTERN = /classes:.*tooltipped|class:.*tooltipped/.freeze

def run(processed_source)
Expand Down

0 comments on commit 8535bac

Please sign in to comment.