more margin option, with name

This commit is contained in:
Torsten 2023-01-28 14:37:08 +02:00
parent c90db49be3
commit 3a15e58ee3
3 changed files with 18 additions and 13 deletions

View File

@ -3101,6 +3101,14 @@ select {
margin: 5rem;
}
.xl\:m-8 {
margin: 2rem;
}
.xl\:m-14 {
margin: 3.5rem;
}
.xl\:mx-auto {
margin-left: auto;
margin-right: auto;

View File

@ -75,10 +75,13 @@ module Merged
end
def margin_option(section , clazz = "")
if section.has_option?("margin")
clazz += margin_for(section)
end
{class: clazz}
return {class: clazz} unless section.has_option?("margin")
margin = { "none" => " m-0" ,
"small" => " 2 md:4 lg:6 xl:m-8" ,
"medium" => " 5 md:8 lg:10 xl:m-14" ,
"large" => " 8 md:12 lg:16 xl:m-20" ,
}[section.option("margin")] || ""
{class: clazz + margin}
end
def text_color_option(section , clazz = "")
@ -145,13 +148,7 @@ module Merged
"solid_black" => " bg-slate-900" ,
}[section.option('background')] || ""
end
# need full margin names for tailwind to pick it up
def margin_for( section )
{ "0" => " m-0" ,
"none" => "" ,
"20" => " 8 md:12 lg:16 xl:m-20" ,
}[section.option("margin")] || ""
end
# need full color names for tailwind to pick it up
def color_for( section )
{ "white" => " text-white",

View File

@ -42,8 +42,8 @@
- :name: margin
:description: Most sections have standard margin of 20. This option makes it possible
to remove that
:values: 0 20
:default: 20
:values: none small medium large
:default: large
:id: 8
- :name: button_text
:description: Text for an optional button. Must also set button_link