bigskysoftware / bigskysoftware/_hyperscript

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

Đang mở
#620 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
3.8k
Fork
171
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Bắt đầu bằng cách xác định các phần triển khai của *computed- property syntax và lệnh measure, sau đó so sánh hành vi hiện tại của chúng với ví dụ getComputedStyle trong issue. Công việc được xem là hoàn tất khi cả hai dạng đều có thể lấy các giá trị được tính toán cho mọi thuộc tính CSS, bao gồm các ví dụ color và font-size được nêu.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
css, javascript
Lĩnh vực
frontend
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
42/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.