Skip to content

Use empty string for NONE margin values #23

@pglevy

Description

@pglevy

Problem

Margin mappings inconsistently handle the NONE value - some use explicit mt-0/mb-0 classes, while newer components (TabsField) use empty string.

Current Patterns

Older Pattern

const marginAboveMap = {
  NONE: 'mt-0',  // Explicit zero class
  EVEN_LESS: 'mt-1',
  // ...
}

Newer Pattern (TabsField)

const marginMap = {
  NONE: '',  // Empty string, cleaner
  EVEN_LESS: 'mt-1',
  // ...
}

Recommendation

Use empty string '' for NONE values across all components. Benefits:

  • Cleaner output HTML (no unnecessary mt-0 classes)
  • Follows Tailwind best practices (no class = default browser behavior)
  • Consistent with newer component patterns

Affected Components

  • ButtonArrayLayout
  • CardLayout
  • TagField

Priority

Low - cosmetic improvement, but increases consistency

Note

If implementing the shared margin utility (#1), this should be incorporated into that solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions