Skip to content

Commit

Permalink
fix: heading size mobile (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
fpasquet authored Jan 30, 2024
1 parent 43851a3 commit 8902320
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 20 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@eleven-labs/design-system",
"description": "Design System for Eleven Labs",
"version": "0.26.2",
"version": "0.27.0",
"repository": {
"type": "git",
"url": "https://github.com/eleven-labs/design-system.git"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React from 'react';

import type { BoxProps } from '@/components';
import { Box, Button, Flex, Heading, Text } from '@/components';
import type { ComponentPropsWithoutRef } from '@/types';

import './HomeIntroBlock.scss';

export interface HomeIntroBlockProps {
export interface HomeIntroBlockProps extends BoxProps {
intro: React.ReactNode;
title: React.ReactNode;
description: React.ReactNode;
Expand All @@ -17,8 +18,9 @@ export const HomeIntroBlock: React.FC<HomeIntroBlockProps> = ({
title,
description,
elevenLabsLink: { label: elevelLabsLinkLabel, ...elevenLabsLink },
...props
}) => (
<Box py="xl" className="home-intro-block">
<Box className="home-intro-block" {...props}>
<Flex
alignItems="baseline"
flexDirection="column"
Expand Down
32 changes: 22 additions & 10 deletions src/components/Molecules/Cards/AuthorCard/AuthorCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,19 @@ export const AuthorCard: React.FC<AuthorCardProps> = ({
link: { label: linkLabel, ...link },
...props
}) => (
<Flex {...props} alignItems="center" justifyContent="between" px="s" py="m" bg="white" className="author-card">
<Flex gap="s" flex="1" alignItems="center">
{avatarImageUrl ? (
<img src={avatarImageUrl} alt={name} className="author-card__avatar-img" />
) : (
<div className="author-card__avatar-img author-card__avatar-img--empty" />
)}
<Flex {...props} alignItems="center" gap="s" px="s" py="m" bg="white" className="author-card">
{avatarImageUrl ? (
<img src={avatarImageUrl} alt={name} className="author-card__avatar-img" />
) : (
<div className="author-card__avatar-img author-card__avatar-img--empty" />
)}
<Flex
flexDirection={{ xs: 'column', md: 'row' }}
flex="1"
justifyContent="between"
alignItems={{ xs: 'start', md: 'center' }}
gap="s"
>
<Box>
<Text color="primary" size="m" fontWeight="semi-bold">
{name}
Expand All @@ -35,9 +41,15 @@ export const AuthorCard: React.FC<AuthorCardProps> = ({
{description}
</Text>
</Box>
<Link
{...link}
px={{ xs: '0', md: 'm' }}
textTransform="uppercase"
data-internal-link="author"
className="author-card__link"
>
{linkLabel}
</Link>
</Flex>
<Link {...link} px="m" textTransform="uppercase" data-internal-link="author" className="author-card__link">
{linkLabel}
</Link>
</Flex>
);
1 change: 1 addition & 0 deletions src/components/Molecules/Cards/ContactCard/ContactCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const ContactCard: React.FC<ContactCardProps> = ({
gap="m"
textAlign="center"
className="contact-card__container"
px="m"
>
<Heading size="l" color="primary">
{title}
Expand Down
16 changes: 12 additions & 4 deletions src/designTokens/typography/heading.tokens.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
"value": "{line-height.base.value}"
},
"letter-spacing": {
"value": "2px"
"value": "1px"
}
},
"s": {
"font-size": {
"value": "20px"
"value": "16px"
},
"font-weight": {
"value": "{font-weight.bold.value}"
Expand All @@ -38,7 +38,7 @@
},
"xl": {
"font-size": {
"value": "{typography.heading.m.font-size.value} * 2"
"value": "{typography.heading.m.font-size.value} + 8"
},
"font-weight": {
"value": "{font-weight.regular.value}"
Expand All @@ -47,12 +47,17 @@
"value": "uppercase"
},
"letter-spacing": {
"value": "3px"
"value": "2px"
}
}
}
},
"desktop": {
"base": {
"letter-spacing": {
"value": "2px"
}
},
"typography": {
"heading": {
"s": {
Expand All @@ -73,6 +78,9 @@
"xl": {
"font-size": {
"value": "{desktop.typography.heading.m.font-size.value} * 2"
},
"letter-spacing": {
"value": "3px"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/HomePage/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const HomePage: React.FC<HomePageProps> = ({
newsletterCard,
}) => (
<>
<HomeIntroBlock {...homeIntroBlock} />
<HomeIntroBlock py={{ xs: '0', md: 'xl' }} {...homeIntroBlock} />
<LastArticlesBlock {...lastArticlesBlock} />
{lastTutorialsBlock && <LastTutorialsBlock {...lastTutorialsBlock} />}
<Box my="xl" mx={{ xs: 's', md: 'auto' }} width={{ md: 'content-container' }}>
Expand Down

0 comments on commit 8902320

Please sign in to comment.