Skip to content

CSS Variables Not Type-Safe #6

@JakeLin

Description

@JakeLin

Using string literals for design tokens:

// Current: No autocomplete, typo-prone
<div style={{
  gap: 'var(--ai-spacing-8)',        // ❌ String, no type safety
  fontSize: 'var(--ai-font-size-sm)' // ❌ Could typo
}} />

// Should export:
import { spacing, typography } from '@ainativekit/ui/tokens';

<div style={{
  gap: spacing[8],        // ✅ Autocomplete!
  fontSize: typography.body.fontSize
}} />

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions