diff --git a/src/patterns/01-core/mixins/_headings.scss b/src/patterns/01-core/mixins/_headings.scss index babd9f9980cb1bb82a6f0f4b5a80e54555973f93..32459d464b6aa93876e1d8bfdf7678c6ae27ebfb 100644 --- a/src/patterns/01-core/mixins/_headings.scss +++ b/src/patterns/01-core/mixins/_headings.scss @@ -20,7 +20,8 @@ } // Add top margin when headers are preceded by other elements (p, ul, etc.) - * + & { + // (excluding the uw-admin-label that identifies the blocks in layout builder) + *:not(.uw-admin-label) + & { margin-top: var(--size-2); } diff --git a/src/patterns/03-layouts/block/_block.scss b/src/patterns/03-layouts/block/_block.scss index da90a1aec327ef8d1c4e44b0642f9c6aa2579a15..8f530799452d2e0cb967b1a73d1a3a5740a02455 100644 --- a/src/patterns/03-layouts/block/_block.scss +++ b/src/patterns/03-layouts/block/_block.scss @@ -13,9 +13,27 @@ &.block-local-tasks-block { margin-bottom: 0; } + // Move block title to top of block, while preserving spacing underneath. + & > { + h2:first-child, + .uw-admin-label + h2 { + line-height: 1em; /* using EMs because we want it to be the height of the text, regardless of what the font size is */ + margin: 0 0 var(--size-2); + padding-top: 0; + } + } &:last-of-type { margin-bottom: 0; } + // Move an initial header in copy text to top of block, while preserving spacing underneath, unless there was a block title.. + .uw-admin-label + .contextual + .uw-copy-text, + .uw-copy-text:first-child { + .uw-copy-text__wrapper > :where(h2, h3, h4, h5, h6):first-child { + line-height: 1em; /* using EMs because we want it to be the height of the text, regardless of what the font size is */ + margin: 0 0 var(--size-2); + padding-top: 0; + } + } } // disable margin for layout builder blocks diff --git a/src/patterns/04-components/view/_view.scss b/src/patterns/04-components/view/_view.scss index 5a91a425f303d26d0e1bdb9dfded6d78a44e0640..660e689ff0ba3fa1f2da3c3e7775f0a4c8941f48 100644 --- a/src/patterns/04-components/view/_view.scss +++ b/src/patterns/04-components/view/_view.scss @@ -403,3 +403,9 @@ $sidebar-width: 18.75rem; gap: var(--size-1); justify-content: flex-end; } + +// Make views display properly in layout builder (particularly narrow columns). +.layout-builder-block.views-element-container { + padding: 1.5em; /* The default for layout builder blocks; for some reason it only works if I set it explicitly */ + width: auto; +}