Skip to content

Undocumented breaking change in 1.0.0 - "outline" style is filtered out by the tv() function #248

@enix79

Description

@enix79

Describe the bug

We updated the version of tailwind-variants to 1.0.0 and our regression tests catched a lot of changes, but all regarding the same thing - focus ring.

We implement the focus ring with help of "outline". Usually it looks something like this:

"focus-visible:outline focus-visible:outline-clr-primary focus-visible:outline-1 focus-visible:outline-offset-2"

Color, thickness and offset are preserved and we can see them in the browser, but the style of the outline is not set correctly, because the "outline" tw-class is not there:

Image

Compare here with the old, pre v1.0.0 version: (all 4 styles are there)

Image

We also added a console.log and compared what we put inside the tv() function and what comes out.

Input:

Image

Output:

Image

tv() function clearly filters out the "outline" classes for unknown reason

To Reproduce
Steps to reproduce the behavior:

  1. bump tailwind-variants to v1.0.0
  2. style a div with outline
  3. compare the classes that are returned by the tv() function
  4. check the browser dev tools

Expected behavior
We expect the "outline" to be there, like it was in the previuos versions.

Screenshots
It's an issue for all four major browsers.

Image

Desktop (please complete the following information):

Mac, Sonoma 14.7.4
Chrome Verion 133.0.6943.142

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions