Skip to content

Tailwind v4: Applied styles on a base element are overtaking classes defined in an HTML file #15850

@nickjj

Description

@nickjj

What version of Tailwind CSS are you using?

v4.0.0

What version of Node.js are you using?

v22.13.0

What browser are you using?

Chrome

What operating system are you using?

Windows

Reproduction URL

Here's the bug with v4: https://play.tailwindcss.com/j4OJXVvyUb

Notice how the link color is sky instead of gray.

Now change the version to v3.4 and the link will become gray.

Describe your issue

With v3 you could apply a color to a specific element and then choose to override that color as needed.

This is a really useful pattern where you can set a default color or style for something (such as links) and 80% of the time you can use that and then when you want a different style you can go into your HTML template and add the Tailwind classes to adjust it.

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