CSSFontFeatureValuesMap: size property
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 size của giao diện CSSFontFeatureValuesMap trả về một số nguyên dương chứa kích thước của đối tượng CSSFontFeatureValuesMap.
Giá trị
Một số nguyên dương.
Ví dụ
>Sử dụng cơ bản
Ví dụ sau xuất ra một số nguyên biểu thị số lượng khai báo trong khối tính năng @swash. Ví dụ này sử dụng @swash nhưng cũng hoạt động với các khối giá trị tính năng khác.
CSS
css
@font-feature-values "MonteCarlo" {
@swash {
swishy: 1;
swashy: 2;
}
}
JavaScript
js
// lấy các quy tắc
const myRule = document.styleSheets[0].cssRules[0];
console.log(myRule.swash.size); // ghi ra 2
Thông số kỹ thuật
| Specification |
|---|
| CSS Fonts Module Level 4> # cssfontfeaturevaluesmap> |