Skip to content

Commit

Permalink
fix(text): text keeps default theme colours if missing themeprovider
Browse files Browse the repository at this point in the history
  • Loading branch information
hackr-sh committed May 9, 2023
1 parent 3e45a78 commit 14d62c0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/Text.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from "react";
import "./css/main.css";
import styled from "styled-components";
import { getThemeValue } from "./ThemeProvider";

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

0 comments on commit 14d62c0

Please sign in to comment.