Setup
Import the formatting styles in your app:Typography
Headings
All heading levels are styled with responsive sizing and consistent spacing:- H1:
text-4xl sm:text-5xl font-extrabold - H2:
text-3xl sm:text-4xl font-bold - H3:
text-2xl sm:text-3xl font-semibold - H4:
text-xl sm:text-2xl font-semibold - H5-H6:
text-lg sm:text-xl font-semibold - All headings include
scroll-mt-36for anchor link offset
Headings automatically scale between mobile and desktop breakpoints for optimal readability.
Paragraphs
Body text uses the secondary text color for comfortable reading:- Color:
text-lum-text-secondary(gray-400 by default) - Standard line height for readability
Links
Links are styled with hover effects:- Default:
text-blue-400with no underline - Hover:
text-blue-500with underline
Lists
Unordered Lists
- Disc bullets
- Left margin and padding
- Secondary text color
Ordered Lists
- Decimal numbering
- Same spacing as unordered lists
Code
Inline Code
Use backticks for inline code:- Background:
bg-lum-card-bg(matches card background) - Border: Bottom border with subtle color
- Padding:
py-0.5 px-1 - Rounded corners:
rounded-lum - Text selection:
select-allfor easy copying - Word break: Responsive breaking on mobile
Code Blocks
Fenced code blocks with syntax highlighting:- Uses
.lum-cardstyling - Overflow scrolling for long lines
- No border on internal
<code>elements - Preserves syntax highlighting from Shiki or similar
Code blocks automatically use the
lum-card style for consistent appearance with other UI elements.Blockquotes
Blockquotes are styled as cards with a colored left border:- Uses
.lum-cardbase styling - Blue left border:
border-l-6 border-l-blue-400 - Removes extra margin from first/last paragraphs
- Vertical margin:
my-4
Tables
Tables are formatted with consistent padding:- Cell padding:
p-2 - Vertical alignment: Top
- No padding on first/last cells for edge alignment
- Margin:
my-5
Horizontal Rules
Create visual breaks with horizontal rules:- Subtle border:
border-t-1 border-t-lum-border/20 - Generous margin:
my-8
Images
Images automatically receive rounded corners:- Rounded corners:
rounded-lum - Overflow hidden for clean edges
Complete Example
Here’s how all formatting styles work together:Configuration
Add the import to your main file:Note: Make sure to import the formatting styles after your base styles.
Features
Luminescent UI includes:- Modern component library
- Responsive design utilities
- Dark theme optimized
- Full TypeScript support
© 2024 Luminescent UI
Scope to Specific Containers
Apply formatting only to specific containers:Accessibility
Heading Hierarchy
Always use proper heading hierarchy:Skipping heading levels (e.g., H1 to H3) can confuse screen readers and hurt SEO.
Link Text
Use descriptive link text:Code Language
Specify language for syntax highlighting and accessibility:Best Practices
Consistent Hierarchy
Use headings in order (H1 → H2 → H3) without skipping levels.
Code Highlighting
Always specify language in code blocks for better readability.
Alt Text
Provide descriptive alt text for all images.
Link Context
Make link text descriptive of the destination.
Framework Integration
React
Qwik
MDX
Style Reference
Complete CSS class reference for all formatted elements:| Element | Classes Applied |
|---|---|
<a> | text-blue-400 no-underline hover:text-blue-500 hover:underline |
<blockquote> | lum-card border-l-6 border-l-blue-400 my-4 |
<h1> | text-4xl sm:text-5xl font-extrabold relative scroll-mt-36 |
<h2> | text-3xl sm:text-4xl font-bold relative scroll-mt-36 |
<h3> | text-2xl sm:text-3xl font-semibold relative scroll-mt-36 |
<h4> | text-xl sm:text-2xl font-semibold relative scroll-mt-36 |
<h5>, <h6> | text-lg sm:text-xl font-semibold relative scroll-mt-36 |
<p> | text-lum-text-secondary |
<ul>, <ol> | my-4 ml-10 text-lum-text-secondary list-disc |
<ol> | Additional: list-decimal |
<li> | my-1 pl-2 |
<pre> | overflow-auto p-4 lum-card my-2 |
<code> | bg-lum-card-bg py-0.5 px-1 rounded-lum select-all border-b-2 border-b-lum-border/20 |
<table> | my-5 |
<th>, <td> | p-2 align-top |
<img> | rounded-lum overflow-hidden |
<hr> | my-8 border-t-1 border-t-lum-border/20 |