set/all/bootstrap/icon.rb in card-mod-bootstrap-0.16.0 vs set/all/bootstrap/icon.rb in card-mod-bootstrap-0.17.0
- old
+ new
@@ -83,9 +83,20 @@
}
format :html do
view :icons, template: :haml
+ # Generates an HTML tag for an icon with optional parameters.
+ #
+ # @param [String] icon_key The key representing the desired icon.
+ # @param [Hash] opts The options for the icon tag.
+ # @option opts [String] :class Additional CSS classes for the icon tag.
+ # @option opts [String] :style Additional inline styles for the icon tag.
+ #
+ # @return [String] The HTML code for the icon tag.
+ #
+ # @example
+ # icon_tag(:heart, class: 'favorite-icon', style: 'color: red')
def icon_tag icon_key, opts={}
return "" unless icon_key.present?
library, icon = icon_lookup icon_key
with_icon_tag_opts(opts) do |tag_opts|