Typography typographyeditorialparagraph
Drop Cap Paragraph
Editorial-style paragraph with a large, stylized first letter.
Preview
Drop Cap Paragraph
Usage
Copy the full block below to use this component with its imports.
astro
---
import { DropCapParagraph } from 'astro-component-kit';
---
<DropCapParagraph>Content</DropCapParagraph> ---
import { DropCapParagraph } from 'astro-component-kit';
---
<DropCapParagraph>Content</DropCapParagraph> Manual Installation
If you are not using the npm package, create a new file src/components/lib/DropCapParagraph.astro and paste the following code:
astro
---
---
<p class="drop-p"><slot /></p>
<style>
.drop-p { color: #94a3b8; line-height: 1.8; font-size: 1.1rem; }
.drop-p::first-letter { float: left; font-size: 4rem; font-weight: 900; line-height: 0.8; margin-right: 0.5rem; margin-top: 0.5rem; color: #fff; background: linear-gradient(135deg, #6366f1, #c084fc); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
</style> ---
---
<p class="drop-p"><slot /></p>
<style>
.drop-p { color: #94a3b8; line-height: 1.8; font-size: 1.1rem; }
.drop-p::first-letter { float: left; font-size: 4rem; font-weight: 900; line-height: 0.8; margin-right: 0.5rem; margin-top: 0.5rem; color: #fff; background: linear-gradient(135deg, #6366f1, #c084fc); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
</style>
Quick Info
- Category
- Typography
- Filename
DropCapParagraph.astro- Dependencies
- None — pure Astro + CSS
- Tags
- typographyeditorialparagraph