Font Loaded in <body> Not Applied to <input> Elements #76039
Labels
Font (next/font)
Related to Next.js Font Optimization.
please simplify reproduction
Please simplify the reproduction.
stale
The issue has not seen recent activity.
Link to the code that reproduces this issue
https://github.com/githaka2025/volty/blob/main/src/components/shared/Input.tsx
To Reproduce
Current vs. Expected behavior
Current Behavior
When setting a custom font in Next.js by applying it to the
<body>
element, the font works as expected on most elements (e.g.,<p>
,<h1>
,<div>
, etc.), but it does not apply to<input>
elements. Instead,<input>
elements default to the system font unless explicitly styled.Expected Behavior
The font defined on the
<body>
should cascade to all elements, including<input>
fields, unless overridden by another CSS rule.Actual Behavior
The font is correctly applied to text elements but not to fields, which continue to use the system default font. Manually setting the font on input elements via CSS (input { font-family: inherit; }) or via applying a class name as in the body fixes the issue.
Provide environment information
Which area(s) are affected? (Select all that apply)
Font (next/font)
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
This might be caused by browsers setting font-family explicitly for form elements.
It would be helpful if next/font could automatically apply the font to form elements when assigned to the body.
The text was updated successfully, but these errors were encountered: