Skip to content

Screen reader support for header week numbers breaks tailwind class #5794

@eduardo-otte

Description

@eduardo-otte

Describe the bug
The accessibility improvements added in #5731 introduce a new CSS class (sr-only) that clash with Tailwind's own sr-only class, causing the class to ignore Tailwind's breakpoints.

To Reproduce
In a project that uses both react-datepicker and Tailwind, create a new component that uses the sr-only with a breakpoint. The sr-only class will always be applied, even when not expected to.

<button className="sr-only sm:not-sr-only">
    Click here
</button>

Expected behavior
The classes in react-datepicker should be scoped to the component's tree and avoid using universal names that might conflict with other tools.

Screenshots

Image

Desktop (please complete the following information):

  • OS: Ubuntu
  • Browser: Vivaldi (chromium)
  • Version: 7.5.3735.62

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions