Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions blocks/cards/cards.css
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
.cards > ul {
list-style: none;
margin: 0;
padding: 0;
display: grid;
grid-template-columns: repeat(auto-fill, minmax(257px, 1fr));
gap: 24px;
gap: var(--space-m);
margin: 0;
padding: 0;
}

.cards > ul > li {
border: 1px solid #dadada;
background-color: var(--background-color);
border: 1px solid var(--color-border);
background-color: var(--color-bg);
}

.cards .cards-card-body {
margin: 16px;
margin: var(--space-s);
}

.cards .cards-card-image {
Expand Down
4 changes: 2 additions & 2 deletions blocks/columns/columns.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

@media (width >= 900px) {
.columns > div {
align-items: center;
flex-direction: unset;
gap: 24px;
align-items: center;
gap: var(--space-m);
}

.columns > div > div {
Expand Down
10 changes: 5 additions & 5 deletions blocks/footer/footer.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
footer {
background-color: var(--light-color);
font-size: var(--body-font-size-xs);
background-color: var(--color-bg-light);
font-size: var(--text-s);
}

footer .footer > div {
max-width: var(--site-width);
margin: auto;
max-width: 1200px;
padding: 40px 24px 24px;
padding: var(--space-l) var(--space-m) var(--space-m);
}

footer .footer p {
Expand All @@ -15,6 +15,6 @@ footer .footer p {

@media (width >= 900px) {
footer .footer > div {
padding: 40px 32px 24px;
padding: var(--space-l) var(--space-l) var(--space-m);
}
}
74 changes: 37 additions & 37 deletions blocks/header/header.css
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
/* header and nav layout */
header .nav-wrapper {
background-color: var(--background-color);
width: 100%;
z-index: 2;
position: fixed;
z-index: 2;
width: 100%;
background-color: var(--color-bg);
}

header nav {
box-sizing: border-box;
display: grid;
grid-template:
'hamburger brand tools' var(--nav-height)
'sections sections sections' 1fr / auto 1fr auto;
align-items: center;
gap: 0 24px;
margin: auto;
max-width: 1248px;
gap: 0 var(--space-m);
box-sizing: border-box;
height: var(--nav-height);
padding: 0 24px;
max-width: 1248px;
margin: auto;
padding: 0 var(--space-m);
font-family: var(--body-font-family);
}

Expand All @@ -38,14 +38,14 @@ header nav[aria-expanded='true'] {
header nav {
display: flex;
justify-content: space-between;
gap: 0 32px;
gap: 0 var(--space-l);
max-width: 1264px;
padding: 0 32px;
padding: 0 var(--space-l);
}

header nav[aria-expanded='true'] {
min-height: 0;
overflow: visible;
min-height: 0;
}
}

Expand All @@ -60,31 +60,31 @@ header nav a:any-link {

/* hamburger */
header nav .nav-hamburger {
grid-area: hamburger;
height: 22px;
display: flex;
grid-area: hamburger;
align-items: center;
height: 22px;
}

header nav .nav-hamburger button {
overflow: initial;
height: 22px;
margin: 0;
border: 0;
border-radius: 0;
padding: 0;
background-color: var(--background-color);
background-color: var(--color-bg);
color: inherit;
overflow: initial;
text-overflow: initial;
white-space: initial;
}

header nav .nav-hamburger-icon,
header nav .nav-hamburger-icon::before,
header nav .nav-hamburger-icon::after {
box-sizing: border-box;
display: block;
position: relative;
box-sizing: border-box;
width: 20px;
}

Expand Down Expand Up @@ -119,11 +119,11 @@ header nav[aria-expanded='true'] .nav-hamburger-icon::before,
header nav[aria-expanded='true'] .nav-hamburger-icon::after {
top: 3px;
left: 1px;
transform: rotate(45deg);
transform-origin: 2px 1px;
width: 24px;
height: 2px;
width: 24px;
border-radius: 2px;
transform: rotate(45deg);
transform-origin: 2px 1px;
}

header nav[aria-expanded='true'] .nav-hamburger-icon::after {
Expand All @@ -141,40 +141,40 @@ header nav[aria-expanded='true'] .nav-hamburger-icon::after {

/* brand */
header .nav-brand {
grid-area: brand;
flex-basis: 128px;
font-size: var(--heading-font-size-s);
grid-area: brand;
font-size: var(--heading-s);
font-weight: 700;
line-height: 1;
}

header nav .nav-brand img {
width: 128px;
height: auto;
width: 128px;
}

/* sections */
header nav .nav-sections {
grid-area: sections;
flex: 1 1 auto;
display: none;
flex: 1 1 auto;
grid-area: sections;
visibility: hidden;
}

header nav[aria-expanded='true'] .nav-sections {
display: block;
visibility: visible;
align-self: start;
visibility: visible;
}

header nav .nav-sections ul {
list-style: none;
padding-left: 0;
font-size: var(--body-font-size-s);
font-size: var(--text-m);
}

header nav .nav-sections ul > li {
font-weight: 500;
font-weight: 400;
}

header nav .nav-sections ul > li > ul {
Expand All @@ -198,7 +198,7 @@ header nav .nav-sections ul > li > ul > li {

header nav .nav-sections .nav-drop {
position: relative;
padding-right: 16px;
padding-right: var(--space-s);
cursor: pointer;
}

Expand All @@ -208,12 +208,12 @@ header nav .nav-sections ul > li > ul > li {
position: absolute;
top: 0.5em;
right: 2px;
transform: rotate(135deg);
width: 6px;
height: 6px;
width: 6px;
border: 2px solid currentcolor;
border-radius: 0 1px 0 0;
border-width: 2px 2px 0 0;
transform: rotate(135deg);
}

header nav .nav-sections .nav-drop[aria-expanded='true']::after {
Expand All @@ -224,7 +224,7 @@ header nav .nav-sections ul > li > ul > li {

header nav .nav-sections ul {
display: flex;
gap: 24px;
gap: var(--space-m);
margin: 0;
}

Expand All @@ -241,11 +241,11 @@ header nav .nav-sections ul > li > ul > li {
header nav .nav-sections .default-content-wrapper > ul > li[aria-expanded='true'] > ul {
display: block;
position: absolute;
top: 150%;
left: -24px;
width: 200px;
top: 150%;
padding: 16px;
background-color: var(--light-color);
padding: var(--space-s);
background-color: var(--color-bg-light);
white-space: initial;
}

Expand All @@ -254,15 +254,15 @@ header nav .nav-sections ul > li > ul > li {
position: absolute;
top: -8px;
left: 16px;
width: 0;
height: 0;
width: 0;
border-left: 8px solid transparent;
border-bottom: 8px solid var(--color-bg-light);
border-right: 8px solid transparent;
border-bottom: 8px solid var(--light-color);
}

header nav .nav-sections .default-content-wrapper > ul > li > ul > li {
padding: 8px 0;
padding: var(--space-xs) 0;
}
}

Expand Down
18 changes: 9 additions & 9 deletions blocks/hero/hero.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,33 @@

.hero {
position: relative;
padding: 40px 24px;
min-height: 300px;
padding: var(--space-l) var(--space-m);
}

.hero h1 {
max-width: 1200px;
max-width: var(--site-width);
margin-left: auto;
margin-right: auto;
color: var(--background-color);
color: var(--color-bg);
}

.hero picture {
position: absolute;
z-index: -1;
inset: 0;
object-fit: cover;
z-index: -1;
box-sizing: border-box;
object-fit: cover;
}

.hero img {
object-fit: cover;
width: 100%;
height: 100%;
width: 100%;
object-fit: cover;
}

@media (width >= 900px) {
.hero {
padding: 40px 32px;
padding: var(--space-l) var(--space-l);
}
}
}
Binary file removed fonts/roboto-medium.woff2
Binary file not shown.
35 changes: 35 additions & 0 deletions scripts/aem.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ function wrapTextNodes(block) {
'UL',
'OL',
'PICTURE',
'BLOCKQUOTE',
'TABLE',
'H1',
'H2',
Expand Down Expand Up @@ -440,6 +441,7 @@ function decorateIcon(span, prefix = '', alt = '') {
img.width = 16;
img.height = 16;
span.append(img);
if (window.iconObserver) window.iconObserver.observe(img);
}

/**
Expand All @@ -452,6 +454,39 @@ function decorateIcons(element, prefix = '') {
icons.forEach((span) => {
decorateIcon(span, prefix);
});

window.iconObserver = window.iconObserver || new IntersectionObserver((entries) => {
entries.forEach((entry) => {
if (!entry.isIntersecting) return;
window.iconObserver.unobserve(entry.target);
const img = entry.target;
const { src } = img;
window.iconCache = window.iconCache || new Map();
if (!window.iconCache.has(src)) {
window.iconCache.set(src, fetch(src).then((r) => r.text()));
}
window.iconCache.get(src).then((svgText) => {
const temp = document.createElement('div');
temp.innerHTML = svgText;
const svg = temp.querySelector('svg');
if (!svg || !img.isConnected) return;
const titleEl = svg.querySelector('title');
const title = titleEl && titleEl.textContent;
if (!svgText.toLowerCase().includes('currentcolor')) {
if (title) img.alt = title;
return;
}
svg.setAttribute('focusable', false);
if (title) {
svg.setAttribute('role', 'img');
svg.setAttribute('aria-label', title);
} else {
svg.setAttribute('aria-hidden', true);
}
img.replaceWith(svg);
});
});
});
}

/**
Expand Down
Loading