Skip to content

Commit 14d62c0

Browse files
committed
fix(text): text keeps default theme colours if missing themeprovider
1 parent 3e45a78 commit 14d62c0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/Text.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from "react";
22
import "./css/main.css";
33
import styled from "styled-components";
4+
import { getThemeValue } from "./ThemeProvider";
45

56
export type TextProps = React.HTMLAttributes<
67
HTMLHeadingElement | HTMLParagraphElement
@@ -50,5 +51,5 @@ const TextElement = styled.p<TextProps>`
5051
font-family: "Poppins", sans-serif;
5152
font-weight: ${(props) => variantMapping[props.variant ?? "p"].fontWeight};
5253
font-size: ${(props) => variantMapping[props.variant ?? "p"].fontSize};
53-
color: ${(props) => props.theme.text};
54+
color: ${(props) => props.theme.text ?? getThemeValue("text")};
5455
`;

0 commit comments

Comments
 (0)