@font-feature-values "MonteCarlo" {
@swash {
swishy: 1;
swashy: 2;
}
}CSSFontFeatureValuesMap: forEach() method / notebook
CSSFontFeatureValuesMap: forEach() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
// function to be used as callback
function logSwashes(value, key, map) {
console.log(`('${key}') = ${value}`);
}
// get the rules
const myRule = document.styleSheets[0].cssRules[0];
myRule.swash.forEach(logSwashes);
// logs:
// "('swishy') = 1"
// "('swashy') = 2"