Default daisyUI theme colors in phx.new fail WCAG AA contrast in generated components
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 56/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- css, elixir
- Área
- accessibility, frontend
Línea de trabajo
Start with installer/templates/phx_assets/app.css.eex and inspect the light and dark daisyUI theme color values used by generated CoreComponents. Compare the text and background pairs named in the issue against WCAG AA’s 4.5:1 threshold; the issue leaves the replacement color direction open. Done when the primary button and info and error flashes meet that threshold in both themes.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Environment
- phx_new 1.8.16 (theme values unchanged on
mainininstaller/templates/phx_assets/app.css.eex)
Actual behavior
Several color pairs in the default light daisyUI theme fall below WCAG 2.x AA contrast (4.5:1 for normal text). They are used by the generated CoreComponents, so a fresh app ships them:
Where (generated core_components.ex) |
Text / background | Ratio |
|---|---|---|
<.button variant="primary"> (btn-primary) |
--color-primary-content on --color-primary |
2.75:1 |
<.button> default (btn-primary btn-soft) |
--color-primary on soft tint (computed oklab(0.9576 0.0115 0.0126)) |
2.57:1 |
<.flash kind={:info}> (alert-info, 14px) |
--color-info-content on --color-info |
3.49:1 |
<.flash kind={:error}> (alert-error, 14px) |
--color-error-content on --color-error |
4.06:1 |
Buttons fail even the 3:1 large-text threshold. Colors confirmed via getComputedStyle in Chromium; ratios computed with the WCAG 2 relative-luminance formula.
I found these with the contrast page in excessibility_storybook (a phoenix_storybook companion to Excessibility). Pointing it at a fresh app's app.css shows every theme pair with its WCAG ratio and APCA level, which may help when choosing replacement values.
Other light-theme pairs are below 4.5:1 too (success 2.33:1, warning 3.09:1) but aren't used by the generated components.
In the dark theme, primary (4.14:1), info (3.81:1) and error (4.06:1) are also under 4.5:1, so the primary button and both flashes fall short there too.
Expected behavior
The generated components meet WCAG 2.x AA (4.5:1) for their text, in both themes. For example, darkening --color-primary in the light theme (or using a dark --color-primary-content) would fix the primary button.
Happy to send a PR with adjusted values if a direction is preferred (keep the orange and darken it, vs. dark text on orange).
- Lenguaje dominante
- Elixir
- Estrellas
- 23.2k
- Forks
- 3.2k
- Merge medio
- 22 h 45 min
- PR fusionados (30 d)
- 21
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de phoenixframework/phoenix
-
~p treats routes as static when they only start with a static directory namePosiblemente ocupada @mandar1045 la tomó hace 6 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 30/100
phoenixframework/phoenix#6895 ·
Los mantenedores suelen responder en 1 día
-
Connection: close header not sent before closing HTTP 1.1 connection when a controller raises an exceptionPosiblemente ocupada @javiergarea la tomó hace 34 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
phoenixframework/phoenix#6859 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
phoenixframework/phoenix#6853 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
LongPoll session tokens are not bound to the mount path or socket handlerPosiblemente ocupada @SteffenDE la tomó hace 79 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
phoenixframework/phoenix#6791 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
phoenixframework/phoenix#6785 · 5 comentarios · 2 reacciones ·
Los mantenedores suelen responder en 1 día
Todos los issues de phoenixframework/phoenix
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
semaphoreio/semaphore#1391 ·
Los mantenedores suelen responder en 1 día
-
agent-ready area:skills
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
jmbarzee/temporal-architect#588 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
intellij-elixir/intellij-elixir#4659 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
getsentry/sentry-elixir#1259 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
[Bug]: PostgreSQL backend: Queue.remove() / Job.remove() never emit the QueueEvents "removed" eventPosiblemente ocupada @1AbdullahButt la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
taskforcesh/bullmq#5085 ·
Los mantenedores suelen responder en 1 día