Skip to content

Standardize callout icon class targeting to icon:class (with class:icon backwards compatibility) - #2850

Open
ghabriel25 wants to merge 1 commit into
livewire:mainfrom
ghabriel25:fix/unify-icon-class-attribute-forwarding
Open

ghabriel25 wants to merge 1 commit into
livewire:mainfrom
ghabriel25:fix/unify-icon-class-attribute-forwarding

Conversation

@ghabriel25

Copy link
Copy Markdown
Contributor

Summary

The Callout component (and its heading sub-component) were the only places still using the older class:icon attribute for icon class targeting.

Everywhere else in Flux, icon-related attributes follow the icon:* convention (icon:variant, icon:trailing, etc.), and class targeting generally uses the *:class form (input:class, etc.).

This PR brings the Callout components in line with the rest of the library.

Changes

  • Added support for icon:class on both flux:callout and flux:callout.heading
  • Kept class:icon working for backwards compatibility (marked as @deprecated in a comment)
  • No breaking changes

Usage

{{-- Preferred (new) --}}
<flux:callout icon="information-circle" icon:class="text-blue-500" />

{{-- Still works (deprecated) --}}
<flux:callout icon="information-circle" class:icon="text-blue-500" />

Same applies to <flux:callout.heading>.

Motivation

Having two different attribute names for the same purpose (class:icon vs icon:class) is confusing for users and inconsistent with the rest of the component library. Standardizing on icon:class makes the API more predictable while preserving existing code.

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