bigskysoftware / bigskysoftware/_hyperscript

[Feature Request] Extend `*computed-` and `measure` syntax to ALL CSS properties

オープン
#620 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
3.8k
フォーク
172
PR マージ指標
30日以内にマージされた PR はありません

説明

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
```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

まず、*computed- property syntax と measure コマンドの実装を見つけ、現在の動作を issue の getComputedStyle の例と比較します。両方の形式で任意の CSS プロパティの計算値を取得でき、示されている color と font-size の例も取得できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
css, javascript
領域
frontend
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。