Skip to content

feat: callout support and default theme improvements#14

Open
rsbh wants to merge 4 commits intomainfrom
fix_callout_design
Open

feat: callout support and default theme improvements#14
rsbh wants to merge 4 commits intomainfrom
fix_callout_design

Conversation

@rsbh
Copy link
Member

@rsbh rsbh commented Mar 5, 2026

Summary

  • Add remark-directive + remarkDirectiveAdmonition for :::note/:::warning/:::caution callout syntax mapped to Apsara Callout components
  • Plain blockquotes render as grey outlined callouts
  • Add per-theme font support with Inter for default theme
  • Add content typography and layout styles for default theme
  • Fix invalid CSS font vars (--rs-font-size-2--rs-font-size-small, --rs-font-family-mono--rs-font-mono)
  • Add md glob support and register Tabs MDX component

Test plan

  • Verify :::warning / :::note / :::caution render as styled Apsara Callouts
  • Verify plain > blockquotes render as grey callouts
  • Verify code blocks have correct font-family and font-size
  • Verify default theme typography and layout styles

🤖 Generated with Claude Code

rsbh and others added 4 commits March 3, 2026 11:00
Add heading margins, list padding, table overflow handling,
TOC nav margin, and max-width constraint to article.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add className to Theme interface, export Inter font from default
theme, and apply it in page and API layouts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add **/*.md to source config files glob and register Apsara Tabs
in mdxComponents for use in documentation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add remark-directive and remarkDirectiveAdmonition plugins to transform
:::note/:::warning/:::caution syntax into Apsara Callout components.
Plain blockquotes render as grey callouts. Fix invalid CSS font vars
in code blocks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Mar 5, 2026

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added support for callout/admonition directives in MDX documentation
    • Introduced Tabs component for MDX content
    • Enhanced blockquote rendering in documentation
  • Style

    • Applied Inter font globally for improved typography
    • Refined article layout with constrained width and improved spacing for headings, lists, and tables
    • Updated code block styling tokens
    • Adjusted callout component styling and table responsiveness
  • Dependencies

    • Added remark-directive plugin for enhanced MDX support

Walkthrough

The PR introduces styling enhancements and MDX plugin configuration to the Chronicle documentation framework. Changes include adding remark-directive support for blockquote/admonition processing, font configuration with Inter, extending the theme system to support className properties, refactoring the Callout component into a wrapper hierarchy, updating CSS styling for article layout and typography, and integrating these changes across layout components and MDX component mappings.

Changes

Cohort / File(s) Summary
Theme & Font Configuration
packages/chronicle/src/types/theme.ts, packages/chronicle/src/themes/default/index.ts, packages/chronicle/src/themes/default/font.ts
Added optional className property to Theme interface, introduced Inter font configuration export, and integrated className into defaultTheme export.
MDX Setup & Remark Plugins
packages/chronicle/source.config.ts, packages/chronicle/package.json
Added remark-directive ^4.0.0 dependency and configured MDX with defineConfig including remarkDirective and remarkDirectiveAdmonition plugins mapped to Callout components with alert/accent styles. Extended file matching to include both MDX and MD files.
Callout Components
packages/chronicle/src/components/common/callout.tsx, packages/chronicle/src/components/common/callout.module.css
Replaced bare Callout re-export with new composition layer: CalloutContainer, CalloutTitle, CalloutDescription, and MdxBlockquote wrapper components. Added corresponding CSS module styling with vertical margins.
MDX Component Updates
packages/chronicle/src/components/mdx/index.tsx
Updated mdxComponents mapping to use new Callout wrappers, added blockquote handler via MdxBlockquote, and introduced Tabs component from @raystack/apsara.
Styling & Typography
packages/chronicle/src/themes/default/Page.module.css, packages/chronicle/src/themes/default/Toc.module.css, packages/chronicle/src/components/mdx/code.module.css
Added article max-width constraint, heading/list/table styling in page content, updated code font tokens (--rs-font-mono, --rs-font-size-small), and added Toc nav margin-bottom spacing.
Layout Integration
packages/chronicle/src/app/[[...slug]]/page.tsx, packages/chronicle/src/app/apis/[[...slug]]/layout.tsx
Modified page and layout components to extract and apply theme className: updated getTheme return type to include className and passed it to Layout via classNames prop and cx utility composition.
.gitignore Updates
.gitignore
Added ignore rule for examples/frontier directory.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • feat: add paper theme #12: Introduces complementary theme registry and theming hook changes affecting getTheme usage and layout component theming.

Suggested reviewers

  • rohilsurana
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: adding callout support and improving the default theme styling.
Description check ✅ Passed The description clearly details the changes made, including remark-directive integration, blockquote rendering, font support, CSS fixes, and test plan items.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix_callout_design

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
.gitignore (1)

136-136: Remove duplicated dist ignore entry.

dist is already ignored at Line 96, so this duplicate entry can be dropped to keep the file clean.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.gitignore at line 136, Remove the duplicate "dist" entry from .gitignore
(the later occurrence) so only the existing "dist" ignore remains (the earlier
entry already present), i.e., delete the redundant "dist" line to keep the file
clean.
packages/chronicle/src/components/common/callout.tsx (1)

7-9: Consider prop spread order for className preservation.

Currently {...props} comes after className={styles.callout}, which means a caller-provided className would completely replace the module styles rather than being merged. If the intent is to allow customization while preserving base styles, consider using cx to merge classNames:

♻️ Optional: Merge classNames instead of replacing
+import { cx } from 'class-variance-authority'
+
-function CalloutContainer(props: React.ComponentProps<typeof Callout>) {
-  return <Callout outline width="100%" className={styles.callout} {...props} />
+function CalloutContainer({ className, ...props }: React.ComponentProps<typeof Callout>) {
+  return <Callout outline width="100%" className={cx(styles.callout, className)} {...props} />
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/chronicle/src/components/common/callout.tsx` around lines 7 - 9, The
CalloutContainer currently lets caller className overwrite module styles because
{...props} comes after className={styles.callout}; change it to merge class
names instead: compute a combined className using cx(styles.callout,
props.className) (or import a classnames/clsx util) and pass
className={combined} while still spreading the rest of props to Callout (ensure
you reference CalloutContainer, Callout, styles.callout and props.className when
making the change).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.gitignore:
- Line 136: Remove the duplicate "dist" entry from .gitignore (the later
occurrence) so only the existing "dist" ignore remains (the earlier entry
already present), i.e., delete the redundant "dist" line to keep the file clean.

In `@packages/chronicle/src/components/common/callout.tsx`:
- Around line 7-9: The CalloutContainer currently lets caller className
overwrite module styles because {...props} comes after
className={styles.callout}; change it to merge class names instead: compute a
combined className using cx(styles.callout, props.className) (or import a
classnames/clsx util) and pass className={combined} while still spreading the
rest of props to Callout (ensure you reference CalloutContainer, Callout,
styles.callout and props.className when making the change).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d949fa83-7c83-468e-80ca-cf4c375d4454

📥 Commits

Reviewing files that changed from the base of the PR and between 551881e and 8948f9b.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (14)
  • .gitignore
  • packages/chronicle/package.json
  • packages/chronicle/source.config.ts
  • packages/chronicle/src/app/[[...slug]]/page.tsx
  • packages/chronicle/src/app/apis/[[...slug]]/layout.tsx
  • packages/chronicle/src/components/common/callout.module.css
  • packages/chronicle/src/components/common/callout.tsx
  • packages/chronicle/src/components/mdx/code.module.css
  • packages/chronicle/src/components/mdx/index.tsx
  • packages/chronicle/src/themes/default/Page.module.css
  • packages/chronicle/src/themes/default/Toc.module.css
  • packages/chronicle/src/themes/default/font.ts
  • packages/chronicle/src/themes/default/index.ts
  • packages/chronicle/src/types/theme.ts

@rsbh rsbh requested a review from rohilsurana March 5, 2026 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant