Skip to content

fix(sr-only): replace deprecated clip with clip-path inset(50%) (#18768) #18769

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bronisMateusz
Copy link

Summary

This PR replaces the deprecated clip property used in the sr-only utility with clip-path, and updates the corresponding reset in not-sr-only.

  • Closes tailwindlabs/tailwindcss#18768
  • Replaces clip: rect(0, 0, 0, 0); with clip-path: inset(50%); in sr-only
  • Replaces clip: auto; with clip-path: none; in not-sr-only
  • Updates unit test snapshots to reflect the new CSS output

Rationale:

  • clip is deprecated and flagged by modern linters; clip-path is the recommended modern alternative while preserving the intended visually-hidden behavior.

Before:

.sr-only {
  clip: rect(0, 0, 0, 0);
}

.not-sr-only {
  clip: auto;
}

After:

.sr-only {
  clip-path: inset(50%);
}

.not-sr-only {
  clip-path: none;
}

@bronisMateusz bronisMateusz requested a review from a team as a code owner August 20, 2025 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suggestion: Replace deprecated clip in sr-only with clip-path
1 participant