Optzimize responsive styling
This commit is contained in:
+12
-51
@@ -53,9 +53,12 @@
|
||||
--gutter: clamp(1rem, 4vw, 2.5rem);
|
||||
--header-height: 7rem;
|
||||
--header-height-scrolled: 5rem;
|
||||
--radius-lg: 60px;
|
||||
--radius-md: 30px;
|
||||
/* Large decorative corners (hero, header, search panel): grows with the
|
||||
viewport instead of switching at breakpoints */
|
||||
--radius-lg: min(15vw, 180px);
|
||||
--radius-sm: 15px;
|
||||
/* How far photos are pulled up into the hero */
|
||||
--hero-overlap: clamp(6rem, 11.25vw, 9rem);
|
||||
/* Dropdown submenus (Example, language) */
|
||||
--radius-menu: 8px;
|
||||
--transition: 0.3s ease-in-out;
|
||||
@@ -190,21 +193,10 @@ button:hover .arrow {
|
||||
========================================================================== */
|
||||
|
||||
.page-hero {
|
||||
--hero-veil: linear-gradient(
|
||||
90deg,
|
||||
rgba(0, 0, 74, 0.72) 0%,
|
||||
rgba(0, 0, 74, 0.45) 45%,
|
||||
rgba(0, 0, 74, 0) 75%
|
||||
);
|
||||
|
||||
margin-top: calc(-1 * var(--header-height));
|
||||
padding: calc(var(--header-height) + 3rem) 0 12rem;
|
||||
padding: calc(var(--header-height) + 3rem) 0 calc(var(--hero-overlap) + 3rem);
|
||||
color: var(--white);
|
||||
background:
|
||||
var(--grain),
|
||||
linear-gradient(180deg, rgba(0, 0, 74, 0.55) 0, rgba(0, 0, 74, 0) 10rem),
|
||||
var(--hero-veil),
|
||||
#00004a;
|
||||
background: var(--grain), var(--galaxy-blue);
|
||||
border-bottom-right-radius: var(--radius-lg);
|
||||
}
|
||||
|
||||
@@ -265,7 +257,7 @@ button:hover .arrow {
|
||||
|
||||
/* Photo pulled up over the hero; flat, no shadow */
|
||||
.page-figure {
|
||||
margin: -9rem 0 4rem;
|
||||
margin: calc(-1 * var(--hero-overlap)) 0 4rem;
|
||||
}
|
||||
|
||||
.page-figure img {
|
||||
@@ -279,12 +271,13 @@ button:hover .arrow {
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
/* Two photos side by side, pulled up over the hero together */
|
||||
/* Two photos side by side (Home), pulled up over the hero together; they
|
||||
stack by themselves once each would be narrower than 18rem */
|
||||
.page-figures {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
|
||||
gap: 1.5rem;
|
||||
margin: -9rem 0 4rem;
|
||||
margin: calc(-1 * var(--hero-overlap)) 0 4rem;
|
||||
}
|
||||
|
||||
.page-figures .page-figure {
|
||||
@@ -448,38 +441,6 @@ button:hover .arrow {
|
||||
filter: brightness(1.1);
|
||||
}
|
||||
|
||||
/* Responsive page
|
||||
========================================================================== */
|
||||
|
||||
@media (max-width: 800px) {
|
||||
/* Text spans the full width here, so keep at least 50% navy everywhere */
|
||||
.page-hero {
|
||||
--hero-veil: linear-gradient(
|
||||
90deg,
|
||||
rgba(0, 0, 74, 0.72) 0%,
|
||||
rgba(0, 0, 74, 0.5) 100%
|
||||
);
|
||||
|
||||
padding-bottom: 8rem;
|
||||
border-bottom-right-radius: var(--radius-md);
|
||||
}
|
||||
|
||||
.page-hero--compact {
|
||||
padding-bottom: 4rem;
|
||||
}
|
||||
|
||||
.page-figure,
|
||||
.page-figures {
|
||||
margin-top: -6rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
.page-figures {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
/* Preferences
|
||||
========================================================================== */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user