Skip to content

Commit 88bc000

Browse files
authored
Typography changes (#85)
Use fonts according to TF visual guidelines. Increase readability in multiple places.
1 parent d859a11 commit 88bc000

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+228
-122
lines changed

app/layout.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,16 @@ const raleway = localFont({
3131
})
3232

3333
const montserrat = localFont({
34-
src: '../public/fonts/montserrat/Montserrat-Bold.woff2',
34+
src: [
35+
{
36+
style: 'normal',
37+
path: '../public/fonts/montserrat/Montserrat-VariableFont_wght.ttf',
38+
},
39+
{
40+
style: 'italic',
41+
path: '../public/fonts/montserrat/Montserrat-Italic-VariableFont_wght.ttf',
42+
},
43+
],
3544
variable: '--font-montserrat',
3645
})
3746

app/nyheter/[slug]/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const renderer: RendererObject = {
77
return `<img class='event-page-image' src=${href} alt='bild' />`
88
},
99
link(href, _, text) {
10-
return `<a class="text-blue-600 underline visited:text-purple-600 hover:text-blue-800" href=${href}>${text}</a>`
10+
return `<a class="text-blue-600 underline visited:text-purple-600 hover:text-blue-800 break-all" href=${href}>${text}</a>`
1111
},
1212
}
1313

@@ -25,7 +25,7 @@ const Page = async (props: { params: Promise<{ slug: string }> }) => {
2525

2626
return (
2727
<>
28-
<h1>
28+
<h1 className="break-words">
2929
{post?.title}
3030
{post?.date && <p className="text-lg">{getDateLong(post?.date)}</p>}
3131
</h1>

app/nyheter/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const Page = async () => {
1212

1313
return (
1414
<Column className="z-10 mx-auto my-6 min-h-[92vh] max-w-7xl p-4">
15-
<p className="pb-5 text-3xl">Nyheter</p>
15+
<h1 className="pb-5 text-4xl font-bold">Nyheter</h1>
1616
<Posts initialPosts={posts} totalPages={totalPages} />
1717
</Column>
1818
)

components/Page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ type PageProps = {
2222
const Page = async ({ page, isPrivate = false }: PageProps) => {
2323
return (
2424
<>
25-
<h1>{page?.title}</h1>
25+
<h1 className="break-words">{page?.title}</h1>
2626
{page?.content && (
2727
<div
2828
dangerouslySetInnerHTML={{
@@ -33,9 +33,9 @@ const Page = async ({ page, isPrivate = false }: PageProps) => {
3333
{page?.showTableOfContents && (
3434
<TableOfContents sections={page.sections} />
3535
)}
36-
{page?.sections?.map((section, i) => (
36+
{page?.sections?.map((section) => (
3737
<PageSection
38-
key={i}
38+
key={section.documentId}
3939
title={section.title}
4040
content={section.content}
4141
fileFolders={section.file_folders}

components/PageLayout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import React from 'react'
33
const PageLayout = ({ children }: { children: React.ReactNode }) => (
44
<div className="min-h-screen">
55
<div className="flex flex-grow justify-center">
6-
<div className="prose prose-sm mx-4 mb-12 mt-6 flex flex-col sm:mx-8 md:mx-16 md:mt-12">
6+
<article className="prose prose-sm xxs:prose-base w-[95vw] 2xl:prose-xl mx-4 mb-12 mt-6 flex flex-col sm:mx-8 md:mx-16 md:mt-12">
77
{children}
8-
</div>
8+
</article>
99
</div>
1010
</div>
1111
)

components/Subtitle.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const Subtitle = ({
55
underline = true,
66
}: React.PropsWithChildren<{ underline?: boolean }>) => (
77
<>
8-
<p className="text-2xl text-black xxs:text-3xl">{children}</p>
8+
<h2 className="text-2xl xxs:text-3xl">{children}</h2>
99
{underline && (
1010
<div className="my-1 h-[3px] w-full rounded-sm bg-teknologröd" />
1111
)}

components/TFInfo.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import Column from './Column'
33

44
const TFInfo = () => {
55
return (
6-
<Column className="text-black">
7-
<h1 className="text-3xl font-bold">Vad är TF?</h1>
8-
<p className="max-w-[1200px] py-3">
6+
<Column className="prose 2xl:prose-xl">
7+
<h2>Vad är TF?</h2>
8+
<p className="">
99
Vad är TF? Teknologföreningen, TF, är den svenskspråkiga nationen vid
1010
Aalto-universitetet. Nationen grundades 1872. TF:s ändamål är att
1111
sammanföra svenskspråkiga studerande vid Aalto-universitetet. I och med

components/header/navbar/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,14 @@ const NavbarDropdown = ({
135135
const pathWithoutAnchor = path?.split('#')[0]
136136

137137
return (
138-
<div className="relative mx-3">
138+
<div className="relative mx-3 text-xl font-semibold">
139139
<div
140140
className={classNames(
141141
isTop ? 'peer' : '!m-0',
142142
pathWithoutAnchor?.startsWith(`/${link.basePath}`) &&
143143
link.links.find((l) => l.link === pathWithoutAnchor) &&
144144
'!text-teknologröd',
145-
'link-text text-link'
145+
'link-text'
146146
)}
147147
onClick={onClick}
148148
>

components/posts/Post.tsx

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react'
22
import Link from 'next/link'
33
import { PostType } from '@models/post'
44
import { getDateLong } from '@utils/helpers'
5+
import Column from '@components/Column'
56

67
const Post = ({ post }: { post: PostType }) => {
78
return (
@@ -10,16 +11,20 @@ const Post = ({ post }: { post: PostType }) => {
1011
className="mt-4 w-full rounded-md bg-lightGray p-2 shadow-md transition-shadow duration-200 ease-in-out hover:shadow-lg"
1112
key={post.slug}
1213
>
13-
<p className="select-none text-xl font-medium">{post.title}</p>
14-
{post.date && (
15-
<p className="select-none font-medium ">{getDateLong(post.date)}</p>
16-
)}
17-
<p className="max-h-[100px] overflow-hidden text-ellipsis text-sm">
18-
{post.description}
19-
</p>
20-
<p className="text-sm font-extrabold leading-[18px] tracking-wide text-teknologröd">
21-
läs mera
22-
</p>
14+
<Column className="items-baseline gap-1">
15+
<h3 className="select-none text-xl xxs:text-2xl font-medium">
16+
{post.title}
17+
</h3>
18+
{post.date && (
19+
<p className="select-none xxs:text-xl">{getDateLong(post.date)}</p>
20+
)}
21+
<p className="max-h-[100px] overflow-hidden text-ellipsis text-sm">
22+
{post.description}
23+
</p>
24+
<p className="font-semibold leading-[18px] tracking-wide text-teknologröd">
25+
läs mera
26+
</p>
27+
</Column>
2328
</Link>
2429
)
2530
}

components/posts/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const Posts = ({ posts }: { posts: PostType[] }) => {
1313
))}
1414
<Link
1515
href="/nyheter"
16-
className="duration-50 mt-4 rounded-md p-2 text-center text-sm text-teknologröd transition-colors ease-in-out hover:bg-lightGray"
16+
className="duration-50 mt-4 rounded-md p-2 text-center font-medium text-teknologröd transition-colors ease-in-out hover:bg-lightGray"
1717
>
1818
Mera nyheter
1919
</Link>
-75.8 KB
Binary file not shown.
Binary file not shown.
-76.7 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-79.3 KB
Binary file not shown.
-75.6 KB
Binary file not shown.
Binary file not shown.
-76.7 KB
Binary file not shown.
Binary file not shown.
-76.8 KB
Binary file not shown.
-76.3 KB
Binary file not shown.
Binary file not shown.
-72.3 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.

public/fonts/montserrat/OFL.txt

Lines changed: 93 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,93 @@
1-
Copyright 2011 The Montserrat Project Authors (https://github.com/JulietaUla/Montserrat)
2-
3-
This Font Software is licensed under the SIL Open Font License, Version 1.1.
4-
This license is copied below, and is also available with a FAQ at:
5-
http://scripts.sil.org/OFL
6-
7-
8-
-----------------------------------------------------------
9-
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10-
-----------------------------------------------------------
11-
12-
PREAMBLE
13-
The goals of the Open Font License (OFL) are to stimulate worldwide
14-
development of collaborative font projects, to support the font creation
15-
efforts of academic and linguistic communities, and to provide a free and
16-
open framework in which fonts may be shared and improved in partnership
17-
with others.
18-
19-
The OFL allows the licensed fonts to be used, studied, modified and
20-
redistributed freely as long as they are not sold by themselves. The
21-
fonts, including any derivative works, can be bundled, embedded,
22-
redistributed and/or sold with any software provided that any reserved
23-
names are not used by derivative works. The fonts and derivatives,
24-
however, cannot be released under any other type of license. The
25-
requirement for fonts to remain under this license does not apply
26-
to any document created using the fonts or their derivatives.
27-
28-
DEFINITIONS
29-
"Font Software" refers to the set of files released by the Copyright
30-
Holder(s) under this license and clearly marked as such. This may
31-
include source files, build scripts and documentation.
32-
33-
"Reserved Font Name" refers to any names specified as such after the
34-
copyright statement(s).
35-
36-
"Original Version" refers to the collection of Font Software components as
37-
distributed by the Copyright Holder(s).
38-
39-
"Modified Version" refers to any derivative made by adding to, deleting,
40-
or substituting -- in part or in whole -- any of the components of the
41-
Original Version, by changing formats or by porting the Font Software to a
42-
new environment.
43-
44-
"Author" refers to any designer, engineer, programmer, technical
45-
writer or other person who contributed to the Font Software.
46-
47-
PERMISSION & CONDITIONS
48-
Permission is hereby granted, free of charge, to any person obtaining
49-
a copy of the Font Software, to use, study, copy, merge, embed, modify,
50-
redistribute, and sell modified and unmodified copies of the Font
51-
Software, subject to the following conditions:
52-
53-
1) Neither the Font Software nor any of its individual components,
54-
in Original or Modified Versions, may be sold by itself.
55-
56-
2) Original or Modified Versions of the Font Software may be bundled,
57-
redistributed and/or sold with any software, provided that each copy
58-
contains the above copyright notice and this license. These can be
59-
included either as stand-alone text files, human-readable headers or
60-
in the appropriate machine-readable metadata fields within text or
61-
binary files as long as those fields can be easily viewed by the user.
62-
63-
3) No Modified Version of the Font Software may use the Reserved Font
64-
Name(s) unless explicit written permission is granted by the corresponding
65-
Copyright Holder. This restriction only applies to the primary font name as
66-
presented to the users.
67-
68-
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69-
Software shall not be used to promote, endorse or advertise any
70-
Modified Version, except to acknowledge the contribution(s) of the
71-
Copyright Holder(s) and the Author(s) or with their explicit written
72-
permission.
73-
74-
5) The Font Software, modified or unmodified, in part or in whole,
75-
must be distributed entirely under this license, and must not be
76-
distributed under any other license. The requirement for fonts to
77-
remain under this license does not apply to any document created
78-
using the Font Software.
79-
80-
TERMINATION
81-
This license becomes null and void if any of the above conditions are
82-
not met.
83-
84-
DISCLAIMER
85-
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88-
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89-
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90-
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91-
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92-
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93-
OTHER DEALINGS IN THE FONT SOFTWARE.
1+
Copyright 2024 The Montserrat.Git Project Authors (https://github.com/JulietaUla/Montserrat.git)
2+
3+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
4+
This license is copied below, and is also available with a FAQ at:
5+
https://openfontlicense.org
6+
7+
8+
-----------------------------------------------------------
9+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10+
-----------------------------------------------------------
11+
12+
PREAMBLE
13+
The goals of the Open Font License (OFL) are to stimulate worldwide
14+
development of collaborative font projects, to support the font creation
15+
efforts of academic and linguistic communities, and to provide a free and
16+
open framework in which fonts may be shared and improved in partnership
17+
with others.
18+
19+
The OFL allows the licensed fonts to be used, studied, modified and
20+
redistributed freely as long as they are not sold by themselves. The
21+
fonts, including any derivative works, can be bundled, embedded,
22+
redistributed and/or sold with any software provided that any reserved
23+
names are not used by derivative works. The fonts and derivatives,
24+
however, cannot be released under any other type of license. The
25+
requirement for fonts to remain under this license does not apply
26+
to any document created using the fonts or their derivatives.
27+
28+
DEFINITIONS
29+
"Font Software" refers to the set of files released by the Copyright
30+
Holder(s) under this license and clearly marked as such. This may
31+
include source files, build scripts and documentation.
32+
33+
"Reserved Font Name" refers to any names specified as such after the
34+
copyright statement(s).
35+
36+
"Original Version" refers to the collection of Font Software components as
37+
distributed by the Copyright Holder(s).
38+
39+
"Modified Version" refers to any derivative made by adding to, deleting,
40+
or substituting -- in part or in whole -- any of the components of the
41+
Original Version, by changing formats or by porting the Font Software to a
42+
new environment.
43+
44+
"Author" refers to any designer, engineer, programmer, technical
45+
writer or other person who contributed to the Font Software.
46+
47+
PERMISSION & CONDITIONS
48+
Permission is hereby granted, free of charge, to any person obtaining
49+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
50+
redistribute, and sell modified and unmodified copies of the Font
51+
Software, subject to the following conditions:
52+
53+
1) Neither the Font Software nor any of its individual components,
54+
in Original or Modified Versions, may be sold by itself.
55+
56+
2) Original or Modified Versions of the Font Software may be bundled,
57+
redistributed and/or sold with any software, provided that each copy
58+
contains the above copyright notice and this license. These can be
59+
included either as stand-alone text files, human-readable headers or
60+
in the appropriate machine-readable metadata fields within text or
61+
binary files as long as those fields can be easily viewed by the user.
62+
63+
3) No Modified Version of the Font Software may use the Reserved Font
64+
Name(s) unless explicit written permission is granted by the corresponding
65+
Copyright Holder. This restriction only applies to the primary font name as
66+
presented to the users.
67+
68+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69+
Software shall not be used to promote, endorse or advertise any
70+
Modified Version, except to acknowledge the contribution(s) of the
71+
Copyright Holder(s) and the Author(s) or with their explicit written
72+
permission.
73+
74+
5) The Font Software, modified or unmodified, in part or in whole,
75+
must be distributed entirely under this license, and must not be
76+
distributed under any other license. The requirement for fonts to
77+
remain under this license does not apply to any document created
78+
using the Font Software.
79+
80+
TERMINATION
81+
This license becomes null and void if any of the above conditions are
82+
not met.
83+
84+
DISCLAIMER
85+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93+
OTHER DEALINGS IN THE FONT SOFTWARE.

0 commit comments

Comments
 (0)