Contributing
Canon is built by CREATE SOMETHING. Contributions follow the Subtractive Triad: remove excess, reveal clarity, serve the whole.
Philosophy
Before contributing, understand the principles that guide Canon:
DRY (Implementation)
"Have I built this before?" Unify. No duplicate patterns.
Rams (Artifact)
"Does this earn its existence?" Remove. Less, but better.
Heidegger (System)
"Does this serve the whole?" Reconnect. Parts inform whole.
Getting Started
1. Clone the Repository
git clone https://github.com/createsomethingtoday/create-something-monorepo.git
cd create-something-monorepo
pnpm install2. Run the Dev Server
pnpm dev --filter=components3. Run Type Checks
pnpm --filter=components checkAdding a Component
- Check if it exists — Search existing components. Don't duplicate.
- Question necessity — Does this component earn its existence? Can a pattern or composition of existing components work instead?
- Create the component — Follow the file structure below.
- Document it — Add a documentation page in
/canon/components/. - Export it — Add to the appropriate index.ts.
File Structure
packages/components/src/lib/components/
├── Button/
│ ├── Button.svelte # Component file
│ └── index.ts # Re-export
├── TextField/
│ ├── TextField.svelte
│ └── index.ts
└── index.ts # Package exportsComponent Template
<script lang="ts">
/**
* ComponentName
*
* Brief description of what this component does.
*
* Canon Principle: Which principle does this embody?
*/
interface Props {
/** Prop description */
label: string;
/** Optional prop */
variant?: 'primary' | 'secondary';
}
let {
label,
variant = 'primary'
}: Props = $props();
</script>
<element class="component component--{variant}">
{label}
</element>
<style>
.component {
/* Use Canon tokens */
padding: var(--space-sm);
color: var(--color-fg-primary);
}
</style>Modifying Tokens
Tokens are the foundation. Changes cascade everywhere.
Warning: Token changes affect all properties (.io, .space, .agency, .ltd).
Ensure changes are intentional and documented.
Token Source
Edit tokens in:
packages/components/src/lib/styles/tokens.cssRegenerate Exports
After editing tokens, regenerate derived formats:
pnpm --filter=components tokens:exportThis generates:
tokens.scss— SCSS variablestokens.dtcg.json— W3C Design Token formattokens.figma.json— Tokens Studio formatcanon.json— Structured JSON
Code Standards
TypeScript
- All components use TypeScript
- Define explicit
Propsinterface - Document props with JSDoc comments
- Use Svelte 5 runes (
$props,$state,$derived)
CSS
- Use Canon tokens for all values (colors, spacing, typography)
- No hardcoded colors or pixel values
- Tailwind for structure, Canon for aesthetics
- Include
:focus-visiblestyles for interactives
Accessibility
- WCAG 2.1 AA compliance required
- Keyboard navigation must work
- Screen reader tested
- Include
prefers-reduced-motionsupport
Commit Messages
Follow conventional commits format:
feat(components): add Tooltip component
fix(tokens): correct spacing token values
docs(canon): add Button documentation
refactor(components): simplify Card props| Type | Use |
|---|---|
feat | New feature |
fix | Bug fix |
docs | Documentation |
refactor | Code restructure |
style | Formatting only |
test | Tests |
Pull Request Process
- Create a branch from
main - Make changes following the guidelines above
- Run checks —
pnpm checkandpnpm build - Create PR with clear description
- Address feedback from review
PR Checklist
- Type checks pass
- Build succeeds
- Documentation updated
- Exports added to index.ts
- Accessibility tested
- Canon tokens used (no hardcoded values)