CSSFontFeatureValuesRule: styleset-Eigenschaft
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Die schreibgeschützte styleset-Eigenschaft der CSSFontFeatureValuesRule-Schnittstelle enthält ein CSSFontFeatureValuesMap-Objekt, das die user-defined-ident und den feature index für eine variable Schriftart darstellt, die styleset() unterstützt.
Wert
Ein CSSFontFeatureValuesMap Objekt.
Obwohl die styleset-Eigenschaft selbst in dem Sinne schreibgeschützt ist, dass Sie das CSSFontFeatureValuesMap-Objekt nicht ersetzen können, können Sie der styleset-Eigenschaft direkt Werte zuweisen. Sie können auch die Werte des styleset mit den Instanzmethoden des CSSFontFeatureValuesMap-Objekts ändern.
Beispiel
>Grundlegende Verwendung
CSS
css
@font-feature-values "MonteCarlo" {
@styleset {
my-styleset: 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.styleset.size) {
// do something with the styleset
}
Spezifikationen
| Specification |
|---|
| CSS Fonts Module Level 4> # dom-cssfontfeaturevaluesrule-styleset> |
Browser-Kompatibilität
Siehe auch
@stylesetstyleset()funktionale NotationCSSFontFeatureValuesMap