Skip to content

bug(dark theme): dark theme disabled-state styling does not match spec for toggle-button, list-item #22947

@thw0rted

Description

@thw0rted

Reproduction

I'd like to make a StackBlitz to illustrate this but I can't seem to make a dark-theme example. If anybody can give me a sample to fork that uses a dark theme, it'd be dead easy to include some examples of affected components. (Also: should I open a separate ticket to ship at least one dark theme in the prebuilt-themes directory? Seems kind of crazy not to have any.)

Steps to reproduce:

  1. Use any dark theme
  2. Create a mat-list-item or Toggle-type button, at least
  3. Set the disabled attribute on the component
  4. Observe that the background is a pretty jarring 100% black

Expected Behavior

The background of disabled controls should comply with the relevant section of the spec:

All disabled components are displayed using 12% White for container outlines and fills and 38% White for content such as labels or icons

Actual Behavior

The background of disabled components uses "black", per here. Of note, just above there the background color of disabled-button is rgba(white, 0.12) which is correct. It's possible that other backgrounds also fail to match spec -- I only started digging because disabled list items look pretty rough.

Environment

  • Angular: 11.1.2
  • CDK/Material: 1.11.2
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): Win10

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4A relatively minor issue that is not relevant to core functionsarea: themingmaterial specIssue related to the Material Design spec https://material.io/design/needs: clarificationThe issue does not contain enough information for the team to determine if it is a real bug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions