add heading level customization to callout component to fix a11y issue
This commit is contained in:
parent
bc3e67ab94
commit
b0df654346
3 changed files with 6 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue