background color for two col

This commit is contained in:
2022-12-05 12:38:57 +02:00
parent 6bb1a814ad
commit 7728767b3d
5 changed files with 31 additions and 7 deletions

View File

@ -4,6 +4,9 @@
%h1.text-2xl.font-bold.tracking-tight.text-gray-900.sm:text-4xl
Page
= @page.name
.flex.items-center.justify-center.flex-1
%h3.text-xl.font-bold.tracking-tight.text-gray-900
=link_to "View live" , "/#{@page.name}" , target: @page.name
-@page.sections.each do |section |
.grid.grid-cols-5.gap-2.m-8{class: (section.index%2)==1 ? 'bg-cyan-50' : 'bg-red-50' }

View File

@ -1,10 +1,11 @@
%section.overflow-hidden.sm:grid.sm:grid-cols-2
= image_for( section , "p-5 h-56 w-full object-cover sm:h-full")
.p-8.m-5.bg-cyan-100.md:p-12.lg:px-16.lg:py-24{ order_option(section)}
%div{ order_option(section)}
= image_for( section , "p-5 h-56 w-full object-cover sm:h-full")
.p-8.m-5.md:p-12.lg:px-16.lg:py-24{ background_option(section)}
.mx-auto.max-w-xl.text-center.sm:text-left
%h2.text-2xl.font-bold.text-gray-900.md:text-3xl
= section.header
%p.hidden.text-gray-500.md:mt-4.md:block
%p.text-gray-500.mt-4.md:block
= section.text
.mt-4.md:mt-8
-if section.has_option?("button_text")