Skip to content

Conversation

@josemarluedke
Copy link
Owner

Summary

This PR reworks the design system documentation to remove excessive examples and configures tailwind-merge for proper class conflict resolution across all design tokens.

Design System Documentation

  • Icon Sizes: Removed "Buttons with Icons", "List Items with Icons", "Input Fields with Icons" sections that showed component implementations not matching actual Frontile components. Added comprehensive "All Icon Sizes" section showing all 14 size variants.

  • Borders & Radius: Removed redundant sections ("Border Radius Examples", "Directional Border Utilities", "Directional Border Radius") that just demonstrated standard Tailwind features.

  • Elevation: Removed component-specific examples ("Dropdown Menus", "Modal Dialog", "Alert Notifications") and custom font classes. Kept only "Cards and Panels" and "Interactive States" sections.

Typography System Updates

Changed CSS variables from --font-family-* to shorter --font-* format:

  • --font-family-marquee--font-marquee
  • --font-family-header--font-header
  • --font-family-body--font-body
  • etc.

Updated typography documentation to show the new two-part usage pattern:

<!-- New pattern: font-family + text-style -->
<h2 class="font-header text-header-md">Heading</h2>
<p class="font-body text-body-lg">Body text</p>

Composite text styles (text-header-md, text-body-lg, etc.) now set font-size, weight, spacing, and line-height but NOT font-family, providing more flexibility.

Tailwind-Merge Configuration

Added comprehensive configuration in packages/theme/src/tw.ts:

  • COMMON_UNITS: Single shared constant for all size tokens (pico through mega, plus xs/sm/md/lg/xl variants)
  • Icon sizes: Configured to conflict with w/h/size utilities
  • Typography composites: Configured to conflict with font-size utilities
  • Design tokens: Added configuration for borders, radius, elevation, and opacity

Icon Component Updates

Updated all icon components with semantic size-icon-* defaults:

  • Small utility icons → size-icon-sm
  • Medium icons → size-icon-md
  • Large feature icons → size-icon-lg

Sizes can still be overridden via ...attributes spreading.

Test Plan

  • Theme package builds successfully
  • Type checking passes
  • Documentation examples use correct utility names
  • All CSS variable references updated across documentation
  • Icons display at appropriate default sizes

🤖 Generated with Claude Code

- **Design system documentation improvements:**
  - Removed excessive examples that didn't match actual components
  - Removed sections showing standard Tailwind features
  - Streamlined icon sizes, borders, and elevation docs

- **Typography system updates:**
  - Changed CSS variables from `--font-family-*` to `--font-*`
  - Updated typography docs to show new two-part pattern (font-family + text-style)
  - Documented that composite text styles don't include font-family
  - Fixed all documentation references to use shorter variable names

- **Tailwind-merge configuration:**
  - Added `COMMON_UNITS` constant for shared size tokens across design system
  - Configured icon sizes to conflict with w/h/size utilities
  - Configured text style composites to conflict with font-size utilities
  - Added configuration for borders, radius, elevation, and opacity tokens

- **Icon component updates:**
  - Added semantic size-icon-* defaults to all icon components
  - Allows size overrides while maintaining consistent defaults
  - Small icons default to size-icon-sm, medium to size-icon-md, large to size-icon-lg

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@netlify
Copy link

netlify bot commented Dec 9, 2025

Deploy Preview for frontile-next ready!

Name Link
🔨 Latest commit cfcea65
🔍 Latest deploy log https://app.netlify.com/projects/frontile-next/deploys/693792d22871bd0008def31c
😎 Deploy Preview https://deploy-preview-430--frontile-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

josemarluedke and others added 2 commits December 8, 2025 19:07
…m tokens

- Add custom class groups to tailwind-merge for Frontile design tokens:
  - Icon sizes (size-icon-*)
  - Border widths (border-thin, border-heavy, border-aggressive)
  - Border radius (rounded-default, rounded-pill)
  - Elevation shadows (shadow-elevation-0 through shadow-elevation-5)
  - Opacity (opacity-hover, opacity-disabled)
  - Typography composite utilities (text-marquee-*, text-header-*, text-body-*, etc.)

- Configure tailwind-variants via createTV to use custom twMerge config
- Consolidate size constants into shared COMMON_UNITS array
- Use shared twMergeConfig constant for both tailwind-merge and tailwind-variants
- Add tw-merge template helper for using twMerge in templates
- Fix TypeScript types using generic type argument and 'as const'

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Create single twMergeConfig constant with 'as const' for type safety
- Use shared config in both extendTailwindMerge and createTV
- Eliminates duplicate configuration definitions

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@josemarluedke josemarluedke merged commit e87f0e7 into main Dec 9, 2025
5 checks passed
@josemarluedke josemarluedke deleted the bug/tw-merge-fonts branch December 9, 2025 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant