CSSFontFeatureValuesMap: delete() method

Khả dụng hạn chế

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.

Phương thức delete() của giao diện CSSFontFeatureValuesMap xóa khai báo CSS có thuộc tính được chỉ định trong CSSFontFeatureValuesMap.

Cú pháp

js
delete(property)

Tham số

property

Một định danh chỉ ra khai báo cần xóa.

Giá trị trả về

Không có (undefined).

Ví dụ

Sử dụng cơ bản

Ví dụ sau xóa khai báo đầu tiên 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.has("swishy")); // ghi ra true
myRule.swash.delete("swishy");
console.log(myRule.swash.has("swishy")); // ghi ra false

Thông số kỹ thuật

Thông số kỹ thuật
CSS Fonts Module Level 4
# cssfontfeaturevaluesmap

Tương thích trình duyệt

Xem thêm