Command Palette

Search for a command to run...

Назад к скиллам
скилл № 80077

openfoodjournal-ui

UI/UX design system and component patterns for OpenFoodJournal. Use when building new views, adding UI components, styling elements, presenting sheets, or…

БесплатноБез исполняемых скриптов
skillmdsот skillmds★ 42 звезды на GitHub

Установить openfoodjournal-ui в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

OpenFoodJournal UI/UX Design System

Living reference for every visual and interaction pattern in the app. Consult before creating or modifying any SwiftUI view. Update whenever a new pattern is established or an existing one changes.

Quick Reference

Token Value Where Used
Card corner radius 20 pt MacroSummaryBar, glass cards
Button/chip radius 12 pt Remaining calorie pill, macro chips
Badge radius 8 pt Status badges, small pills
List row insets (8, 16, 8, 16) All List rows
Section gap 12–20 pt Between major sections
Min hit target 44 pt All tappable elements
Glass availability iOS 26+ (no guards) Entire codebase

Color System

Macro Colors (Canonical)

Macro Color Usage
Calories .orange Calorie countdown, energy metrics
Protein .blue Protein goals, progress rings
Carbs .green Carbohydrate goals, progress
Fat .yellow Fat goals, progress

Progress Status Colors

Status Color Threshold
Met .green 95–105% of goal
Near .yellow 50–80% of goal
Slightly over .orange 105–120% of goal
Way over .purple >120% of goal
Under .red <50% of goal

Opacity Conventions

Element Opacity
Glass tint 0.35
Background highlight 0.12
Disabled state 0.5
Separator lines .secondary.opacity(0.4)
Secondary text .foregroundStyle(.secondary) (system)
Tertiary text .foregroundStyle(.tertiary) (system)

Typography

Role Font Weight Size
Display macro total .system(size: 32, weight: .bold, design: .rounded) bold 32
Section headline .headline default ~17
Row title .body .fontWeight(.medium) ~17
Row subtitle .caption default ~12
Form label .subheadline default ~15
Numeric alignment .monospacedDigit() — inherited

Convention: All numeric displays use .system(design: .rounded). Precise alignment uses .monospacedDigit().

Glassmorphism (iOS 26+)

The app targets iOS 26+ exclusively — no #available guards needed.

Standard Patterns

// Card surface
.glassEffect(in: .rect(cornerRadius: 20))

// Circular element (macro rings)
.glassEffect(in: .circle)

// Tinted interactive element
.glassEffect(
    .regular.tint(color.opacity(0.35)),
    in: .circle
)

// Multiple glass elements in proximity
GlassEffectContainer(spacing: 20) {
    HStack { /* glass children */ }
}

// Buttons
.buttonStyle(.glass)           // Standard
.buttonStyle(.glassProminent)  // Primary action

Glass Rules

  1. Apply .glassEffect() after layout and appearance modifiers
  2. Wrap multiple glass siblings in GlassEffectContainer
  3. Use .interactive() only on tappable/focusable elements
  4. Use .glassEffectID(_:in:) + @Namespace for morphing transitions
  5. Prefer .glassEffect() over .background(.ultraThinMaterial) for new UI

See the swiftui-liquid-glass skill for the complete Liquid Glass API reference.

Navigation Architecture

Tab Structure

4-tab TabView at root with .tabBarMinimizeBehavior(.never):

Tab View Icon
Journal DailyLogView book.pages
Food Bank FoodBankView refrigerator
History HistoryView chart.xyaxis.line
Settings SettingsView gearshape

Each tab wraps its content in NavigationStack.

Sheet Management (Enum-Driven)

Always use a single enum for all sheets within a page:

enum DailyLogSheet: Identifiable {
    case scan, manualEntry, editEntry(NutritionEntry)
    case foodBank, containers
    
    var id: String { /* unique per case */ }
}

@State private var presentedSheet: DailyLogSheet?

// In body:
.sheet(item: $presentedSheet) { sheet in
    switch sheet {
    case .scan: ScanCaptureView(logDate: selectedDate)
    case .manualEntry: ManualEntryView(defaultDate: selectedDate)
    // ...
    }
}

Never use multiple @State booleans for sheet presentation.

Sheet Configuration

Every sheet must include:

  • NavigationStack wrapper for internal nav
  • .navigationTitle() + .navigationBarTitleDisplayMode(.inline)
  • Cancel button: ToolbarItem(placement: .cancellationAction)
  • Save button: ToolbarItem(placement: .confirmationAction) with .fontWeight(.semibold) and .disabled() guard
  • @Environment(\.dismiss) private var dismiss

Component Catalog

Shared Components (Views/Shared/)

Component Purpose Size/Shape
MacroRingView Circular progress for one macro 56×56 pt, circle
MacroSummaryBar 3-column macro cards + calorie headline Full width, glass card
RadialMenuButton Floating "+" FAB with radial menu Circular, bottom-aligned
`MicronutrientSummaryV
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл openfoodjournal-ui?

UI/UX design system and component patterns for OpenFoodJournal. Use when building new views, adding UI components, styling elements, presenting sheets, or modifying any view file. Contains the project's design tokens, component catalog, animation conventions, and layout patterns so new UI stays visually consistent with the existing app.

Как установить скилл openfoodjournal-ui?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл openfoodjournal-ui запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить openfoodjournal-ui с