demo · v134 · css
Font Glyph Lab
Authors a live @font-feature-values rule, applies it to a sample, and reads the rule back out of the stylesheet using the newly-exposed CSSFontFeaturesValueRule interface — proof you can now programmatically introspect what you just wrote.
Toggle feature aliases and apply them to the sample below. The generated @font-feature-values block is what we round-trip through CSSOM.
read back via CSSOM
| feature alias | type | name | resolved value(s) |
|---|---|---|---|
| — not read yet — | |||
before vs after
Before v134: window.CSSFontFeaturesValueRule was undefined. To find a font-feature-values rule, tooling had to walk document.styleSheets, fish out rules whose cssText started with @font-feature-values, then regex-parse the body. Brittle.
After v134: the IDL is exposed. rule instanceof CSSFontFeaturesValueRule works, you can read rule.fontFamily and the alias maps directly.