bigskysoftware / bigskysoftware/_hyperscript
[Feature Request] Extend `*computed-` and `measure` syntax to ALL CSS properties
- Langage dominant
- JavaScript
- Étoiles
- 3.8k
- Forks
- 172
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
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
```
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Commencez par localiser les implémentations de *computed- property syntax et de la commande measure, puis comparez leur comportement actuel avec l’exemple getComputedStyle de l’issue. Le travail est terminé lorsque les deux formes peuvent récupérer les valeurs calculées de propriétés CSS arbitraires, notamment les exemples présentés pour color et font-size.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- css, javascript
- Domaine
- frontend
- Type d'issue
- Fonctionnalité
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 42/100