mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 11:29:33 +08:00
refactor: improve semantic by replacing decorative hr with borders (#597)
Replace decorative usage of Hr component with borders to improve semantic. - remove Hr component - replace decorative hr elements with borders - introduce app-layout utility class - update layout and spacing - update docs about border css custom property
This commit is contained in:
+1
-1
@@ -11,7 +11,7 @@ import { SITE } from "@/config";
|
||||
|
||||
<main
|
||||
id="main-content"
|
||||
class="mx-auto flex max-w-app flex-1 items-center justify-center"
|
||||
class="app-layout flex flex-1 items-center justify-center"
|
||||
>
|
||||
<div class="mb-14 flex flex-col items-center justify-center">
|
||||
<h1 class="text-9xl font-bold text-accent">404</h1>
|
||||
|
||||
+17
-17
@@ -6,7 +6,6 @@ import Footer from "@/components/Footer.astro";
|
||||
import Socials from "@/components/Socials.astro";
|
||||
import LinkButton from "@/components/LinkButton.astro";
|
||||
import Card from "@/components/Card.astro";
|
||||
import Hr from "@/components/Hr.astro";
|
||||
import getSortedPosts from "@/utils/getSortedPosts";
|
||||
import IconRss from "@/assets/icons/IconRss.svg";
|
||||
import IconArrowRight from "@/assets/icons/IconArrowRight.svg";
|
||||
@@ -22,8 +21,8 @@ const recentPosts = sortedPosts.filter(({ data }) => !data.featured);
|
||||
|
||||
<Layout>
|
||||
<Header />
|
||||
<main id="main-content" data-layout="index">
|
||||
<section id="hero" class="pt-8 pb-6">
|
||||
<main id="main-content" data-layout="index" class="app-layout">
|
||||
<section id="hero" class:list={["pt-8 pb-6", "border-b border-border"]}>
|
||||
<h1 class="my-4 inline-block text-4xl font-bold sm:my-8 sm:text-5xl">
|
||||
Mingalaba
|
||||
</h1>
|
||||
@@ -60,7 +59,7 @@ const recentPosts = sortedPosts.filter(({ data }) => !data.featured);
|
||||
{
|
||||
// only display if at least one social link is enabled
|
||||
SOCIALS.length > 0 && (
|
||||
<div class="mt-4 flex flex-col sm:flex-row sm:items-center">
|
||||
<div class="mt-4 flex max-sm:flex-col sm:items-center">
|
||||
<div class="me-2 mb-1 whitespace-nowrap sm:mb-0">Social Links:</div>
|
||||
<Socials />
|
||||
</div>
|
||||
@@ -68,21 +67,22 @@ const recentPosts = sortedPosts.filter(({ data }) => !data.featured);
|
||||
}
|
||||
</section>
|
||||
|
||||
<Hr />
|
||||
|
||||
{
|
||||
featuredPosts.length > 0 && (
|
||||
<>
|
||||
<section id="featured" class="pt-12 pb-6">
|
||||
<h2 class="text-2xl font-semibold tracking-wide">Featured</h2>
|
||||
<ul>
|
||||
{featuredPosts.map(data => (
|
||||
<Card variant="h3" {...data} />
|
||||
))}
|
||||
</ul>
|
||||
</section>
|
||||
{recentPosts.length > 0 && <Hr />}
|
||||
</>
|
||||
<section
|
||||
id="featured"
|
||||
class:list={[
|
||||
"pt-12 pb-6",
|
||||
{ "border-b border-border": recentPosts.length > 0 },
|
||||
]}
|
||||
>
|
||||
<h2 class="text-2xl font-semibold tracking-wide">Featured</h2>
|
||||
<ul>
|
||||
{featuredPosts.map(data => (
|
||||
<Card variant="h3" {...data} />
|
||||
))}
|
||||
</ul>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user