使用導(dǎo)入的本地字體但字體不起作用,并且在瀏覽器控制臺中有一個警告說:
postcss-import-parser:在& quot@從& quot。/sakal . TTF & quot;"
當(dāng)main.css為:
@tailwind base;
@tailwind components;
@tailwind utilities;
@import sakal from "./sakal.ttf";
* {
@apply font-sakal !important;
font-family: 'Amiri', serif;
}
而tailwind.config.js是:
module.exports = {
mode: 'jit',
purge: ['./src/**/*.{js,ts,jsx,tsx}'],
darkMode: false,
theme: {
fontSize: {
xs: '0.75rem',
sm: '0.875rem',
base: '1rem',
lg: '1.125rem',
xl: '1.25rem',
'2xl': '1.5rem',
'3xl': '1.875rem',
'4xl': '2.25rem',
'5xl': '3rem',
'6xl': '4rem',
},
extend: {
fontFamily: {
sakal: ['sakal']
},
...
i
試圖安裝下一個/字體和導(dǎo)入谷歌字體不工作
main.css:
@tailwind base;
@tailwind components;
@tailwind utilities;
@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400;1,700&display=swap');
* {
@apply font-amiri !important;
}