bonfire-networks / iconify_ex

Iconify
32 stars 7 forks source link

Allow setting default class in config #4

Closed totaltrash closed 1 year ago

totaltrash commented 1 year ago

Hello!

Not passing a class prop <.iconify icon="heroicons:academic-cap" /> currently fails with key :class not found in: %{__changed__: nil, icon: "heroicons:academic-cap", icon_name: "heroicons:academic-cap"}, so i thought I'd like to set a default class, and allow configuring it.

This PR applies to the function component only. The surface component currently defaults to "w-4 h-4", but maybe nil would be a better default and let the developer override it in config? If you're happy with this approach, let me know what you think the default default_class should be (nil or 'w-4 h-4') and I'll make the change to the surface component, and add something in the doco

mayel commented 1 year ago

Thanks :)

mayel commented 1 year ago

@totaltrash FYI I've released a new version to hex