Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

109
Views
Styled Components Themes and Browser and SSR api and Gatsby-Plugin-Google-Fonts

I am a pretty new developer in training and started building a simple website. I had to restart my project because of some issues I was having and honestly felt better starting new.

My issue is in a few things:

Using styled-components theme provider , then I wrapped a global style sheet and a typography sheet and exported that file so that I can use it on gatsby-broswer and gatsby-ssr. The issue is that it seems like some styles are being added while others aren't and the theme isn't actually working, as well as the colors.

in gatsby-browser.js and gatsby-ssr.js ...

export const wrapRootElement = ({ element }) => {
    return <Theme>{element}</Theme>
}

------------------------------------------
... this is a snippet from the actual theme component

export const theme = {
    colors: {
        lightGreen: '#04BFAD',
        lightGreenTint: `rgba(4,191,173,0.70)`,
        lightGreenShadow: `#038073`,
        black: '#0E0F13',
        blackTint: `rgba(14,15,19,0.55)`,
        darkGreen: `#027373`,
        darkGreenShadow: `rgba(2,115,155,0.45)`,
        white: `#fff`,
        lightGrey: `#C1D4D9`,
        lightGreyTint: `rgba(193,212,217,.65)`,
        darkGrey: `#979DA6`
    },
    breakpoints: {
        mobile: `(min-width: 428px)`,
        tablet: `(min-width: 768px)`,
        laptop: `(min-width: 1024px)`,
        desktop: `(min-width: 1280px)`
    }
};

const Theme = ({ children }) => ( 
    <ThemeProvider theme={theme}>
        <GlobalStyles />
        <Typography />
        {children}
    </ThemeProvider>
)

export default Theme;
  1. It seems like the gatsby-plugin-google-fonts aint actually importing the font. I want to use Monserrat and have it set up in my gatsby config file and gatsby isn't actually using it
in gatsby-config file
{
      resolve: `gatsby-plugin-google-fonts`,
      options: {
        fonts: [
          `Montserrat\:400`,
        ],
        display: 'swap'
      }
    }

and a snippet from the Typography component

  html {
    font-family: Montserrat, sans-serif;
    color: ${({ theme : { colors : { lightGrey }}}) => lightGrey};
  }

Can someone point me to the right direction? In my old project, that I still have, I was importing all the files from above to my layout and using wrapPageElement and it was working fine until it stopped working. I use commonjs in my config file.

As a side note: It seems like Gatsby plugin ecosystem is really out of date. I don't have much experience but going to look for ways to contribute somehow. Am I focusing on the wrong tool and should I switch over to nextjs? My goal is to build websites for me and my immediate family and build websites for the businesses in my area and get a new career.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!