79487503

Date: 2025-03-05 19:38:09
Score: 2.5
Natty:
Report link

Answer Update

Thanks to the helpful suggestions above, I managed to get the fonts working. However, in my case, I needed to apply the !important directive to the body font style to ensure it overrides any other font-family settings that might be present in my project.

Here’s my full working theme.ts:

import { createSystem, defaultConfig } from "@chakra-ui/react";

export const system = createSystem(defaultConfig, {
theme: {
    tokens: {
    fonts: {
        heading: { value: `'Bebas Neue', sans-serif` },
        body: { value: `'Poppins', sans-serif` },
    },
    shadows: {
        outline: { value: "0 0 0 3px rgba(225, 92, 66, 0.5)" },
    },
    },
    recipes: {
    input: {
        base: {
        _focus: {
            boxShadow: "outline",
        },
        },
    },
    },
},
globalCss: {
    "html, body": {
       fontFamily: "body !important",
    },
    "h1, h2, h3, h4, h5, h6": {
       fontFamily: "heading",
    },
},
});
export default system;

Explanation:

I hope this helps someone else who’s facing similar issues. Thanks again for the guidance!

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Blacklisted phrase (0.5): I need
  • Whitelisted phrase (-1): hope this helps
  • Long answer (-1):
  • Has code block (-0.5):
  • Me too answer (2.5): facing similar issue
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Stefano Fiore