@pressmark/astro
v0.2.2
Published
Astro components and layouts for the Pressmark editorial design system.
Maintainers
Readme
@pressmark/astro
Astro components and layouts that render the @pressmark/theme classes. Drop them into any Astro v5+ project.
Install
npm install @pressmark/astro @pressmark/theme tailwindcss@pressmark/theme is declared as a peer dependency: install it alongside this package. (The theme is published separately so non-Astro consumers can use it standalone — see @pressmark/theme.)
In your Tailwind v4 entry CSS, import the theme and tell Tailwind to scan this package's components so the .badge, .card, .nav-item, .panel-label, .section-label, and .prose-pressmark utilities get emitted:
@import "tailwindcss";
@import "@pressmark/theme";
@source "../../node_modules/@pressmark/astro/src/**/*.astro";(Adjust the relative path to match where your entry CSS lives. From apps/<project>/src/styles/main.css, two levels up reaches node_modules/.)
Use
---
import { BaseLayout, Sidebar, Button, Card } from "@pressmark/astro";
const items = [
{ href: "/", label: "Home" },
{ href: "/notes", label: "Notes" },
{ href: "/about", label: "About" },
];
---
<BaseLayout title="Hello">
<Sidebar slot="sidebar" brand="/yourname." items={items} currentPath={Astro.url.pathname} />
<main class="ml-[260px] px-12 py-10">
<Card>
<h2>A note</h2>
<Button variant="primary">Read</Button>
</Card>
</main>
</BaseLayout>Components
Button—variant?: "primary" | "secondary" | "link",as?: "button" | "a",href?. Compose withclass="btn-sm"for a 32 px height variant.Badge—variant?: "default" | "mono"Card— slotted surfaceNavItem—href,active?,iconslot + default slotPanelLabel— tiny mono captionSectionLabel— accent display headingHairline— single-pixel dividerProse— long-form article wrapper,dropcap?: booleanCheckbox— styled checkbox inputProgress—value: number(0–100)
Layouts
BaseLayout—<html>shell with font links and two named slots:sidebarand the default slot for main content. No baked-in chrome.Sidebar— Editorial-style fixed left sidebar. Takesitems: SidebarItem[], optionalbrand, and a default slot for extras (search, theme toggle, image, quote, etc.).SidebarItemshape:{ href, label, icon? }, whereiconis raw SVG inner content (paths/rects/circles).
Content collections
// src/content/config.ts
import { defineCollection } from "astro:content";
import { postSchema } from "@pressmark/astro/content/schema";
export const collections = {
posts: defineCollection({ type: "content", schema: postSchema }),
};License
MIT
