CSSFontFeatureValuesMap: values() Methode
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Die values() Methode von CSSFontFeatureValuesMap-Instanzen gibt ein neues Map-Iterator-Objekt zurück, das die [key, value]-Paare für jede Deklaration in dieser CSSFontFeatureValuesMap in der Eingabereihenfolge enthält.
Syntax
js
values()
Parameter
Keine.
Rückgabewert
Ein neues iterierbares Iterator-Objekt.
Beispiele
>Grundlegende Verwendung
Im folgenden Beispiel werden die Werte der Variablen swashValues zugewiesen und anschließend die ersten beiden Werte protokolliert. Dieses Beispiel verwendet @swash, funktioniert jedoch auch mit anderen Feature-Wertblöcken.
CSS
css
@font-feature-values "MonteCarlo" {
@swash {
swishy: 1;
swashy: 2;
}
}
JavaScript
js
// get the rules
const myRule = document.styleSheets[0].cssRules[0];
// get the values of swash
const swashValues = myRule.swash.values();
console.log(swashValues.next().value); // logs [1]
console.log(swashValues.next().value); // logs [2]
Spezifikationen
| Specification |
|---|
| CSS Fonts Module Level 4> # cssfontfeaturevaluesmap> |