add heading level customization to callout component to fix a11y issue

This commit is contained in:
Lisa Durand 2023-04-11 16:32:57 +02:00
parent bc3e67ab94
commit b0df654346
3 changed files with 6 additions and 4 deletions

View file

@ -4,13 +4,14 @@ class Dsfr::CalloutComponent < ApplicationComponent
renders_one :html_body
renders_one :bottom
attr_reader :title, :theme, :icon, :extra_class_names
attr_reader :title, :theme, :icon, :extra_class_names, :heading_level
def initialize(title:, theme: :info, icon: nil, extra_class_names: nil)
def initialize(title:, theme: :info, icon: nil, extra_class_names: nil, heading_level: 'h3')
@title = title
@theme = theme
@icon = icon
@extra_class_names = extra_class_names
@heading_level = heading_level
end
def callout_class