Overview
ThePill component is a simple badge or tag component that displays content in a rounded, colored container. It’s used on the homepage to showcase roles and skills in an visually appealing way.
Props
The Pill component accepts no props—it uses the slot pattern to display its children.Usage
Basic Pill
Pill with Icon
Real-World Example
Homepage Roles Section
Fromsrc/pages/index.astro:71-75:
Styling
The Pill component includes the following built-in styles:- Display: Flexbox for easy icon + text alignment
- Padding: 0.5rem vertical, 1rem horizontal
- Border: 1px solid with accent color
- Background: Uses
--accent-regularCSS variable - Border Radius: 999rem for fully rounded edges
- Font Size:
var(--text-md) - Color:
--accent-text-over(white/high-contrast) - White Space:
nowrapto prevent wrapping
CSS Variables Used
The Pill component relies on these theme variables:--accent-regular- Background and border color--accent-text-over- Text color (high contrast on accent)--text-md- Font size
Responsive Behavior
On mobile (< 50em), the roles section containing Pills is hidden by default. Pills only display on tablet and desktop viewports. Fromsrc/pages/index.astro:176-181:
Use Cases
The Pill component is perfect for:- Role or skill badges
- Technology tags
- Status indicators
- Category labels
- Quick visual identifiers
The Pill component uses theme CSS variables, so it automatically adapts to light/dark mode changes.