Replies: 1 comment
-
|
@arabog Have you figured out a solution? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
i was trying to import some custom code (breakpoints, color, fonts) from my default file but i keep getting this error: TypeError: Cannot read properties of undefined (reading 'sm') using styled-components
Here is my code:
`default.js
// Temp fonts
export const fonts = {
title: "Space Grotesk, sans-serif",
}
// Colors for layout
export const colors = {
primary1: "hsl(204,23.8%,95.9%)",
}
const size = {
xs: "320px",
}
// Breakpoints for responsive design
export const breakpoints = {
sm:
(max-width: ${size.xs}),}
global.js file:
import { createGlobalStyle } from 'styled-components';
import { normalize } from 'styled-normalize';
const GlobalStyles = createGlobalStyle`
${normalize};
`;
export default GlobalStyles;
Theme.js file:
import { ThemeProvider } from "styled-components";
import theme from "../themes/default"
import GlobalStyles from "./globals"
const Theme = ( { children } ) => (
)
export default Theme
`
Beta Was this translation helpful? Give feedback.
All reactions