Skip to content

Commit

Permalink
feature: html classes for heading wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Bob committed May 8, 2024
1 parent 2c183af commit 846fb35
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= content_tag :div, class: "flex items-start py-1 leading-tight bg-gray-100 text-gray-500 text-xs", data: @data do %>
<%= content_tag :div, class: @classes, data: @data do %>
<div class="py-2 px-6 h-full w-full">
<% if @field.as_html %>
<%= sanitize @field.value %>
Expand Down
1 change: 1 addition & 0 deletions app/components/avo/fields/common/heading_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class Avo::Fields::Common::HeadingComponent < ViewComponent::Base
def initialize(field:)
@field = field
@view = field.resource.view
@classes = "flex items-start py-1 leading-tight bg-gray-100 text-gray-500 text-xs #{@field.get_html(:classes, view: @view, element: :wrapper)}"

@data = stimulus_data_attributes
add_stimulus_attributes_for(field.resource, @data)
Expand Down

0 comments on commit 846fb35

Please sign in to comment.