CSSFontFeatureValuesRule: thuộc tính styleset
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 styleset 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ợ styleset().
Giá trị
Một đối tượng CSSFontFeatureValuesMap.
Mặc dù bản thân thuộc tính styleset 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 styleset. Bạn cũng có thể sửa đổi các giá trị của styleset 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" {
@styleset {
my-styleset: 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.styleset.size) {
// do something with the styleset
}
Thông số kỹ thuật
| Specification |
|---|
| CSS Fonts Module Level 4> # dom-cssfontfeaturevaluesrule-styleset> |
Tương thích trình duyệt
Xem thêm
@styleset- Ký pháp hàm
styleset() CSSFontFeatureValuesMap