CSSFontFeatureValuesRule: annotation-Eigenschaft
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 schreibgeschützte annotation-Eigenschaft des CSSFontFeatureValuesRule-Interfaces enthält ein CSSFontFeatureValuesMap-Objekt, das das user-defined-ident und den feature index für eine variable Schriftart darstellt, die annotation() unterstützt.
Wert
Ein CSSFontFeatureValuesMap-Objekt.
Obwohl die annotation-Eigenschaft selbst in dem Sinne schreibgeschützt ist, dass Sie das CSSFontFeatureValuesMap-Objekt nicht ersetzen können, können Sie der annotation-Eigenschaft direkt Werte zuweisen. Außerdem können Sie die Werte der annotation mithilfe der CSSFontFeatureValuesMap-Instanzmethoden ändern.
Beispiele
>Grundlegende Verwendung
CSS
@font-feature-values "MonteCarlo" {
@annotation {
my-annotations: 1;
}
}
JavaScript
// look for the first stylesheet and the first cssRule in that sheet
const myRule = document.styleSheets[0].cssRules[0];
// check
if (myRule instanceof CSSFontFeatureValuesRule && myRule.annotation.size) {
// do something with the annotation
}
Spezifikationen
| Specification |
|---|
| CSS Fonts Module Level 4> # dom-cssfontfeaturevaluesrule-annotation> |
Browser-Kompatibilität
Siehe auch
@annotationannotation()FunktionsnotationCSSFontFeatureValuesMap