Skip to content

Rule for dark:via-<color> incorrectly overrides base --tw-gradient-to value #10816

@lachieh

Description

@lachieh

What version of Tailwind CSS are you using?

For example: v3.2.7

Reproduction URL
https://play.tailwindcss.com/HkVZEWjuc1?layout=horizontal

Describe your issue
Referring to the reproduction, when a base color is set for the from, via and to gradient stops and then changing only the via value in dark mode, the to property gets reset back to the transparent version of the via color.

This is the current output CSS:

.dark .dark\:via-red-500 {
  --tw-gradient-to: rgb(239 68 68 / 0);
  --tw-gradient-stops: var(--tw-gradient-from), #ef4444, var(--tw-gradient-to);
}

However, I would expect the following output:

.dark .dark\:via-red-500 {
  --tw-gradient-stops: var(--tw-gradient-from), #ef4444, var(--tw-gradient-to);
}

Happy to contribute if I could get some guidance on where to look.

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