CSS Custom variables --font-[variant] isn't computed for CSS "font" property when using NextJs Font Optimisation #45537
Labels
customization: css
Design CSS customizability
package: system
Specific to @mui/system
status: waiting for author
Issue with insufficient information
Steps to reproduce
sx={ { font: "var(--font-body2)" } }
to a Typography component.font
property computed value isempty
.--font-body2
directlysx={ { font: "400 0.875rem/1.43 var(--font-roboto)" } }
font
property value is computed correctly.Current behavior
font
property value is not being computed when the font family is also a variable if css variables--font-[variant]
is usedExpected behavior
The --font-[variant] css variables should have the computed value of the font-family instead of variable, so that font property can be computed.
Context
In the sample project i tried using both single and multiple font-family variables, but it doesnt compute unless the font-family variable is explicitly mentioned.
This doesnt work

This works

Your environment
npx @mui/envinfo
Search keywords: font css variables custom properties --font-[]
The text was updated successfully, but these errors were encountered: