Skip to content

Commit

Permalink
Merge pull request #999 from web-illinois/bugfix/magjarvis/issue-988-…
Browse files Browse the repository at this point in the history
…spacing-between-title-and-first-paragraph-when-body-field-is-not-used

Added js function to remove top padding from first paragraph if no bo…
  • Loading branch information
trubach authored Jun 25, 2024
2 parents a512834 + 2727837 commit 8b6c944
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions js/paragraph-whitespace.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,12 @@ jQuery(function ($) {
}
});
});

// remove top padding from first paragraph element if no body field is present
jQuery(function ($) {
if($('.field--name-body').length){ }
else {
// find next div with paragraph class after title div then add a class to remove padding
$('#block-illinois-framework-theme-page-title').next('.paragraph').addClass('remove-padding--top');
}
});
1 change: 1 addition & 0 deletions scss/illinois-framework/_paragraphs.rt.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.paragraph--type--rt {
@extend %paragraphs-padding;
h3 {
color: var(--il-blue) !important;
}
Expand Down
4 changes: 4 additions & 0 deletions scss/illinois-framework/utilities/_padding.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@
.reduce-padding--top {
padding-top: 1rem !important;
}
.remove-padding--top {
padding-top: 0 !important;
}

0 comments on commit 8b6c944

Please sign in to comment.