Skip to content

Commit

Permalink
Add has-background class, remove margin on page title w/ background.
Browse files Browse the repository at this point in the history
  • Loading branch information
kimisgold committed Feb 22, 2024
1 parent ccdac05 commit b79cd3f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion application/asset/css/page-blocks.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions application/asset/sass/page-blocks.scss
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@
font-weight: bold;
}

.block-pageTitle.has-background h2 {
margin: 0;
}

.page-date-time {
margin: 1rem 0;
}
Expand Down
5 changes: 5 additions & 0 deletions application/src/View/Helper/AbstractLayout.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ public function getBlockClasses(SitePageBlockRepresentation $block)
default:
// No text alignment
}
$backgroundImage = $block->layoutDataValue('background_image_asset');
$backgroundColor = $block->layoutDataValue('background_color');
if ($backgroundImage || $backgroundColor) {
$classes[] = 'has-background';
}
$backgroundImagePositionY = $block->layoutDataValue('background_image_position_y');
if ($backgroundImagePositionY) {
switch ($backgroundImagePositionY) {
Expand Down

0 comments on commit b79cd3f

Please sign in to comment.