bigskysoftware / bigskysoftware/_hyperscript
[Feature Request] Extend `*computed-` and `measure` syntax to ALL CSS properties
- Lingua principale
- JavaScript
- Stelle
- 3.8k
- Fork
- 172
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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
```
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Inizia individuando le implementazioni di *computed- property syntax e del comando measure, quindi confronta il loro comportamento attuale con l’esempio getComputedStyle dell’issue. Il lavoro è completato quando entrambe le forme possono recuperare valori calcolati per proprietà CSS arbitrarie, inclusi gli esempi mostrati di color e font-size.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- css, javascript
- Ambito
- frontend
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 42/100