Skip to content

Commit 2e9c342

Browse files
Improve typography accessibility (#81)
Co-authored-by: Ayush Gupta <[email protected]>
1 parent 5a79c8e commit 2e9c342

25 files changed

+85
-73
lines changed

components/ArticleItem.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ const ArticleItem = ({ article }: { article: Article }): JSX.Element => {
1212
return (
1313
<div className="mt-0 mx-0 py-4" key={url}>
1414
<a href={url} target="_blank" rel="noreferrer">
15-
<Text type="h2" color={`text-${theme}-600`} inline additionalStyles="hover:underline">
15+
<Text size="2xl" as="h4" color={`text-${theme}-600`} additionalStyles="hover:underline">
1616
{title}
1717
</Text>
1818
</a>
19-
<Text type="base" additionalStyles="py-2">
19+
<Text size="md" as="div" additionalStyles="py-2">
2020
<Markdown>{desc}</Markdown>
2121
</Text>
2222
<Authors authors={authors} />

components/Authors.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ import Text from './common/Text';
44
function Authors({ authors }: { authors: Author[] }): JSX.Element {
55
return (
66
<div className="pb-2">
7-
<Text inline type="small" color="text-gray-600" additionalStyles="py-2 pr-1">
7+
<Text as="span" size="sm" color="text-gray-600" additionalStyles="py-2 pr-1">
88
by
99
</Text>
1010
{authors.length
1111
? authors?.map((author, index) => {
1212
const isLastElement = index === authors.length - 1;
1313
return (
1414
<a href={author.website} target="_blank" rel="noreferrer" key={author.id}>
15-
<Text inline additionalStyles="uppercase hover:underline" type="small" color="text-gray-600">
15+
<Text as="span" additionalStyles="uppercase hover:underline" size="sm" color="text-gray-600">
1616
{isLastElement ? author.name : `${author.name}, `}
1717
</Text>
1818
</a>

components/Curators.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,12 @@ function Curators(): JSX.Element {
6161
<Text
6262
additionalStyles="pt-2 text-3xl leading-8 font-extrabold tracking-wide sm:text-4xl md:text-5xl sm:leading-10"
6363
color={`text-${theme}-900`}
64-
type="h1"
64+
size="4xl"
65+
as="h2"
6566
>
6667
Curators
6768
</Text>
68-
<Text additionalStyles="pt-4 max-w-2xl text-xl leading-7 lg:mx-auto" color={`text-${theme}-700`} type="base">
69+
<Text additionalStyles="pt-4 max-w-2xl text-xl leading-7 lg:mx-auto" color={`text-${theme}-700`} size="md">
6970
The two nerdy devs who curate this newsletter for you
7071
</Text>
7172
</div>
@@ -103,15 +104,15 @@ function Curators(): JSX.Element {
103104
className={`text-${theme}-800 hover:underline`}
104105
>
105106
<Text
106-
type="h1"
107+
size="4xl"
107108
color="text-transparent"
108109
additionalStyles={`bg-gradient-to-b from-${theme}-600 to-${theme}-800 bg-clip-text`}
109-
inline
110+
as="h3"
110111
>
111112
{curator.name}
112113
</Text>
113114
</a>
114-
<Text type="base" color={`text-${theme}-700`} inline additionalStyles="py-4 max-w-3xl">
115+
<Text size="md" color={`text-${theme}-700`} as="div" additionalStyles="py-4 max-w-3xl">
115116
<Markdown>{curator.desc}</Markdown>
116117
</Text>
117118
<SocialLinks links={curator.links} additionalStyles="space-x-3" />

components/DevOfTheWeekItem.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ const DevOfTheWeekItem = ({
3535
</div>
3636
</div>
3737
<a href={profileLink.website} target="_blank" rel="noreferrer">
38-
<Text type="h2" color={`text-${theme}-600`} inline additionalStyles="hover:underline">
38+
<Text size="2xl" color={`text-${theme}-600`} as="h4" additionalStyles="hover:underline">
3939
{name}
4040
</Text>
4141
</a>
42-
<Text type="base" additionalStyles="pt-2 pb-4">
42+
<Text size="md" as="div" additionalStyles="pt-2 pb-4">
4343
<Markdown>{bio}</Markdown>
4444
</Text>
4545
<div className="flex">

components/FeatureSection.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,16 @@ const FeatureSection = (): JSX.Element => {
5959
<Text
6060
additionalStyles="pt-2 text-3xl leading-8 font-extrabold tracking-wide sm:text-4xl md:text-5xl sm:leading-10 text-shadow"
6161
color="text-white"
62-
type="h1"
62+
size="4xl"
63+
as="h2"
6364
>
6465
Sections
6566
</Text>
6667

6768
<Text
6869
additionalStyles="pt-4 max-w-2xl text-xl leading-7 lg:mx-auto text-shadow"
6970
color={`text-${theme}-100`}
70-
type="base"
71+
size="md"
7172
>
7273
A look at what&apos;s inside our newsletter
7374
</Text>
@@ -85,7 +86,12 @@ const FeatureSection = (): JSX.Element => {
8586
{feature.icon}
8687
</div>
8788
<div className="pl-4">
88-
<Text type="h2" color="text-white" additionalStyles="text-lg leading-6 font-semibold text-shadow">
89+
<Text
90+
size="2xl"
91+
as="h3"
92+
color="text-white"
93+
additionalStyles="text-lg leading-6 font-semibold text-shadow"
94+
>
8995
{feature.name}
9096
</Text>
9197
<Text

components/Footer.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const Footer = (): JSX.Element => {
3434
</span>
3535
</a>
3636
</Link>
37-
<Text inline color={`text-${theme}-900`} additionalStyles="text-sm font-semibold pb-3 lg:pb-0 text-pom">
37+
<Text as="span" color={`text-${theme}-900`} additionalStyles="text-sm font-semibold pb-3 lg:pb-0 text-pom">
3838
&#169; {new Date().getFullYear()}. All rights reserved.
3939
</Text>
4040
</div>
@@ -44,7 +44,7 @@ const Footer = (): JSX.Element => {
4444
<li className="p-0">
4545
<Link href="/">
4646
<a className="hover:underline text-pom p-2 inline-flex items-center">
47-
<Text inline additionalStyles={`text-${theme}-900`}>
47+
<Text as="span" additionalStyles={`text-${theme}-900`}>
4848
Subscribe
4949
</Text>
5050
</a>
@@ -53,7 +53,7 @@ const Footer = (): JSX.Element => {
5353
<li className="p-0">
5454
<Link href="/issues">
5555
<a className="hover:underline text-pom p-2 inline-flex items-center">
56-
<Text inline additionalStyles={`text-${theme}-900`}>
56+
<Text as="span" additionalStyles={`text-${theme}-900`}>
5757
View Issues
5858
</Text>
5959
</a>

components/GIFItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const GIFItem = ({ gif }: { gif: Gif }): JSX.Element => {
5858
return (
5959
<div className="flex flex-col items-center">
6060
<div className="mt-4">{renderMedia({ format, source: gifURL, caption })}</div>
61-
<Text type="small" color="text-gray-700" additionalStyles="mt-3 text-center">
61+
<Text size="sm" as="div" color="text-gray-700" additionalStyles="mt-3 text-center">
6262
<Markdown>{caption}</Markdown>
6363
</Text>
6464
</div>

components/HeroSection.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,17 @@ const HeroSection = (): JSX.Element => {
2222
<div className="flex justify-center h-24 w-24 md:h-32 md:w-32 mt-4 sm:mt-6 lg:mt-12">
2323
<ScriptifiedLogo color={`text-${theme}-100`} additionalStyles="h-24 w-24 md:h-32 md:w-32" />
2424
</div>
25-
<Text type="h1" color={`text-${theme}-100`}>
26-
<h1 className="text-shadow text-6xl">{siteConfig.name}</h1>
25+
<Text as="h1" size="6xl" color={`text-${theme}-100`} additionalStyles="text-shadow">
26+
{siteConfig.name}
2727
</Text>
2828
</div>
2929
<Text
30-
// type="h1"
30+
as="h2"
31+
size="3xl"
3132
color={`text-${theme}-100`}
32-
additionalStyles="text-3xl mb-10 sm:mb-12 lg:mb-16 max-w-3xl text-center px-4"
33+
additionalStyles="mb-10 sm:mb-12 lg:mb-16 max-w-3xl text-center px-4 text-shadow"
3334
>
34-
<h2 className="text-shadow text-3xl">
35-
{`${descPart1} `}
36-
<span className="whitespace-nowrap">{descPart2}</span>
37-
</h2>
35+
{descPart1} <span className="whitespace-nowrap">{descPart2}</span>
3836
</Text>
3937
<div className="w-5/6 sm:mx-8 lg:w-2/4 mb-2 relative z-10">
4038
<SubscribeCard homePage />

components/IssueItem.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ const IssueItem = ({
1818
<div id={id} className="my-20">
1919
<div className="flex flex-row items-center">
2020
<Text
21-
type="h1"
21+
size="4xl"
22+
as="h3"
2223
color="text-transparent"
2324
additionalStyles={`sm:text-4xl md:text-5xl bg-gradient-to-b from-${theme}-600 to-${theme}-900 bg-clip-text`}
2425
>

components/LatestIssues.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const LatestIssues = ({ allIssuesData }: { allIssuesData: Meta[] }): JSX.Element
1212

1313
return (
1414
<Fragment>
15-
<Text color={`text-${theme}-900`} additionalStyles="text-5xl leading-snug py-8 mx-0" type="h1">
15+
<Text color={`text-${theme}-900`} additionalStyles="leading-snug py-8 mx-0" size="4xl" as="h2">
1616
Latest Issues
1717
</Text>
1818
<ul className="m-0 p-0 list-none">

0 commit comments

Comments
 (0)