Skip to content

Commit 2b897b8

Browse files
Responsive heart (#20)
* set width with max-height upper-limit to responsively size the heart AFAIK if both dimensions are bounded with max-*, the browser won't try to fill that proactively. Confirmed in FF/Chrome/Safari. * calculate gap between heart and title in golden ratio based on the title size
1 parent 0a7427f commit 2b897b8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
}
4747
main > * { grid-column: content; }
4848
#hero { grid-column-start: 1; grid-column-end: 4; }
49-
#hero { display: flex; flex-direction: column; gap: 15vh; align-items: center; margin-block: 4vh; }
49+
#hero { display: flex; flex-direction: column; gap: calc(var(--step-4) / 1.618); align-items: center; margin-block: 4vh; }
5050
.flow > * + * {
5151
margin-block-start: var(--flow-space, 1em);
5252
}
@@ -56,7 +56,7 @@
5656
<main class="flow">
5757
<hgroup id="hero">
5858
<!-- <span style="font-size: calc(1.618 * var(--step-4));">♥</span> -->
59-
<img src="heart.svg" title="" style="max-width: clamp(1rem, 4rem + 12vw, 20rem); max-height: 80vh;">
59+
<img src="heart.svg" title="" style="width: clamp(1rem, 4rem + 12vw, 20rem); max-height: clamp(2rem, 80vh, calc(2 * var(--step-4)));">
6060
<h1>Act&nbsp;different.</h1>
6161
</hgroup>
6262
</main>

0 commit comments

Comments
 (0)