Skip to content

Commit

Permalink
new headings
Browse files Browse the repository at this point in the history
  • Loading branch information
Beth Shook committed Jan 29, 2024
1 parent 7349dbd commit 0bbe7d1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/components/Text.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Paragraph, H2 } from './Text';
import { Paragraph, H2, H3, H4 } from './Text';
import renderer from 'react-test-renderer';

describe('Text', () => {
Expand All @@ -11,7 +11,11 @@ describe('Text', () => {

it('matches heading snapshot', () => {
const tree = renderer.create(
<H2>This is a heading</H2>
<>
<H2>This is an h2</H2>
<H3>This is an h3</H3>
<H4>This is an h4</H4>
</>
).toJSON();
expect(tree).toMatchSnapshot();
});
Expand Down
6 changes: 4 additions & 2 deletions src/components/Text.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { H2, Paragraph } from "./Text";
import { H2, H3, H4, Paragraph } from "./Text";

export const PText = () => <>
<Paragraph>Body text</Paragraph>
</>;

export const Heading = () => <>
export const Headings = () => <>
<H2>Heading text</H2>
<H3>Heading text</H3>
<H4>Heading text</H4>
</>;
15 changes: 15 additions & 0 deletions src/components/Text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,21 @@ export const H2 = styled.h2`
font-weight: 700;
`;

export const H3 = styled.h3`
color: ${palette.neutralDarker};
font-size: 1.4rem;
font-weight: 700;
line-height: 2.4rem;
`;

export const H4 = styled.h4`
color: ${palette.neutralThin};
font-size: 1.4rem;
font-weight: 700;
line-height: 2rem;
text-transform: uppercase;
`;

export const Paragraph = styled.p`
color: ${palette.neutralDarker};
font-size: 1.8rem;
Expand Down

0 comments on commit 0bbe7d1

Please sign in to comment.