bigskysoftware / bigskysoftware/_hyperscript
[Feature Request] Extend `*computed-` and `measure` syntax to ALL CSS properties
- Lenguaje dominante
- JavaScript
- Estrellas
- 3.8k
- Forks
- 172
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
Right now, the `*computed-` style property syntax, as well as the `measure` command seem to assume we’re only interested in knowing the current position and size of an element. In fact, there are many times when we need to know the current, computed value of other properties, too — eg. colours that may be overriden by locally-scoped custom CSS properties, or by specific user interactions, such as using ‘light’ or ‘dark’ mode toggle.
In essence, it would be wonderful if `*computed-` and `measure` worked as syntactic sugar for:
``` javascript
function getCurrentPropertyValue(element, property) {
const styles = window.getComputedStyle(element);
const property = styles.getPropertyValue(property);
return property;
}
```
That way, we’d be able to do things like:
```
set my *color to contrastColor( my *computed-background-color)
measure my font-size then put it into the next .size-display
```
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Comienza localizando las implementaciones de *computed- property syntax y del comando measure; después, compara su comportamiento actual con el ejemplo de getComputedStyle del issue. Se considera terminado cuando ambas formas pueden obtener valores calculados para cualquier propiedad CSS, incluidos los ejemplos mostrados de color y font-size.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- css, javascript
- Área
- frontend
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 42/100