Skip to content

bug: buttons with low contrast, aria-disabled support, buttons in filter #4430

@pdanpdan

Description

@pdanpdan

Reproduction URL (Required)

https://play.tailwindcss.com/xdk5JEP7oO

What version of daisyUI are you using?

latest

Which browsers are you seeing the problem on?

All browsers

Describe your issue

follow up from #4413

I have prepared 3 playgrounds that should cover most of the normal usage:

Problems:

  • if buttons (checkbox) are used in .filter they do not show active status
    addressed in feat(filter): show all options on keyboard navigation #4427

  • aria-disabled="true" is not accounted for
    adressed in proposal by adding it to disabled states

  • on all dark themes .btn-neutral .btn-soft cannot be used
    addressed in proposal by introducing a variable to set the soft bg color for neutral (--btn-soft-bg: var(--color-neutral-content) 80%;)

  • .btn-soft, .btn-outline, .btn-dash, .btn-ghost, .btn-link when there is contrast between fg (--btn-fg) and bg (--btn-color) button color, but there is no contrast in rest state between bg (derivative of --color-base-100 or page bg) and fg (--btn-color)
    addressed in proposal by introducing a user facing variable --btn-rest-fg that sets the fg color for buttons in rest state (only for soft, outline, dash, ghost) - it is ignored for .btn-neutral because that color has its own rules
    .btn-link does not need any mitigation because it uses the same color all the time, so it can already be set by the user
    in the example --btn-rest-fg is set for the whole theme, but it can be used for individual buttons also

  • a checkable button cannot be identified as checked/unchecked when focused
    addressed in full rewrite

  • setting --btn-color and ``--btn-fg` on buttons does not work as expected
    addressed in full rewrite

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