I’m working on a custom theme and I have embedded multiple fonts in my CSS file. I’d like to apply an OpenType feature to only one of the fonts, so I’m trying to set font-feature-settings in @font-face but it gets ignored when I do so.
This is what I have in my theme.css file as a reduced reproduction case:
@font-face {
font-family: "sourcesans3vf-upright";
font-feature-settings: "ss01" on;
src: url(data:font/woff2;base64,<long base64 string here>);
}
body {
--font-text-theme: "sourcesans3vf-upright";
/* font-feature-settings: "ss01" on; */
}
If I uncomment the font-feature-settings line in the body, I get the expected results (a serif-ied upper-case I). If I use the code as above (attempting to set the font-feature-settings from within the @font-face), I get the normal sans serif upper case I.
The font in question is Source Sans 3 if it matters, and I’ve encoded the variable font to base64 for use in my CSS file with “Font to Base64 CSS Converter - Obsidian Custom Font Tool.“
Is there a better way to achieve what I’m trying to accomplish?