css - 无法将字体粗细与谷歌字体匹配并对样式组件做出反应
问题描述
我正在尝试以下样式。问题是实际结果字体粗细与模型相差无几。我怎样才能确保我得到正确的风格?
https://fonts.google.com/specimenTab?standard-styles#standard-styles
const LogoH1 = styled.span`
text-transform: uppercase;
font-family: 'Montserrat';
font-size: 50px;
font-weight: 900;
letter-spacing: -5px;
`
设计工具 (Adobe XD)
结果
我正在使用 Gatsby 连接字体:
plugins: [
{
resolve: `gatsby-plugin-google-fonts`,
options: {
fonts: [
`Montserrat`,
],
}
}
],
解决方案
plugins: [
{
resolve: `gatsby-plugin-google-fonts`,
options: {
fonts: [
`Montserrat\:400,500,600,700,800,900`,
],
}
}],
推荐阅读
- c# - 使用 Entity Framework Core 共享表
- ajax - Laravel检查ajax请求是否不起作用
- c++ - 如何在不重载运算符==的情况下编写“hello”== obj?
- laravel - Convert query a query builder
- javascript - Cheerio 属性StartsWith 选择器
- swift - 如何解决图像处理的内存问题?
- c - 尝试读取文本文件并对其进行排序时出现分段错误 11
- django - 如何从 django 变量中的非常大的文本中换行?
- c# - 即使启用了“记住我”,WebClient.DownloadString 也无法访问站点
- bash - Linux:Curl 已安装但 -bash: :curl: 命令未找到