Making the CSS property `appliesto` values more specific
Los mantenedores suelen responder en 1 día
@teoli2003 ya está trabajando en esto.
Desde el 8/6/2022.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Stack tecnológico
- css
- Área
- web-dev
Línea de trabajo
Comienza revisando el enum appliesto en css/properties.schema.json y las entradas relacionadas en css/properties.json, usando align-items, grid-auto-columns y align-content como casos de comparación. Revisa los datos de inactive-css enlazados y determina si el enum existente puede expresar la especificidad solicitada. Se considera terminado cuando se haya llegado a un acuerdo sobre el alcance y la representación antes de actualizar los datos.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
It feels to me like the appliesto property of the CSS properties data isn't defined very specifically at the moment.
For context, here is a concrete example:
https://developer.mozilla.org/en-US/docs/Web/CSS/align-items#formal_definition
MDN says that align-items applies to all elements (data is here). While true in the sense that it won't break if you apply it to any element, it actually won't do anything unless the element is not a grid container or a flex container.
Contrast this with this other example:
https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-columns#formal_definition
MDN says that grid-auto-columns only applies to grid containers, which is true. But also, it won't cause any problem if you apply it to any other type of containers.
I would love if appliesto was more specific. There seems to be a lot of different values that the appliesto enum can take: https://github.com/mdn/data/blob/main/css/properties.schema.json#L162
and using the most specific one has advantages: it makes it easier for web authors to know why a property they're using isn't doing anything.
As an example, if you're confused about flexbox and you're trying to align items using align-content but you did not specify flex-wrap:wrap, then the property won't have any effects.
In this specific case, the data is actually very helpful. MDN says that align-content only applies to multi-line flex containers: https://developer.mozilla.org/en-US/docs/Web/CSS/align-content#formal_definition
Although it's not entirely correct because it also applies to grid containers.
So I have two questions in this issue:
- Does everyone agree that the
appliestoproperty should be as specific as possible for all properties? - Is there interest in expanding the
appliestoenum to make it able to cover more cases? For example, there is nogridAndFlexContainervalue now, but it would be useful in thealign-contentcase. In fact, it might become useful, at some point, to allow more complex values than just strings. For instance:gridContainer AND flexContainerseems like it would help.
As background to this, in the past I worked on this inactive-css repo with the hope to create a reusable dataset for exactly this case: https://github.com/captainbrosset/inactive-css
I'd be willing to transfer this data over to mdn/data (by mapping it to the appliesto field) if there is interest.
- Lenguaje dominante
- JavaScript
- Estrellas
- 786
- Forks
- 216
- Merge medio
- 22 h 24 min
- PR fusionados (30 d)
- 4
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una 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 mdn/data
-
Computed value for CSS animation's animation-timeline componentQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
mdn/data#1096 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Missing CSS gaps dataAbiertoneeds triage
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
Los mantenedores suelen responder en 1 día
-
accepting PR
Dificultad 1/5 Menos de una hora Aptitud para principiantes 55/100
Los mantenedores suelen responder en 1 día
-
idle needs triage
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
Proposal: Remove IE-only featuresQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abiertoidle
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
mdn/data#837 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 80/100
kentcdodds/kcd-skills#32 ·
-
good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
tech-debt
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
enhancement frontend good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 2 días
-
[推荐] SubtitleMedicAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 65/100