Skip to content

Commit f9c2f44

Browse files
author
Vianpyro
committed
Refactor font sizes across components to use CSS variables for consistency and improved readability
1 parent d783ebd commit f9c2f44

File tree

10 files changed

+160
-11
lines changed

10 files changed

+160
-11
lines changed

src/components/Footer.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const yearString = currentYear === baseYear ? baseYear.toString() : `${baseYear}
5656
@media screen and (width<=850px) {
5757
footer > div {
5858
flex-direction: column;
59-
font-size: 1rem;
59+
font-size: var(--font-size-small);
6060
gap: 0;
6161
}
6262
}

src/components/Header.astro

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const { canSearch = false } = Astro.props || {}
2525

2626
<style>
2727
h1 {
28+
font-size: var(--font-size-title);
2829
text-wrap: nowrap;
2930
}
3031

@@ -77,10 +78,6 @@ const { canSearch = false } = Astro.props || {}
7778
margin: 0;
7879
}
7980

80-
h1 {
81-
font-size: 1.75rem;
82-
}
83-
8481
svg {
8582
width: calc(1.5 * var(--spacing-medium));
8683
height: calc(1.5 * var(--spacing-medium));

src/components/RecipeCard.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function randint(min: number, max: number) {
3030

3131
<style>
3232
h1 {
33-
font-size: calc(1.5 * var(--spacing-medium));
33+
font-size: var(--font-size-title);
3434
}
3535

3636
.recipe-polaroid {

src/components/SearchBar.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const { placeholder } = Astro.props
1818
border: none;
1919
border-bottom: 2px solid var(--color-primary);
2020
flex: 1;
21-
font-size: 1.5rem;
21+
font-size: var(--font-size-body);
2222
outline: none;
2323
}
2424

src/content/privacy-policy.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Privacy Policy
2+
3+
_Effective Date: April 6, 2025_
4+
5+
## Introduction
6+
7+
Welcome to **Smart Cooking ©**!
8+
9+
Your privacy is important to us.
10+
This Privacy Policy explains what information we collect when you use our site, how we use it, and how we keep it safe.
11+
12+
## Information We Collect
13+
14+
We collect and process the following types of information:
15+
16+
### Account Information
17+
18+
- You can create an account directly on our platform.
19+
- We manage login and sign-up ourselves, without using services like Google or Facebook.
20+
21+
### Login and Session Information
22+
23+
- We use small files (called cookies) to help keep you signed in and remember your session while you're using our site.
24+
25+
### IP Addresses (for Security)
26+
27+
- We record your internet address (IP) to help protect our site from spam or abuse.
28+
- This information is kept for up to **90 days** and then deleted.
29+
30+
## How We Use Your Information
31+
32+
We use the information we collect to:
33+
34+
- Keep your account safe and make sure you stay logged in.
35+
- Protect the site from misuse or attacks.
36+
37+
## Cookies
38+
39+
### Essential Cookies
40+
41+
- These are required for the site to work properly, such as staying logged in.
42+
- We do **not** use cookies to track you on other sites.
43+
44+
### Language Preference
45+
46+
- We may remember your preferred language to show the site in the language you like.
47+
- If you'd rather not store this, you can block cookies through your browser settings.
48+
49+
## How We Protect Your Information
50+
51+
- We **do not** sell, share, or rent your personal information to anyone.
52+
- We only collect what is necessary for login and security.
53+
- We use modern security practices to protect your information from unauthorized access.
54+
55+
## Your Rights and Choices
56+
57+
- Our code is **open-source and [available on GitHub](https://github.com/TheSmartCooking)**, so anyone can see how we handle data.
58+
- You can ask to see or delete your data at any time by contacting us or opening a GitHub issue.
59+
60+
## In Case of a Security Issue
61+
62+
If something goes wrong and your information might be at risk, we will notify you as soon as we can.
63+
64+
## Changes to This Policy
65+
66+
We may update this policy occasionally. The most recent version will always be available on our site.
67+
68+
## Contact
69+
70+
If you have any questions about this Privacy Policy, feel free to reach out to us.

src/pages/authentication.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ import PasswordRequirements from '../components/PasswordRequirements.astro'
5151
background-color: var(--color-secondary);
5252
border: none;
5353
border-radius: var(--border-radius-large);
54-
font-size: 1rem;
54+
font-size: var(--font-size-small);
5555
padding: 1rem 2rem;
5656
}
5757

src/pages/privacy.astro

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
---
2+
// src/pages/privacy.astro
23
import Main from '../layouts/Main.astro'
4+
import PrivacyPolicy from '../content/privacy-policy.md'
5+
import '../styles/markdown.css'
36
---
47

5-
<Main title="Privacy Policy" />
8+
<Main title="Privacy Policy">
9+
<div class="markdown"><PrivacyPolicy /></div>
10+
</Main>
11+
12+
<style>
13+
/* div {
14+
display: flex;
15+
flex-direction: column;
16+
width: 80%;
17+
justify-self: center;
18+
} */
19+
</style>

src/styles/form_field.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
top: 1rem;
1919
left: 0.75rem;
2020
color: #888;
21-
font-size: 1rem;
21+
font-size: var(--font-size-small);
2222
pointer-events: none;
2323
transition: 0.2s ease all;
2424
}
@@ -27,7 +27,7 @@
2727
.form-field input.filled + label {
2828
top: -0.5rem;
2929
left: 0.5rem;
30-
font-size: 0.75rem;
30+
font-size: var(--font-size-tiny);
3131
color: var(--color-secondary);
3232
}
3333

src/styles/global.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@
2626
--border-radius-medium: 16px;
2727
--border-radius-large: 32px;
2828

29+
/*
30+
Define font sizes for headings and body text.
31+
Use these to ensure a clear hierarchy and readability in the text.
32+
*/
33+
--font-size-heading: 2.4rem;
34+
--font-size-title: 2rem;
35+
--font-size-body: 1.5rem;
36+
--font-size-small: 1rem;
37+
--font-size-tiny: 0.75rem;
38+
2939
/*
3040
Define a polaroid informations.
3141
Use these to create a consistent look and feel for the recipe cards.
@@ -63,5 +73,11 @@ svg {
6373
@media screen and (width <=320px) {
6474
:root {
6575
--polaroid-width: 100svw;
76+
77+
--font-size-heading: 1.75rem;
78+
--font-size-title: 1.5rem;
79+
--font-size-body: 1.25rem;
80+
--font-size-small: 0.75rem;
81+
--font-size-tiny: 0.5rem;
6682
}
6783
}

src/styles/markdown.css

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
:root {
2+
--highlight-color: light-dark(#161616, #e9e9e9);
3+
}
4+
5+
.markdown h1,
6+
.markdown h2,
7+
.markdown h3,
8+
.markdown h4,
9+
.markdown h5,
10+
.markdown h6 {
11+
border-bottom: 1px solid var(--highlight-color);
12+
padding-bottom: var(--spacing-small);
13+
font-size: var(--font-size-body);
14+
font-weight: bold;
15+
margin-bottom: var(--spacing-small);
16+
margin-top: var(--spacing-medium);
17+
}
18+
19+
.markdown h1 {
20+
font-size: var(--font-size-heading);
21+
text-align: center;
22+
}
23+
24+
.markdown h2 {
25+
font-size: var(--font-size-title);
26+
}
27+
28+
.markdown ul {
29+
margin-left: var(--spacing-medium);
30+
}
31+
32+
.markdown strong {
33+
text-decoration: underline;
34+
}
35+
36+
pre {
37+
border: 1px solid var(--highlight-color);
38+
border-radius: var(--border-radius-small);
39+
overflow-x: auto;
40+
padding: var(--spacing-small);
41+
background-color: var(--polaroid-color);
42+
}
43+
44+
pre code {
45+
color: #888;
46+
}
47+
48+
code:not(pre code) {
49+
border-radius: var(--border-radius-small);
50+
padding: 0 var(--spacing-small);
51+
background-color: var(--polaroid-color);
52+
}

0 commit comments

Comments
 (0)