Skip to content

Commit

Permalink
Use separate styled component for font-related styles
Browse files Browse the repository at this point in the history
This keeps the styling closer to where it is used.
  • Loading branch information
victorlin committed Oct 9, 2023
1 parent 0166bf3 commit 39e6d11
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/controls/annotatedHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import { FaInfoCircle } from "react-icons/fa";
import {StyledTooltip, HeaderIconContainer, HeaderContainer} from "./styles";
import {StyledTooltip, HeaderIconContainer, HeaderContainer, HeaderTitle} from "./styles";

type Props = {
toggle?: JSX.Element
Expand All @@ -14,7 +14,7 @@ export const AnnotatedHeader = ({toggle=undefined, title, tooltip, mobile}: Prop
<HeaderContainer>
<span>
{toggle && <span>{toggle}</span>}
<span>{title}</span>
<HeaderTitle>{title}</HeaderTitle>
</span>
{tooltip && !mobile && (
<>
Expand Down
7 changes: 5 additions & 2 deletions src/components/controls/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@ export const ControlsContainer = styled.div`
export const HeaderContainer = styled.div`
display: flex;
justify-content: space-between;
font-family: ${(props) => props.theme["font-family"]};
font-size: 16px;
line-height: 28px;
min-height: 28px; /* needed for safari, else the div height is 0 */
margin-top: 15px;
margin-bottom: 5px;
`;

export const HeaderTitle = styled.span`
font-family: ${(props) => props.theme["font-family"]};
font-size: 16px;
font-weight: 500;
color: ${(props) => props.theme.color};
`;
Expand Down

0 comments on commit 39e6d11

Please sign in to comment.