tailwindcss
tailwindcss copied to clipboard
Add support for configuring default `font-variation-settings` for a `font-family`
I wanted to add default font-variation-settings for the beta version of the font, where Inter Display was merged into Inter as an optical-size axis. However, I discovered that there is no support for this option in the current codebase.
This pull request adds support for configuring default font-variation-settings for a font-family, which will allow users to change the way it is rendered in their projects. This will give users more flexibility when it comes to font customization.
module.exports = {
theme: {
fontFamily: {
sans: [
'Inter var, sans-serif',
{
fontFeatureSettings: '"cv11", "ss01"',
fontVariationSettings: '"opsz" 32',
},
],
},
},
}
I decided not to open a feature request for this change as it may not be significant enough, and I hope that's okay. Thank you for considering this change, and for all the work you've done on this amazing framework! ❤
Thanks I think this makes perfect sense to support! Need to prepare a documentation update before merging so will leave this open for now, but plan to merge once I have a chance to update the documentation. Trying to be better about not leaving myself a shit ton of documentation work to do right before a release comes out 😄
@RobinMalfait do you mind rebasing and resolving the conflicts here and merging when you get a chance tomorrow? Will just do the documentation sometime before the v3.3 release — just need to make sure this is in the changelog so we don't forget 👍