web: Introduce sections

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
Michael Tremer
2024-03-23 20:09:16 +01:00
parent fbfde0088c
commit 2dd6bc7225
2 changed files with 27 additions and 6 deletions

View File

@@ -333,6 +333,24 @@ sub openbigbox {
sub closebigbox {
}
# Sections
sub opensection($) {
my $title = shift;
# Open the section
print "<section class=\"section\">";
# Show the title if set
if ($title) {
print " <h2 class=\"title\">${title}</h2>\n";
}
}
sub closesection() {
print "</section>";
}
###############################################################################
#
# print box opening html layout
@@ -346,7 +364,7 @@ sub openbox {
my $title = shift;
print "<div class=\"box\">\n";
print "<section class=\"section is-box\">\n";
# Show the title
if ($title) {
@@ -358,7 +376,7 @@ sub openbox {
#
# print box closing html layout
sub closebox {
print "</div>";
print "</section>";
}
sub green_used() {

View File

@@ -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);
}