Dieser Inhalt wurde automatisch aus dem Englischen übersetzt, und kann Fehler enthalten. Erfahre mehr über dieses Experiment.

View in English Always switch to English

CSSFontFeatureValuesMap: clear() Methode

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Die clear()-Methode der Schnittstelle CSSFontFeatureValuesMap entfernt alle Deklarationen in der CSSFontFeatureValuesMap.

Syntax

js
clear()

Parameter

Keine.

Rückgabewert

Keine (undefined).

Beispiele

Grundlegende Verwendung

Das folgende Beispiel entfernt alle Deklarationen innerhalb des @swash-Funktionsblocks. Dieses Beispiel verwendet @swash, funktioniert aber auch mit anderen Funktionswertblöcken.

CSS

css
@font-feature-values "MonteCarlo" {
  @swash {
    swishy: 1;
    swashy: 2;
  }
}

JavaScript

js
// get the rules
const myRule = document.styleSheets[0].cssRules[0];
console.log(myRule.swash.size); // logs 2
myRule.swash.clear();
console.log(myRule.swash.size); // logs 0

Spezifikationen

Specification
CSS Fonts Module Level 4
# cssfontfeaturevaluesmap

Browser-Kompatibilität

Siehe auch