Skip to content

Dark mode background overrides text colors on checkboxes when using class dark mode variant #74

Open
@johnathanludwig

Description

@johnathanludwig

What version of @tailwindcss/forms are you using?

0.3.3

What version of Node.js are you using?

14.15.4

What browser are you using?

Chrome

What operating system are you using?

macOS

Reproduction repository

https://github.com/johnathanludwig/tailwind-forms-dark-mode

Describe your issue

In light mode you can style a checkbox by setting a background color for the base checkbox, and a text color for the checked version of the checkbox.

With dark mode via the class method, the background classes sets both the unchecked and checked color removing the ability to customize.

The styling works properly when using media for dark mode.

Reproduction Steps:

  1. Build tailwind using @tailwindcss/forms and enable dark mode using the class method.
  2. Add checkbox with a dark background color class and dark text color class.
  3. Enable wrap the checkbox in a dark class.
  4. Check the checkbox

Expected Results

The text color should be displayed when the checkbox is checked.

Actual Results

The background color is used for both checked and unchecked checkboxes.

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