我似乎没有得到的衬线字体‘源serif Pro’在我的应用程序渲染。我还设置了‘Roboto’,这很好。我尝试了几种不同的方法,在顺风config...array...string...font堆栈的双引号上说,在尾风网站。
不知道我在这里错过了什么?
顺风配置
module.exports = {
content: [
'./components/**/*.{js,vue,ts}',
'./layouts/**/*.vue',
'./pages/**/*.vue',
'./plugins/**/*.{js,ts}',
'./nuxt.config.{js,ts}',
],
theme: {
fontFamily: {
roboto: ['Roboto', 'sans'],
source: ['Source Serif Pro', 'serif'],
},
extend: {
colors: {
gray: {
50: '#f4f4f4',
100: '#000029',
200: '#bebebe',
300: '#555555',
400: '#444444',
500: '#3e3e3e',
},
tan: {
400: '#d1b991',
500: '#caae7f',
},
green: {
400: '#008059',
500: '#006846',
},
},
},
},
};在“构建模块”中的nuxt配置
[
'@nuxtjs/google-fonts',
{
families: {
Roboto: {
wght: [400, 700],
},
'Source+Serif+Pro': {
wght: [400, 600],
},
},
subsets: ['latin'],
display: 'swap',
prefetch: false,
preconnect: false,
preload: false,
download: true,
base64: false,
},
],发布于 2022-11-28 16:39:04
你得做:
例如,对于Nunito
@font-face {
font-display: swap;
font-family: 'Nunito';
font-style: normal;
font-weight: 400;
src: local('Nunito Regular'), local('Nunito-Regular'),
url('~assets/fonts/Nunito-400-cyrillic-ext1.woff2') format('woff2');
}https://stackoverflow.com/questions/74603385
复制相似问题