如何从文本和占位符继承字体body
样式input
?
body {
font-family: "Circular", -apple-system, BlinkMacSystemFont, "Segoe UI",
"Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans",
"Helvetica Neue", sans-serif;
}
input
正在使用该标签:
<input
type="text"
value={value}
onChange={onChange}
placeholder={placeholder}
className={styles.input}
/>
目前,全局body
font-family
样式不适用于input
文本和占位符。只有当我像这样明确添加字体样式时它才有效:
.input {
font-family: "Circular", -apple-system, BlinkMacSystemFont, "Segoe UI",
"Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans",
"Helvetica Neue", sans-serif;
&::placeholder {
font-family: "Circular", -apple-system, BlinkMacSystemFont, "Segoe UI",
"Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans",
"Helvetica Neue", sans-serif;
}
}