From 2dd6bc72255d40b7d261662ef282a3c1dcd4087a Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sat, 23 Mar 2024 20:09:16 +0100 Subject: [PATCH] web: Introduce sections Signed-off-by: Michael Tremer --- config/cfgroot/header.pl | 22 +++++++++++++++++-- html/html/themes/ipfire/include/css/style.css | 11 ++++++---- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/config/cfgroot/header.pl b/config/cfgroot/header.pl index a5cd5fbb1..fa11ca0fa 100644 --- a/config/cfgroot/header.pl +++ b/config/cfgroot/header.pl @@ -333,6 +333,24 @@ sub openbigbox { sub closebigbox { } +# Sections + +sub opensection($) { + my $title = shift; + + # Open the section + print "
"; + + # Show the title if set + if ($title) { + print "

${title}

\n"; + } +} + +sub closesection() { + print "
"; +} + ############################################################################### # # print box opening html layout @@ -346,7 +364,7 @@ sub openbox { my $title = shift; - print "
\n"; + print "
\n"; # Show the title if ($title) { @@ -358,7 +376,7 @@ sub openbox { # # print box closing html layout sub closebox { - print "
"; + print ""; } sub green_used() { diff --git a/html/html/themes/ipfire/include/css/style.css b/html/html/themes/ipfire/include/css/style.css index 181a87c26..fac3703fc 100644 --- a/html/html/themes/ipfire/include/css/style.css +++ b/html/html/themes/ipfire/include/css/style.css @@ -165,13 +165,16 @@ iframe { border-radius: 3px 3px 3px 3px; } -.box { - border: 1px solid var(--color-grey); - padding: 0.75rem 1rem; +section { margin-bottom: 2rem; } -.box .title { +section.is-box { + padding: 0.75rem 1rem; + border: 1px solid var(--color-grey); +} + +section .title { margin-bottom: 1rem; border-bottom: 1px solid var(--color-grey); }