CSSFontFeatureValuesRule: annotation-Eigenschaft
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Die schreibgeschützte annotation-Eigenschaft des CSSFontFeatureValuesRule-Interfaces enthält ein CSSFontFeatureValuesMap-Objekt, das den benutzerdefinierten Bezeichner 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 trotzdem direkt zuweisen. Sie können auch die Werte der annotation mittels der CSSFontFeatureValuesMap-Instanzmethoden ändern.
Beispiele
>Grundlegende Verwendung
CSS
css
@font-feature-values "MonteCarlo" {
@annotation {
my-annotations: 1;
}
}
JavaScript
js
// 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()funktionale NotationCSSFontFeatureValuesMap