Skip to content

📋 Swift/Kotlin Output - Native Mobile Constants (vibe-kanban)#3

Open
toadkicker wants to merge 1 commit intomainfrom
vk/c54a-swift-kotlin-out
Open

📋 Swift/Kotlin Output - Native Mobile Constants (vibe-kanban)#3
toadkicker wants to merge 1 commit intomainfrom
vk/c54a-swift-kotlin-out

Conversation

@toadkicker
Copy link
Copy Markdown
Collaborator

Category: Output
Effort: Medium
Priority: Backlog

Native mobile platform constants for Swift (iOS) and Kotlin (Android).

…stants

Adds a new output adapter that generates native iOS (Swift/SwiftUI) and
Android (Kotlin/Compose) constant files from design tokens.

- Color constants as SwiftUI `Color(red:green:blue:opacity:)` initializers
- Spacing/dimension constants as `CGFloat` values
- Typography as `Font.system(size:weight:)` definitions
- Shadow configurations with custom `ShadowStyle` struct + View extension
- Gradient support (LinearGradient, RadialGradient, AngularGradient)
- Optional UIKit extension (`UIColor` versions)
- Valid camelCase identifiers with reserved word escaping

- Color constants as Compose `Color(r, g, b, a)` or hex `Color(0xAARRGGBB)`
- Spacing/dimension constants with `dp` units
- Font sizes with `sp` units for accessibility
- Typography as `TextStyle` configurations
- Shadow elevation values
- Gradient support via `Brush` API
- Region comments for code organization

```typescript
// Convenience function
const output = await figmaToSwiftKotlin(input, options);

// Or via adapter
const adapter = createSwiftKotlinAdapter();
const output = await adapter.transform(theme, options);

// Access generated files
output.files['DesignTokens.swift']  // SwiftUI constants
output.files['DesignTokens.kt']     // Compose constants
output.files['DesignTokens+UIKit.swift']  // Optional UIKit extension
```

- `swiftTypeName`: Customize Swift enum name (default: 'DesignTokens')
- `kotlinObjectName`: Customize Kotlin object name (default: 'DesignTokens')
- `kotlinPackage`: Set package name (default: 'com.design.tokens')
- `includeUIKit`: Generate UIKit extensions (default: false)
- `includeComments`: Include description comments (default: true)
- `hexColors`: Use hex color format for Kotlin (default: false)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant