radix-typography

Generate metric-aware typography CSS for Radix UI themes in Vite projects.

20|Updated Mar 26, 2024
One-click install
npx skills add https://github.com/KyleAMathews/vite-plugin-capsize-radix-ui --skill radix-typography
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: radix-typography
Source: https://github.com/KyleAMathews/vite-plugin-capsize-radix-ui/tree/main
Command: npx skills add https://github.com/KyleAMathews/vite-plugin-capsize-radix-ui --skill radix-typography

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates the creation of pixel-perfect typography CSS for Radix UI themes by integrating Capsize with vite-plugin-capsize-radix. It eliminates manual CSS tuning and ensures consistent font rendering and spacing across components.

Core Features & Use Cases

  • Generate metric-aware font stacks for body, headings, and code with deterministic fallbacks.
  • Override Radix's typography variables to achieve pixel-perfect alignment and predictable layouts.
  • Support responsive font sizes and line heights for mobile and desktop views across a Radix UI app.
  • Use Case: Build a design system with Radix UI components where typography scales cleanly from small screens to large displays.

Quick Start

  • Install and configure the plugin in a Vite project.
  • Define fonts and metrics in the plugin options and outputPath for generated CSS.
  • Import the generated CSS after Radix base styles in your app.

Frequently Asked Questions about radix-typography

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate pixel-perfect typography CSS for Radix UI themes?▼

To generate pixel-perfect typography CSS for Radix UI, use the vite-plugin-capsize-radix in a Vite project to integrate Capsize metrics, overriding Radix typography variables for deterministic font rendering and spacing.

Why does my font rendering look inconsistent across different browsers in Radix UI?▼

Inconsistent font rendering in Radix UI often stems from unmanaged font metrics. Applying Capsize metrics generates metric-aware font stacks with deterministic fallbacks, ensuring predictable vertical alignment and spacing across components.

How do I configure responsive font sizes and line heights with Vite and Radix UI?▼

Configure responsive font sizes and line heights by defining your fonts and metrics in the vite-plugin-capsize-radix options within your Vite project, specifying an outputPath to generate the responsive CSS automatically.

Do I need a Node.js environment to use Capsize metrics with Radix UI variables?▼

Yes, you need a Node.js environment with a Vite project to execute the generation. You must install dependencies like @capsizecss/core, @capsizecss/metrics, and mustache to produce the CSS output.

How do I override Radix theme typography variables with Capsize?▼

You override Radix theme typography variables by configuring the vite-plugin-capsize-radix to process Capsize metrics, then importing the generated CSS file after your Radix base styles in your React app.

What's the best way to build a design system with deterministic font stacks in React?▼

Using vite-plugin-capsize-radix in a Vite project is the best way to build deterministic font stacks for body, headings, and code, eliminating manual CSS tuning and ensuring consistent layout scaling.