implement item alignment (justify on flex) for sections

This commit is contained in:
2022-12-15 15:19:07 +02:00
parent 33bb02c8c8
commit 2144f8a0f6
10 changed files with 37 additions and 38 deletions

View File

@ -19,13 +19,27 @@ module Merged
end
def text_align_option(section , clazz = "")
if section.has_option?("align")
if section.has_option?("text_align")
# text-center , text-left , text-right , leave comment for tailwind
clazz += " text-#{section.option('align')}"
clazz += " text-#{section.option('text_align')}"
end
{class: clazz}
end
def item_align_option(section , clazz = "")
if section.has_option?("item_align")
case section.option("item_align")
when "left"
clazz += " justify-start"
when "right"
clazz += " justify-end"
else
clazz += " justify-center"
end
end
{class: clazz }
end
def background_option(section , clazz = "")
if section.has_option?("background")
option = section.option('background')