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: Methode clear()

Limited availability

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

Experimentell: Dies ist eine experimentelle Technologie
Überprüfen Sie die Browser-Kompatibilitätstabelle sorgfältig vor der Verwendung auf produktiven Webseiten.

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

Syntax

js
clear()

Parameter

Keine.

Rückgabewert

Keiner (undefined).

Beispiele

Grundlegende Nutzung

Das folgende Beispiel entfernt alle Deklarationen innerhalb des @swash-Feature-Blocks. Dieses Beispiel verwendet @swash, funktioniert aber auch mit anderen Feature-Wert-Blö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