diff --git a/js/paragraph-whitespace.js b/js/paragraph-whitespace.js index 5b9cce48..e928d4f3 100644 --- a/js/paragraph-whitespace.js +++ b/js/paragraph-whitespace.js @@ -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'); + } + }); diff --git a/scss/illinois-framework/_paragraphs.rt.scss b/scss/illinois-framework/_paragraphs.rt.scss index 55187281..7489fa27 100644 --- a/scss/illinois-framework/_paragraphs.rt.scss +++ b/scss/illinois-framework/_paragraphs.rt.scss @@ -1,4 +1,5 @@ .paragraph--type--rt { + @extend %paragraphs-padding; h3 { color: var(--il-blue) !important; } diff --git a/scss/illinois-framework/utilities/_padding.scss b/scss/illinois-framework/utilities/_padding.scss index 5a457416..c2859ed2 100644 --- a/scss/illinois-framework/utilities/_padding.scss +++ b/scss/illinois-framework/utilities/_padding.scss @@ -4,3 +4,7 @@ .reduce-padding--top { padding-top: 1rem !important; } +.remove-padding--top { + padding-top: 0 !important; +} +