Skip to content

Tailwind 4 doesn't detect classes from live_select #118

@Munksgaard

Description

@Munksgaard

LiveSelect and LiveView versions

LiveSelect 1.6.0, LiveView 1.0.12

Describe the bug

The classes in e.g. lib/live_select/component.ex are not being detected by Tailwind.

Expected behavior

Running tailwindcss -i assets/css/app.css | grep bg-gray-600 should return the bg-gray-600 class, since it is used in component.ex.

Actual behavior

bg-gray-600 is not detected.

If I change the component.ex file from

      active_option: ~W(text-white bg-gray-600),

to

      active_option: ["text-white", "bg-gray-600"],

the class is picked up as expected. I suspect something changed with tailwind 4 such that it only looks inside strings (double-quotes) and it doesn't know that ~W signifies a string.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions