angular / angular/components

bug(stepper): bad contrast of step icon in untouched state for M2

Abierto
#29,518 5 comentarios 2 reacciones 0 asignados Ver en GitHub
Accessibility area: material/stepper P4
Lenguaje dominante
TypeScript
Estrellas
25k
Forks
6.8k
Merge medio
1 d 8 h
PR fusionados (30 d)
91

Descripción

### Is this a regression?

- [ ] Yes, this behavior used to work in the previous version

### The previous version in which this bug was not present was

_No response_

### Description

When using a custom theme, in the stepper it can happen that the step icon (step number or state icon) has a bad contrast:

![image](https://github.com/user-attachments/assets/2d4678c7-7ff1-49c0-a4e3-b972cddf6e0c)

It depends on the contrast color of the primary color. If it's white, everything works correctly, but if it's black, this issue occurs. However for the untouched state, it should always be white, regardless of the contrast color.

Dark mode has the same issue. Here it can even be reproduced in the v16 docs app after selecting the "Purple & Green" theme:

![image](https://github.com/user-attachments/assets/54afc55c-fdf8-423c-a7ce-c17c1f543f56)

I was not able to reproduce this with M3, the predefined themes work fine. I didn't try custom M3 themes though.

### Reproduction

StackBlitz link: https://stackblitz.com/edit/61i1fz?file=src%2Fstyles.scss
Steps to reproduce:
1. Configure a primary color with black as a contrast color in light theme, or white as a contrast color in dark theme
2. Use the stepper

### Expected Behavior

The step icon has sufficient contrast in untouched state

### Actual Behavior

The step icon has insufficient contrast in untouched state

### Environment

Angular CLI: 18.0.2
Node: 18.20.3
Package Manager: yarn 1.22.19
OS: linux x64

Angular: 18.0.1
... animations, common, compiler, compiler-cli, core, forms
... localize, platform-browser, platform-browser-dynamic, router

Package Version
------------------------------------------------------------
@angular-devkit/architect 0.1800.2
@angular-devkit/build-angular 18.0.2
@angular-devkit/core 18.0.2
@angular-devkit/schematics 18.0.2
@angular/cdk 18.1.2
@angular/cli 18.0.2
@angular/material 18.1.2
@angular/material-experimental 18.1.2
@angular/material-moment-adapter 18.1.2
@schematics/angular 18.0.2
rxjs 7.4.0
typescript 5.4.5
zone.js 0.14.6

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza con la reproducción vinculada de StackBlitz y su src/styles.scss, usando el stepper con los temas personalizados claro y oscuro descritos. Compara el contraste del icono del M2 untouched-state entre los colores de contraste primarios; la tarea está terminada cuando el icono del paso tiene suficiente contraste en ambas configuraciones.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
angular, typescript
Área
accessibility, frontend
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Tranquilo
Claridad
Bastante claro
Aptitud para principiantes
52/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.