Add lead shortcode; make banner a full-bleed hero image
- lead: wraps content in a Bootstrap .lead paragraph (moved from the
ctsmockup site, where {.lead} could not target a paragraph).
- banner: resolves src as a page/global resource or base-URL-aware
link, and spans the full viewport width via symmetric
calc(50% - 50vw) margins while page content stays in .container.
Optional height crops via object-fit: cover. A banner that starts a
page's content is pulled flush against the navbar.
- html { overflow-x: hidden } to absorb the 100vw scrollbar overhang.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -15,6 +15,12 @@
|
||||
--bs-body-line-height: 1.5;
|
||||
}
|
||||
|
||||
// Keep the full-bleed `.banner` from adding a horizontal scrollbar
|
||||
// (100vw is wider than the viewport when a vertical scrollbar is shown).
|
||||
html {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: var(--bs-font-sans-serif);
|
||||
line-height: var(--bs-body-line-height);
|
||||
@@ -61,8 +67,23 @@ h1, h2, h3, h4, h5 {
|
||||
}
|
||||
}
|
||||
|
||||
// Images
|
||||
// Full-bleed banner / hero image: spans the viewport width while the
|
||||
// surrounding page content stays within `.container`. Works from inside
|
||||
// any centred `.container` because the horizontal margins cancel out the
|
||||
// container offset (50% of the parent - 50% of the viewport).
|
||||
.banner {
|
||||
display: block;
|
||||
width: 100vw;
|
||||
max-width: 100vw;
|
||||
margin-left: calc(50% - 50vw);
|
||||
margin-right: calc(50% - 50vw);
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
// When the banner is the first thing in the page body, pull it flush
|
||||
// against the navbar by cancelling the layout's top padding (`py-5`).
|
||||
.content-body > .banner:first-child,
|
||||
.content-body > p:first-child > .banner:only-child {
|
||||
margin-top: -3rem;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user