CSSFontFeatureValuesRule: thuộc tính annotation
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
Thuộc tính chỉ đọc annotation của giao diện CSSFontFeatureValuesRule chứa một đối tượng CSSFontFeatureValuesMap đại diện cho định danh do người dùng xác định và chỉ mục tính năng cho một font biến đổi hỗ trợ annotation().
Giá trị
Một đối tượng CSSFontFeatureValuesMap.
Mặc dù bản thân thuộc tính annotation là chỉ đọc theo nghĩa bạn không thể thay thế đối tượng CSSFontFeatureValuesMap, bạn vẫn có thể gán trực tiếp cho thuộc tính annotation. Bạn cũng có thể sửa đổi các giá trị của annotation bằng cách sử dụng các phương thức phiên bản của CSSFontFeatureValuesMap.
Ví dụ
>Sử dụng cơ bản
CSS
@font-feature-values "MonteCarlo" {
@annotation {
my-annotations: 1;
}
}
JavaScript
// look for the first stylesheet and the first cssRule in that sheet
const myRule = document.styleSheets[0].cssRules[0];
// check
if (myRule instanceof CSSFontFeatureValuesRule && myRule.annotation.size) {
// do something with the annotation
}
Thông số kỹ thuật
| Specification |
|---|
| CSS Fonts Module Level 4> # dom-cssfontfeaturevaluesrule-annotation> |
Tương thích trình duyệt
Xem thêm
@annotation- Ký pháp hàm
annotation() CSSFontFeatureValuesMap