Styling
Prose UI styles MDX content using CSS classes and variables defined in the prose-ui.css file.
To customize Prose UI styles, identify the CSS variable responsible for the style you want to modify. You can do this by inspecting the CSS in your browser or reviewing the variables defined in the prose-ui.css file.
Styling is organized around a design system, with its CSS variables (design tokens) grouped into three categories:
- Core variables
- Color variables for light and dark modes
- Component-specific variables
Opt out of Prose styles
If you need certain elements inside a .prose-ui container to keep their own styles, add the not-prose class. Prose UI will skip those elements and their children.
Core Variables
Core variables are reused in component-specific variables to ensure a consistent look and feel. For example, you can override the fonts to make Prose UI use Vercel's Geist font family:
Other core variables include spacing, font sizes, and border radius:
Color Variables
Color variables are divided into light and dark mode categories. Prose UI uses OKLCH color values for most colors. Here's how you can override colors for both modes:
Component Variables
Component variables are specific to individual components. For example, you can override the styles for the callout component:
Or customize code blocks: