Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 2 years ago

News homepage

tailwind-css
Mirror83•200
@Mirror83
A solution to the News homepage challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


I tried to change the font family to Inter by doing this in my tailwind.config.js:

/** @type {import('tailwindcss').Config} */
const defaultTheme = require("tailwindcss/defaultTheme");
module.exports = {
  content: ["./src/**/*.{html,js}"],
  theme: {
    extend: {
      colors: {
        "soft-orange": "hsl(35, 77%, 62%)",
        "soft-red": "hsl(5, 85%, 63%)",
        "dark-blue": "hsl(240, 100%, 5%)",
        "dark-grayish-blue": "hsl(236, 13%, 42%)",
        "very-dark-blue": "hsl(240, 100%, 5%)",
        "grayish-blue": "hsl(233, 8%, 79%)",
        "off-white": "hsl(36, 100%, 99%)"
      },
      fontFamily: {
        "sans": ["Inter", ...defaultTheme.fontFamily.sans],
      }
    },
  },
  plugins: [],
}

However, doing so, for some reason breaks some of the functionality of the site, like disabling grid and flexbox from classes that contain the grid and flex classes respectively . This made me exclude the code for the font from the solution. I would like to know why this is happening and how to fix this.

Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on Mirror83's solution.

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner
  • Use cases

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License