From 4b7e3990a762deefc9be734f8e1fe3fdd93f36a4 Mon Sep 17 00:00:00 2001
From: madcampos
Date: Sun, 7 Jul 2024 23:40:44 -0400
Subject: [PATCH 01/12] feat: add styles for author avatar
---
src/components/Avatar/styles.css | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/components/Avatar/styles.css b/src/components/Avatar/styles.css
index ac8e9f3..36188be 100644
--- a/src/components/Avatar/styles.css
+++ b/src/components/Avatar/styles.css
@@ -1,12 +1,15 @@
.user-avatar {
- --image-size: var(--avatar-size);
+ --image-size: var(--size-13);
display: block;
width: var(--image-size);
height: var(--image-size);
- border-radius: 100vmax;
+ aspect-ratio: var(--ratio-square);
+ border-radius: var(--radius-round);
overflow: hidden;
+ border: solid var(--tjs-red-6) var(--size-2);
+ box-shadow: var(--size-1) var(--size-1) var(--gray-12);
}
.user-avatar img {
@@ -17,5 +20,5 @@
}
@media (max-width: 768px) {
- .user-avatar { --image-size: var(--avatar-small-size); }
+ .user-avatar { --image-size: var(--size-12); }
}
From 4a76960b6ffd017e7e6cdf9034ef70a2cefa3946 Mon Sep 17 00:00:00 2001
From: madcampos
Date: Sun, 7 Jul 2024 23:53:18 -0400
Subject: [PATCH 02/12] fix: resolve css side effects
---
src/components/SiteFooter/styles.css | 2 +-
src/components/SiteNav/styles.css | 27 +++++++--------------------
src/layouts/Base/base.css | 5 ++++-
3 files changed, 12 insertions(+), 22 deletions(-)
diff --git a/src/components/SiteFooter/styles.css b/src/components/SiteFooter/styles.css
index d06f73d..8254e8d 100644
--- a/src/components/SiteFooter/styles.css
+++ b/src/components/SiteFooter/styles.css
@@ -1,4 +1,4 @@
-ul {
+#bottom-nav ul {
display: flex;
gap: 0.5rem;
justify-content: center;
diff --git a/src/components/SiteNav/styles.css b/src/components/SiteNav/styles.css
index 25c7867..e0fe2d6 100644
--- a/src/components/SiteNav/styles.css
+++ b/src/components/SiteNav/styles.css
@@ -1,25 +1,12 @@
-nav {
- padding: .5rem;
- --tw-bg-opacity: 1;
- background-color: rgb(19 17 11 / var(--tw-bg-opacity));
+#site-nav {
+ padding: var(--size-2);
+ background-color: rgb(19 17 11);
font-weight: bold;
- --tw-text-opacity: 1;
- color: rgb(255 255 255 / var(--tw-text-opacity))
-
-}
-
-ul {
- display: flex;
- gap: 0.5rem;
- justify-content: center;
- align-items: center;
- padding: 0.75rem;
+ color: white;
}
-a {
- display: inline-flex;
+#site-nav ul {
+ gap: var(--size-2);
align-items: center;
- gap: 1rem;
- overflow-wrap: break-word;
- margin-left: 0.75rem
+ padding: var(--size-3);
}
diff --git a/src/layouts/Base/base.css b/src/layouts/Base/base.css
index cc8a7d4..7801c2f 100644
--- a/src/layouts/Base/base.css
+++ b/src/layouts/Base/base.css
@@ -53,5 +53,8 @@ iframe {
width: 100%;
height: auto;
max-height: 100%;
- aspect-ratio: 3 / 2;
+}
+
+a {
+ overflow-wrap: break-word;
}
From c958dabb861204ad84a0aaa0038c82f7490fdefd Mon Sep 17 00:00:00 2001
From: madcampos
Date: Sun, 7 Jul 2024 23:53:40 -0400
Subject: [PATCH 03/12] fix: update aspect ratio to reference open props
---
src/layouts/Base/base.css | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/layouts/Base/base.css b/src/layouts/Base/base.css
index 7801c2f..1d3abf6 100644
--- a/src/layouts/Base/base.css
+++ b/src/layouts/Base/base.css
@@ -53,6 +53,7 @@ iframe {
width: 100%;
height: auto;
max-height: 100%;
+ aspect-ratio: var(--ratio-landscape);
}
a {
From a974a15029f8616e6875acccd559fad0c5c3ce05 Mon Sep 17 00:00:00 2001
From: madcampos
Date: Sun, 7 Jul 2024 23:56:36 -0400
Subject: [PATCH 04/12] feat: implement styles for author card
---
src/components/AuthorCard/styles.css | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/components/AuthorCard/styles.css b/src/components/AuthorCard/styles.css
index 90244e8..d29f704 100644
--- a/src/components/AuthorCard/styles.css
+++ b/src/components/AuthorCard/styles.css
@@ -1,17 +1,21 @@
.author-card {
display: grid;
- padding-inline: var(--spacing-large);
+ padding-inline: var(--size-3);
grid-template-columns: 1fr auto;
grid-template-rows: 1fr auto;
- gap: var(--spacing-large);
+ gap: var(--size-3);
place-items: center;
grid-template-areas:
"avatar name"
"avatar bio";
- margin: var(--spacing-large) 0;
+ margin: var(--size-3) 0;
}
-.author-card .author-name * { margin: 0; }
+.author-card .author-name * {
+ margin: 0;
+ color: var(--tjs-red-6);
+ text-shadow: var(--size-1) var(--size-1) var(--gray-12);
+}
.author-card .author-picture {
grid-area: avatar;
From f0dfa24895c896320c543521be2866989a0ff090 Mon Sep 17 00:00:00 2001
From: madcampos
Date: Mon, 8 Jul 2024 00:56:38 -0400
Subject: [PATCH 05/12] feat: implement styles for post header
---
src/components/PostHeader/index.astro | 36 +++++++------
src/components/PostHeader/styles.css | 73 ++++++++++++++-------------
src/layouts/Base/variables.css | 3 ++
3 files changed, 62 insertions(+), 50 deletions(-)
diff --git a/src/components/PostHeader/index.astro b/src/components/PostHeader/index.astro
index 0ca0eef..a8c35ee 100644
--- a/src/components/PostHeader/index.astro
+++ b/src/components/PostHeader/index.astro
@@ -53,32 +53,36 @@ const formatter = new Intl.DateTimeFormat('en-US', { dateStyle: 'long', timeStyl
- {updatedAt && (
-
+ {updatedAt && (
+
+
Updated on
{hasUpdates && (
)}
-
- )}
-
+
+
+ )}
{readingTime && (
-
-
- {wordCount && (
- — {wordCount} words
- )}
-
+
+
+
+ {wordCount && (
+ — {wordCount} words
+ )}
+
+
)}
diff --git a/src/components/PostHeader/styles.css b/src/components/PostHeader/styles.css
index e9860aa..6da119d 100644
--- a/src/components/PostHeader/styles.css
+++ b/src/components/PostHeader/styles.css
@@ -8,23 +8,11 @@
justify-self: stretch;
display: grid;
place-items: end center;
- gap: var(--spacing-large);
+ gap: var(--size-3);
grid-template-rows: 1fr auto auto auto;
- grid-template-columns: 1fr 1fr;
+ grid-template-columns: 100%;
grid-template-areas:
- 'title hero-image'
- 'summary hero-image'
- 'metadata metadata'
- 'share share';
- padding: var(--spacing-large);
- margin: var(--spacing-large);
-}
-
-#post-header-wrapper:not(:has(#hero-image)) {
- grid-template-rows: 1fr auto auto auto;
- grid-template-columns: 1fr;
- grid-template-areas:
- 'title'
+ 'hero-title'
'summary'
'metadata'
'share';
@@ -32,7 +20,7 @@
#post-header h1 {
height: auto;
- font-size: clamp(2rem, 5vmax, 4rem);
+ font-size: var(--font-size-fluid-3);
font-weight: bold;
overflow-wrap: break-word;
@@ -53,13 +41,27 @@
padding: 0;
}
-#post-header #post-title { grid-area: title; }
+#post-header #post-title {
+ grid-area: hero-title;
+ z-index: 1;
+ place-self: end end;
+
+ background-color: white;
+ color: var(--tjs-red-6);
+ text-decoration-color: currentcolor;
+ padding: var(--size-3) var(--size-4);
+ border-start-start-radius: var(--radius-4);
+ border-end-start-radius: var(--radius-4);
+ border: var(--tjs-red-6) solid var(--size-2);
+ border-inline-end: none;
+ margin-block-end: var(--size-7);
+}
#post-header #hero-image {
width: 100%;
height: 100%;
object-fit: contain;
- grid-area: hero-image;
+ grid-area: hero-title;
overflow: hidden;
}
@@ -67,7 +69,8 @@
border: none;
font-size: smaller;
margin: 0;
- padding: var(--spacing-large);
+ padding: var(--size-1);
+ font-style: italic;
grid-area: summary;
}
@@ -76,17 +79,8 @@
}
#post-metadata {
- width: 100%;
grid-area: metadata;
text-align: center;
- display: flex;
- flex-flow: column wrap;
- justify-content: center;
- gap: var(--spacing-medium);
-}
-
-#post-metadata a {
- vertical-align: middle;
}
#post-share {
@@ -95,28 +89,28 @@
flex-wrap: wrap;
justify-content: center;
align-items: center;
- gap: var(--spacing-large);
+ gap: var(--size-3);
}
#post-share button {
display: flex;
align-items: center;
justify-content: center;
- width: var(--button-size);
- height: var(--button-size);
- padding: var(--spacing-medium);
+ height: var(--size-7);
+ padding: var(--size-1) var(--size-2);
}
#post-share button svg {
- width: 100%;
height: 100%;
+ aspect-ratio: var(--ratio-square);
pointer-events: none;
}
+
@media (max-width: 650px) {
#post-header-wrapper {
grid-template-rows: 1fr auto auto auto auto;
- grid-template-columns: 1fr;
+ grid-template-columns: 100%;
grid-template-areas:
'hero-image'
'title'
@@ -124,4 +118,15 @@
'metadata'
'share';
}
+
+ #post-header #post-title {
+ grid-area: title;
+ margin-block: calc(var(--size-3) * -1) 0;
+ border-inline: none;
+ border-radius: 0;
+ }
+
+ #post-header #hero-image {
+ grid-area: hero-image;
+ }
}
diff --git a/src/layouts/Base/variables.css b/src/layouts/Base/variables.css
index a005776..f2c58b4 100644
--- a/src/layouts/Base/variables.css
+++ b/src/layouts/Base/variables.css
@@ -2,6 +2,9 @@
/* Base size */
--body-text: 20px;
+ /* Max width for part of the page to grow */
+ --max-width: 1024px;
+
/* Theme colors */
--tjs-red-0: #fec2b8;
--tjs-red-1: #ffad9e;
From 2ddae6d33a164012a6557ca2bdc57ddf6bbc24a5 Mon Sep 17 00:00:00 2001
From: madcampos
Date: Mon, 8 Jul 2024 01:13:42 -0400
Subject: [PATCH 06/12] feat: add style for posts without images
---
src/components/PostHeader/styles.css | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/components/PostHeader/styles.css b/src/components/PostHeader/styles.css
index 6da119d..a52d053 100644
--- a/src/components/PostHeader/styles.css
+++ b/src/components/PostHeader/styles.css
@@ -2,6 +2,7 @@
width: 100%;
max-width: var(--max-width);
margin-inline: auto;
+ margin-block-end: var(--size-8);
}
#post-header-wrapper {
@@ -57,6 +58,13 @@
margin-block-end: var(--size-7);
}
+#post-header-wrapper:not(:has(#hero-image)) #post-title {
+ margin-block: 0;
+ border-inline: none;
+ border-radius: 0;
+ width: 100%;
+}
+
#post-header #hero-image {
width: 100%;
height: 100%;
From 7380e38a63ce5ab3bddb3055846e28db5ed618fb Mon Sep 17 00:00:00 2001
From: madcampos
Date: Mon, 8 Jul 2024 01:13:53 -0400
Subject: [PATCH 07/12] feat: add styles for refresh banner
---
src/components/RefreshBanner/index.astro | 9 ++---
src/components/RefreshBanner/script.ts | 42 ++++++++++++++++++++----
src/components/RefreshBanner/styles.css | 21 ++++++------
3 files changed, 52 insertions(+), 20 deletions(-)
diff --git a/src/components/RefreshBanner/index.astro b/src/components/RefreshBanner/index.astro
index d55a2fc..9ab1bde 100644
--- a/src/components/RefreshBanner/index.astro
+++ b/src/components/RefreshBanner/index.astro
@@ -9,14 +9,15 @@ import './styles.css';
id="pwa-toast"
role="alert"
aria-labelledby="toast-message"
+ aria-live="polite"
>
-