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
6 changes: 2 additions & 4 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
Please always provide the [GitHub issue(s)](../issues) your PR is for, as well as test URLs where your change can be observed (before and after):

Fix #<gh-issue-id>

Test URLs:
- Before: https://main--{repo}--{owner}.aem.live/
- After: https://<branch>--{repo}--{owner}.aem.live/
- Before: https://main--rbc--aemsites.aem.live/
- After: https://<branch>--rbc--aemsites.aem.live/
56 changes: 0 additions & 56 deletions .github/workflows/cleanup-on-create.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions .github/workflows/sync-block-collection.yaml

This file was deleted.

6 changes: 3 additions & 3 deletions blocks/cards/cards.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
padding: 0;
display: grid;
grid-template-columns: repeat(auto-fill, minmax(257px, 1fr));
gap: 24px;
gap: var(--space-l);
}

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

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

.cards .cards-card-image {
Expand Down
14 changes: 10 additions & 4 deletions blocks/columns/columns.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.columns > div {
display: flex;
flex-direction: column;
gap: var(--space-l);
}

.columns img {
Expand All @@ -19,15 +20,20 @@
display: block;
}

@media (width >= 900px) {
@media (width >= 768px) {
.columns > div {
display: grid;
grid-template-columns: repeat(2, 1fr);
align-items: center;
flex-direction: unset;
gap: 24px;
}

.columns > div > div {
flex: 1;
order: unset;
}
}

@media (width >= 1024px) {
.columns > div {
grid-template-columns: repeat(var(--columns-count, 2), 1fr);
}
}
1 change: 1 addition & 0 deletions blocks/columns/columns.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export default function decorate(block) {
const cols = [...block.firstElementChild.children];
block.classList.add(`columns-${cols.length}-cols`);
block.style.setProperty('--columns-count', cols.length);

// setup image columns
[...block.children].forEach((row) => {
Expand Down
8 changes: 4 additions & 4 deletions blocks/footer/footer.css
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
footer {
background-color: var(--light-color);
background-color: var(--rbc-cool-white);
font-size: var(--body-font-size-xs);
}

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

footer .footer p {
margin: 0;
}

@media (width >= 900px) {
@media (width >= 768px) {
footer .footer > div {
padding: 40px 32px 24px;
padding: var(--space-2xl) var(--space-xl) var(--space-l);
}
}
26 changes: 13 additions & 13 deletions blocks/header/header.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ header nav {
'hamburger brand tools' var(--nav-height)
'sections sections sections' 1fr / auto 1fr auto;
align-items: center;
gap: 0 24px;
gap: 0 var(--space-l);
margin: auto;
max-width: 1248px;
height: var(--nav-height);
padding: 0 24px;
padding: 0 var(--space-l);
font-family: var(--body-font-family);
}

Expand All @@ -30,17 +30,17 @@ header nav[aria-expanded='true'] {
min-height: 100dvh;
}

@media (width >= 900px) {
@media (width >= 768px) {
header .nav-wrapper {
position: relative;
}

header nav {
display: flex;
justify-content: space-between;
gap: 0 32px;
gap: 0 var(--space-xl);
max-width: 1264px;
padding: 0 32px;
padding: 0 var(--space-xl);
}

header nav[aria-expanded='true'] {
Expand Down Expand Up @@ -132,7 +132,7 @@ header nav[aria-expanded='true'] .nav-hamburger-icon::after {
transform: rotate(-45deg);
}

@media (width >= 900px) {
@media (width >= 768px) {
header nav .nav-hamburger {
display: none;
visibility: hidden;
Expand Down Expand Up @@ -185,7 +185,7 @@ header nav .nav-sections ul > li > ul > li {
font-weight: 400;
}

@media (width >= 900px) {
@media (width >= 768px) {
header nav .nav-sections {
display: block;
visibility: visible;
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 @@ -224,7 +224,7 @@ header nav .nav-sections ul > li > ul > li {

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

Expand All @@ -244,8 +244,8 @@ header nav .nav-sections ul > li > ul > li {
left: -24px;
width: 200px;
top: 150%;
padding: 16px;
background-color: var(--light-color);
padding: var(--space-s);
background-color: var(--rbc-cool-white);
white-space: initial;
}

Expand All @@ -258,11 +258,11 @@ header nav .nav-sections ul > li > ul > li {
height: 0;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
border-bottom: 8px solid var(--light-color);
border-bottom: 8px solid var(--rbc-cool-white);
}

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

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

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

Expand All @@ -30,8 +30,8 @@
height: 100%;
}

@media (width >= 900px) {
@media (width >= 768px) {
.hero {
padding: 40px 32px;
padding: var(--space-2xl) var(--space-xl);
}
}
Binary file added fonts/rbc-display-bold.woff2
Binary file not shown.
Binary file added fonts/rbc-display-medium.woff2
Binary file not shown.
Binary file added fonts/rbc-display-regular.woff2
Binary file not shown.
Binary file removed fonts/roboto-condensed-bold.woff2
Binary file not shown.
34 changes: 34 additions & 0 deletions scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,39 @@ function decorateButtons(main) {
});
}

const IMAGE_EXT_RE = /\.(png|jpe?g|webp|gif|svg)(\?.*)?$/i;
const HEX_RE = /#[0-9a-f]{3,8}/gi;

function hexLuminance(hex) {
const h = hex.replace('#', '');
const full = h.length === 3 ? h.replace(/./g, '$&$&') : h;
const [r, g, b] = [0, 2, 4].map((i) => parseInt(full.slice(i, i + 2), 16));
return (0.2126 * r + 0.7152 * g + 0.0722 * b) / 255;
}

function isDarkBackground(color) {
const hexes = String(color).match(HEX_RE);
if (!hexes) return false;
return hexes.reduce((sum, h) => sum + hexLuminance(h), 0) / hexes.length < 0.5;
}

function decorateSectionBackgrounds(main) {
main.querySelectorAll('.section[data-background]').forEach((section) => {
const { background } = section.dataset;
if (!background) return;
if (IMAGE_EXT_RE.test(background)) {
const { pathname } = new URL(background, window.location.href);
section.style.backgroundImage = `url('${pathname}?width=2000&format=webply&optimize=medium')`;
section.style.backgroundSize = 'cover';
section.style.backgroundPosition = 'center';
} else {
section.style.background = background;
}
section.classList.add('colored-background');
section.classList.add(isDarkBackground(background) ? 'dark-background' : 'light-background');
});
}

/**
* Decorates the main element.
* @param {Element} main The main element
Expand All @@ -151,6 +184,7 @@ export function decorateMain(main) {
decorateIcons(main);
buildAutoBlocks(main);
decorateSections(main);
decorateSectionBackgrounds(main);
decorateBlocks(main);
decorateButtons(main);
}
Expand Down
34 changes: 26 additions & 8 deletions styles/fonts.css
Original file line number Diff line number Diff line change
@@ -1,36 +1,54 @@
/* stylelint-disable max-line-length */
@font-face {
font-family: roboto-condensed;
font-family: roboto;
font-style: normal;
font-weight: 700;
font-display: swap;
src: url('../fonts/roboto-condensed-bold.woff2') format('woff2');
src: url('../fonts/roboto-bold.woff2') format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
font-family: roboto;
font-style: normal;
font-weight: 700;
font-weight: 500;
font-display: swap;
src: url('../fonts/roboto-bold.woff2') format('woff2');
src: url('../fonts/roboto-medium.woff2') format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
font-family: roboto;
font-style: normal;
font-weight: 500;
font-weight: 400;
font-display: swap;
src: url('../fonts/roboto-medium.woff2') format('woff2');
src: url('../fonts/roboto-regular.woff2') format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
font-family: roboto;
font-family: rbc-display;
font-style: normal;
font-weight: 400;
font-display: swap;
src: url('../fonts/roboto-regular.woff2') format('woff2');
src: url('../fonts/rbc-display-regular.woff2') format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
font-family: rbc-display;
font-style: normal;
font-weight: 500;
font-display: swap;
src: url('../fonts/rbc-display-medium.woff2') format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
font-family: rbc-display;
font-style: normal;
font-weight: 700;
font-display: swap;
src: url('../fonts/rbc-display-bold.woff2') format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
Loading