Add Stylescape preview template with design token showcase - #426
Conversation
|
Warning Review limit reached
More reviews will be available in 14 minutes and 56 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
PR Summary by QodoAdd Stylescape preview template and load Google Fonts in preview iframes Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
Context used✅ Compliance rules (platform):
6 rules 1. Stale font links persist
|
- Fix Google Fonts not loading inside the preview iframe: added getGoogleFonts / injectFontsIntoDoc helpers that extract non-system font names from --sf-font-body / --sf-font-heading / --sf-font-mono overrides and inject <link> elements into each iframe's document head. buildIframeHTML also includes these links for the "open in new tab" path. - Add Stylescape preview template: a comprehensive moodboard / design-system showcase covering color palettes (primary, action, neutral ramps + status colors), full typography specimen (display → body → code), border-radius and shadow scales, button variants, component cards, and the spacing scale. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011YqdgAPDSqjdQXGGLCTWjC
0bd6887 to
18f2b9b
Compare
Summary
Adds a new "Stylescape" preview template to the configurator that displays a comprehensive visual showcase of the design system's tokens, including colors, typography, spacing, borders, shadows, and component examples.
Changes
stylescapeto thePreviewTemplatetype intypes.tsPreviewPanel.svelteextractFontName()to parse font family values and filter out system fontsgetGoogleFonts()to extract custom font names from design token overridesinjectFontsIntoDoc()to dynamically inject Google Fonts stylesheets into preview iframesSTYLESCAPE_BODYHTML template showcasing:Implementation Details
The Google Fonts helpers maintain a set of system font names to avoid attempting to load built-in fonts from Google's CDN. Font names are extracted from three key design tokens (
--sf-font-body,--sf-font-heading,--sf-font-mono), deduplicated, and injected as stylesheet links with stable IDs to prevent duplicates. Font injection occurs both during initial iframe setup and whenever CSS overrides are updated, ensuring fonts remain available as design tokens change.The Stylescape template uses inline styles with CSS custom properties throughout, making it fully responsive to token changes in real-time.
https://claude.ai/code/session_011YqdgAPDSqjdQXGGLCTWjC