1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-03 17:46:39 -04:00

fresh <PageTitle> look

This commit is contained in:
2025-03-08 13:09:29 -05:00
parent 5cfa86f690
commit 2d6fc82f71
29 changed files with 346 additions and 401 deletions

View File

@ -1,12 +0,0 @@
.content {
font-size: 0.9em;
line-height: 1.7;
color: var(--colors-text);
}
@media (max-width: 768px) {
.content {
font-size: 0.925em;
line-height: 1.85;
}
}

View File

@ -1,10 +0,0 @@
import clsx from "clsx";
import type { ComponentPropsWithoutRef } from "react";
import styles from "./Content.module.css";
const Content = ({ className, ...rest }: ComponentPropsWithoutRef<"div">) => (
<div className={clsx(styles.content, className)} {...rest} />
);
export default Content;

View File

@ -1,2 +0,0 @@
export * from "./Content";
export { default } from "./Content";

View File

@ -1,17 +1,21 @@
.title {
margin-top: 0;
margin-bottom: 0.6em;
font-size: 1.7em;
font-size: 1.9em;
font-weight: 600;
text-align: center;
text-transform: lowercase;
letter-spacing: 0.02em;
}
.link {
color: var(--colors-text) !important;
.slug::before {
content: "\002E\002F"; /* "./" */
letter-spacing: 0.1em;
color: var(--colors-mediumLight) !important;
margin-right: -0.1em;
}
@media (max-width: 768px) {
.title {
font-size: 1.8em;
font-size: 2em;
}
}

View File

@ -1,6 +1,3 @@
"use client";
import { usePathname } from "next/navigation";
import clsx from "clsx";
import Link from "../Link";
import type { ComponentPropsWithoutRef } from "react";
@ -8,14 +5,14 @@ import type { Route } from "next";
import styles from "./PageTitle.module.css";
export type PageTitleProps = ComponentPropsWithoutRef<"h1">;
const PageTitle = ({ className, children, ...rest }: PageTitleProps) => {
const pathname = usePathname() || "";
export type PageTitleProps = ComponentPropsWithoutRef<"h1"> & {
canonical: string;
};
const PageTitle = ({ canonical, className, children, ...rest }: PageTitleProps) => {
return (
<h1 className={clsx(styles.title, className)} {...rest}>
<Link href={pathname as Route} plain className={styles.link}>
<Link href={canonical as Route} plain className={styles.slug}>
{children}
</Link>
</h1>

View File

@ -1,3 +1,3 @@
.wrapper :global(lite-youtube) {
.wrapper lite-youtube {
margin: 0 auto;
}