Conversation
Adds examples/astro/ demonstrating two approaches for using @r4ai/remark-callout in an Astro + MDX project: - /custom-components: callouts rendered via custom React components (CalloutRoot / CalloutTitle / CalloutBody) with Tailwind CSS styling and foldable <details>/<summary> support - /css: callouts rendered as plain custom HTML elements (callout-root / callout-title / callout-body) styled with pure CSS custom properties — zero JS runtime required Tech stack: Astro v5, @astrojs/mdx, @astrojs/react, Tailwind CSS v4
|
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
- Add @custom-variant dark to global.css for class-based dark mode - Add ThemeToggle.astro: sun/moon button that toggles .dark on <html> and persists preference to localStorage - Add anti-FOUC inline script in BaseLayout <head> to apply the saved theme before first paint - Add sticky header with nav links and ThemeToggle to BaseLayout - Rewrite index.astro with Tailwind dark: classes (remove all inline styles) - Remove duplicate global.css imports from MDX pages (now in BaseLayout) - Add callout.css dark mode overrides: lighter per-type colors (e.g. blue-400 instead of blue-500) and slightly higher opacity for legibility on dark backgrounds - Add playwright.config.ts and @playwright/test for upcoming E2E tests
There was a problem hiding this comment.
Pull request overview
Adds a new examples/astro/ workspace project to demonstrate integrating @r4ai/remark-callout with Astro + MDX, including both React-component rendering and a CSS-only styling approach.
Changes:
- Introduces an Astro + MDX example with two routes: custom React component mapping and CSS-only styling.
- Adds Tailwind v4 styling, theme toggle (dark mode), and comprehensive callout CSS for all supported callout types.
- Adds example project configuration (Astro config, TS config, Playwright config, workspace deps) and updates
bun.lock.
Reviewed changes
Copilot reviewed 14 out of 16 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| examples/astro/tsconfig.json | Astro strict TS config with @/* path alias. |
| examples/astro/src/styles/global.css | Tailwind v4 base setup + dark variant + base element resets. |
| examples/astro/src/styles/callout.css | CSS-only callout styling using custom element selectors and per-type theming. |
| examples/astro/src/pages/index.astro | Landing page linking to the two example approaches. |
| examples/astro/src/pages/custom-components.mdx | MDX page mapping callout-* elements to React components. |
| examples/astro/src/pages/css.mdx | MDX page demonstrating styling callout-* elements via CSS only. |
| examples/astro/src/layouts/BaseLayout.astro | Shared layout shell with nav + anti-FOUC theme init. |
| examples/astro/src/env.d.ts | Astro type reference for generated .astro types. |
| examples/astro/src/components/ThemeToggle.astro | Client-side theme toggle button + icon swapping. |
| examples/astro/src/components/Callout.tsx | React callout components that render foldable callouts with <details>/<summary>. |
| examples/astro/playwright.config.ts | Playwright configuration for the example workspace. |
| examples/astro/package.json | Example workspace package definition + dependencies/scripts. |
| examples/astro/astro.config.ts | Astro integrations + Tailwind Vite plugin + remarkCallout custom element output. |
| examples/astro/README.md | Documentation explaining both approaches and setup steps. |
| examples/astro/.gitignore | Example-specific ignores (dist, .astro, node_modules, env files, etc.). |
| bun.lock | Workspace lockfile updates to include the new example package and dependencies. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Update nested biome.json configs to use 'extends: //' syntax - Add check/check:write scripts to root package.json - Remove check scripts from individual packages - Remove Prettier from website package (use Biome for all formatting) - Remove check tasks from turbo.json (now run directly from root) - Update lefthook.yml to run Biome from root for all packages Following Biome v2 monorepo best practices with centralized execution to reduce management overhead. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Apply Biome formatting to all TypeScript, JavaScript, JSON, and other supported files across the monorepo using the consolidated root-level Biome configuration. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
Adds
examples/astro/— a new Astro + MDX example project demonstrating two approaches for using@r4ai/remark-callout.Pages
//custom-components/cssApproach 1 — Custom Components (
/custom-components)remark-calloutto emit custom element names (callout-root,callout-title,callout-body)export const components = {...}@radix-ui/react-iconsfor per-type icons<details>/<summary>inside the React componentApproach 2 — CSS Only (
/css)remark-calloutsrc/styles/callout.cssusing element selectors (callout-root[type="note"]etc.)--callout-color) for per-type themingTech Stack
@astrojs/mdxv5 (latest)@astrojs/reactv5 (latest)bunChecklist
astro buildpasses with 0 errorsastro checkpasses with 0 errors / warnings