Style Guide
To maintain consistency and quality across the codebase, please adhere to the following style guidelines.
Code Conventions
Section titled “Code Conventions”File Standards
Section titled “File Standards”- Documentation: Always use
.mdxfor documentation pages. - Components: Use
.astrofor components. - Config: Use
.mjsor.tsfor configuration files. - Scripts: Use
.tsfor utility scripts.
Naming
Section titled “Naming”- Files & Directories: Use
kebab-case(e.g.,getting-started/,workflow.mdx). - Components: Use
PascalCase(e.g.,Card.astro,Sitemap.astro). - Variables: Use
camelCasefor variables and functions. - Constants: Use
UPPER_SNAKE_CASEfor global constants.
TypeScript Usage
Section titled “TypeScript Usage”This project uses TypeScript in Strict Mode.
- Props: Every component should have a defined
interface Props. - Type Imports: Use
import type { ... }when importing types.
Import Order
Section titled “Import Order”Organize imports in the following groups, separated by a blank line:
-
Framework/Library Imports:
import { defineCollection } from 'astro:content';import { Steps } from '@astrojs/starlight/components'; -
Internal Components/Layouts:
import CommitteeCard from '../../components/CommitteeCard.astro'; -
Styles/Assets:
import '../../styles/custom.css';
CSS and Styling
Section titled “CSS and Styling”We use Tailwind CSS (v4) for styling.
- Utility First: Use utility classes directly in elements (e.g.,
flex items-center gap-4). - No Global CSS: Avoid adding styles to
global.cssunless they apply to the entire site. - Responsiveness: Use standard breakpoints (
sm:,md:,lg:).