File tree Expand file tree Collapse file tree 3 files changed +44
-17
lines changed
Expand file tree Collapse file tree 3 files changed +44
-17
lines changed Original file line number Diff line number Diff line change 2323 padding : 0 ;
2424 height : 100vh ;
2525 transition :
26- background-color 0.5s ,
27- color 0.5s ;
26+ background-color 0.5s ,
27+ color 0.5s ;
2828}
2929
3030main {
6565 margin : 0 ;
6666 font-weight : normal;
6767}
68+
69+ /* -------------------------------------------------
70+ * Utility: Full-bleed breakout (safe “50vw” method)
71+ * Use to make an element span the full viewport
72+ * even inside padded / max-width containers.
73+ * Example: <section class="u-breakout u-breakout--clip">…</section>
74+ * ------------------------------------------------- */
75+ .u-breakout {
76+ position : relative;
77+ left : 50% ;
78+ right : 50% ;
79+ margin-left : -50vw ;
80+ margin-right : -50vw ;
81+ width : 100vw ;
82+ max-width : 100vw ;
83+ display : block;
84+ }
85+
86+ /* Optional: hide any overflow to avoid stray scrollbars */
87+ .u-breakout--clip {
88+ overflow : hidden;
89+ }
Original file line number Diff line number Diff line change 1- // File: js/components/hero.js
1+ // File: js/components/fullscreen- hero.js
22// Repository: https://github.com/quantuminformation/vanillajs-patterns
33
44/**
@@ -93,13 +93,15 @@ export default (hostComponent) => {
9393 margin-bottom: 1.5rem;
9494 }
9595 </style>
96- <div class="hero-container">
97- <div class="hero-overlay"></div>
98- <div class="hero-content">
99- <h1 class="hero-header">${ header } </h1>
100- <p class="hero-text">${ text } </p>
101- <a href="${ buttonLink } " class="button transparent squarify">${ buttonText } </a>
96+ <section class="u-breakout u-breakout--clip">
97+ <div class="hero-container">
98+ <div class="hero-overlay"></div>
99+ <div class="hero-content">
100+ <h1 class="hero-header">${ header } </h1>
101+ <p class="hero-text">${ text } </p>
102+ <a href="${ buttonLink } " class="button transparent squarify">${ buttonText } </a>
103+ </div>
102104 </div>
103- </div >
105+ </section >
104106 ` ;
105107} ;
Original file line number Diff line number Diff line change 1- // Updated narrow-hero component to maintain padding and a fixed height
1+ // File: js/components/narrow-hero.js
2+ // Repository: https://github.com/quantuminformation/vanillajs-patterns
23
34export default ( hostComponent ) => {
45 const { header = "Default Header" , text = "" } = hostComponent . dataset ;
@@ -45,13 +46,15 @@ export default (hostComponent) => {
4546 }
4647 </style>
4748
48- <section class="narrow-hero">
49- <div class="narrow-hero-overlay">
50- <div class="narrow-hero-content">
51- <h1>${ header } </h1>
52- <p>${ text } </p>
49+ <section class="u-breakout u-breakout--clip">
50+ <section class="narrow-hero">
51+ <div class="narrow-hero-overlay">
52+ <div class="narrow-hero-content">
53+ <h1>${ header } </h1>
54+ <p>${ text } </p>
55+ </div>
5356 </div>
54- </div >
57+ </section >
5558 </section>
5659 ` ;
5760 } ;
You can’t perform that action at this time.
0 commit comments