tricks for full image section (renamed from full_left)

This commit is contained in:
2022-12-06 19:54:17 +02:00
parent eeb0cb13a0
commit e2431d276c
11 changed files with 72 additions and 32 deletions

View File

@ -43,6 +43,13 @@ module Merged
{class: color_for(option) }
end
def shade_option(section)
return {} unless section.has_option?("shade_color")
option = section.option('shade_color')
puts "Shade color #{option} , #{shade_for(option)}"
{class: shade_for(option) }
end
def column_option(section)
option = section.option('columns')
option = 2 if option.blank?
@ -87,5 +94,17 @@ module Merged
"solid_black" => "text-slate-900" ,
}[option] || ""
end
# need full color names for tailwind to pick it up
def shade_for( option )
{ "white_25" => "bg-white/25",
"none" => "",
"black_25" => "bg-black/25" ,
"light_blue_25" => "bg-cyan-100/25" ,
"light_red_25" => "bg-orange-300/25" ,
"solid_blue_25" => "bg-cyan-700/25" ,
"solid_red_25" => "bg-orange-800/25" ,
}[option] || ""
end
end
end

View File

@ -8,7 +8,7 @@ module Merged
# background image as inline style
def bg(section)
return "" if section.image.blank?
return {class: ""} if section.image.blank?
#puts "--#{Image.image_root}/#{section.image}--"
img = asset_url( "#{Image.image_root}/#{section.image}" )
style = {"style" => "background-image: url('#{img}');" }