lib/heroicon/icon.rb in heroicon-0.4.0 vs lib/heroicon/icon.rb in heroicon-1.0.0

- old
+ new

@@ -25,11 +25,11 @@ end prepend_default_class_name options.each do |key, value| - svg[key.to_s] = value + svg[key.to_s.dasherize] = value end doc end @@ -39,11 +39,11 @@ # Prepends the default CSS class name for an icon. You can provide a String, which will apply # to all icons, or a Hash, which will apply to the specified variant. # # @example # Heroicon.configure do |config| - # config.default_class = { solid: "h-5 w-5", outline: "h-6 w-6" } + # config.default_class = { solid: "h-5 w-5", outline: "h-6 w-6", mini: "h-4 w-4" } # end # # #=> <svg class="h-5 w-5">...</svg> def prepend_default_class_name return if disable_default_class? @@ -62,10 +62,10 @@ def disable_default_class? @disable_default_class ||= !!options.delete(:disable_default_class) end def safe_variant(provided_variant) - if %i[solid outline].include?(provided_variant.to_sym) + if %i[solid outline mini].include?(provided_variant.to_sym) provided_variant else :solid end end