The tailwind.config.js file somehow has no access to fonts specified in the tailwind.css file. I am using nuxt.js 3 and tailwindcss, any help is greatly appreciated
tailwind.css
/* /assets/css/tailwind.css */
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer base {
body {
background-color: #16181c;
color: #ecf9fb;
font-family: "Inter", Arial, sans-serif;
margin: 1rem 5%;
}
}
/* Inter Regular 400 */
@font-face {
font-family: "Inter";
src: url("../fonts/inter-regular-400.woff2");
}
/* Solway Bold 700 */
@font-face {
font-family: "Solway";
font-weight: 700;
src: url("../fonts/solway-bold-700.woff2");
}
The Solway Font gets applied correctly, so no Problems with importing it; Putting the @font-face inside @layer base doesn't do anything
tailwind.config.js
/* tailwind.config.js */
module.exports = {
content: [
"components/**/*.vue",
"layouts/**/*.vue",
"pages/**/*.vue",
"composables/**/*.{js,ts}",
"plugins/**/*.{js,ts}",
],
theme: {
extend: {
fontFamily: {
solway: ['"Solway" "Inter" Arial sans-serif'],
},
backgroundColor: {
card: ["#26292f"],
},
},
},
plugins: [],
};
How I tried to use the new font family
// /layouts/default.vue
<template>
<header class="bg-card-0 rounded-2xl p-4 text-2xl">
<NuxtLink to="/" class="font-solway font-bold">Second Hand</NuxtLink>
</header>
<slot />
</template>
