Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update adobe/boilerplate #41

Merged
merged 43 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
f410871
add css rules to hide header and footer until they are loaded
shsteimer Dec 7, 2023
08a03db
fix: cards fail if text contains an icon
buuhuu Apr 19, 2024
6b99daa
fix: remove deprecated root var
fkakatie May 24, 2024
4be1344
feat: added updated fonts
fkakatie May 24, 2024
7a260c0
fix: apply s2 font styles
fkakatie May 24, 2024
afee66e
fix: increase body font size
fkakatie May 24, 2024
7b3ab37
chore: unify color vars against s2 spec
fkakatie May 24, 2024
d105bef
fix: increase color contrast between bg and link
fkakatie May 24, 2024
5722538
fix: increase contrast between link and text
fkakatie May 24, 2024
4a3d34f
fix: unify container padding, margins, radius
fkakatie May 29, 2024
51acbed
fix: link color meets background AND text contrast reqs
fkakatie Jun 6, 2024
dfe221a
fix: close the nav when it loses focus, e.g keyboard user tabs out of it
shsteimer Jun 13, 2024
caa123b
feat: section loader
davidnuescheler Jul 16, 2024
88af1ef
chore(deps): update dependency stylelint to v16.7.0 (#381)
renovate[bot] Jul 16, 2024
b20ffad
chore(deps): update dependency @babel/eslint-parser to v7.24.8 (#380)
renovate[bot] Jul 16, 2024
f9f0cda
chore(deps): update dependency stylelint-config-standard to v36.0.1 (…
renovate[bot] Jul 16, 2024
bd22328
feat(lib): update scripts/aem.js to aem.js@2.5.0 (#383)
adobe-bot Jul 16, 2024
8f226c2
feat: use rum js v2 (#371)
kptdobe Jul 16, 2024
516d856
Merge pull request #362 from adobe/unify-font
fkakatie Jul 30, 2024
fa63d2e
Merge branch 'main' into unify-color
fkakatie Jul 30, 2024
3fd179a
fix: a11y contrast fix
fkakatie Jul 30, 2024
91f0171
chore: lint
fkakatie Jul 30, 2024
1fb21ab
fix: a styles
fkakatie Jul 30, 2024
bb8e1bd
Merge pull request #363 from adobe/unify-color
fkakatie Jul 30, 2024
89875ad
Merge branch 'main' into unify-containers
fkakatie Jul 30, 2024
3e83daa
Merge pull request #364 from adobe/unify-containers
fkakatie Jul 30, 2024
82a84c5
Merge branch 'main' into issue-304-header-footer-cls
fkakatie Jul 30, 2024
8676c36
Merge pull request #305 from shsteimer/issue-304-header-footer-cls
fkakatie Jul 30, 2024
555e045
Merge pull request #354 from buuhuu/fix-cards-text-with-icon
fkakatie Jul 30, 2024
980829d
chore: lint
fkakatie Jul 30, 2024
66f47c4
Merge pull request #369 from shsteimer/header-nav-a11y-fix
fkakatie Jul 30, 2024
aaa920b
chore: a11y colors
fkakatie Aug 1, 2024
d83608a
fix: border color on cards
fkakatie Aug 1, 2024
d01adf4
fix: a11y header, ul > li role
fkakatie Aug 1, 2024
c0f0641
fix(lib): update scripts/aem.js to aem.js@2.5.1 (#388)
adobe-bot Aug 13, 2024
fd1eb97
chore(deps): update dependency @babel/eslint-parser to v7.25.1 (#385)
renovate[bot] Aug 13, 2024
1195d26
chore(deps): update dependency stylelint to v16.8.1 (#386)
renovate[bot] Aug 13, 2024
2b74bad
chore: add editor config (#353)
sippsolutions Aug 14, 2024
8f569fa
fix(lib): update scripts/aem.js to aem.js@2.5.2 (#391)
adobe-bot Aug 22, 2024
f6e144d
chore(deps): update dependency stylelint to v16.8.2 (#389)
renovate[bot] Aug 22, 2024
8d819d9
Merge remote-tracking branch 'upstream/main' into update
buuhuu Aug 27, 2024
ced8cee
fix: imports in editor-support.js
buuhuu Aug 27, 2024
974756b
Merge remote-tracking branch 'origin/main' into update
buuhuu Aug 29, 2024
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
5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[*.js]
indent_size = 2

[*.css]
indent_size = 4
2 changes: 1 addition & 1 deletion 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
}

main.error .error-number text {
font-family: var(--fixed-font-family);
font-family: monospace;
}
</style>
<link rel="stylesheet" href="/styles/lazy-styles.css">
Expand Down
10 changes: 3 additions & 7 deletions blocks/cards/cards.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
margin: 0;
padding: 0;
display: grid;
grid-template-columns: repeat(auto-fill, minmax(278px, 1fr));
grid-gap: 16px;
grid-template-columns: repeat(auto-fill, minmax(257px, 1fr));
grid-gap: 24px;
}

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

Expand All @@ -20,10 +20,6 @@
line-height: 0;
}

.cards .cards-card-body > *:first-child {
margin-top: 0;
}

.cards > ul > li img {
width: 100%;
aspect-ratio: 4 / 3;
Expand Down
2 changes: 1 addition & 1 deletion blocks/columns/columns.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
.columns > div {
align-items: center;
flex-direction: unset;
gap: 32px;
gap: 24px;
}

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

footer .footer {
max-width: 1200px;
footer .footer > div {
margin: auto;
max-width: 1200px;
padding: 40px 24px 24px;
}

footer .footer p {
margin: 0;
}

@media (width >= 900px) {
footer .footer > div {
padding: 40px 32px 24px;
}
}
14 changes: 1 addition & 13 deletions blocks/fragment/fragment.css
Original file line number Diff line number Diff line change
@@ -1,13 +1 @@
/* suppress nested section padding */
.fragment-wrapper > .section {
padding-left: 0;
padding-right: 0;
}

.fragment-wrapper > .section:first-of-type {
padding-top: 0;
}

.fragment-wrapper > .section:last-of-type {
padding-bottom: 0;
}
/* stylelint-disable no-empty-source */
4 changes: 2 additions & 2 deletions blocks/fragment/fragment.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from '../../scripts/scripts.js';

import {
loadBlocks,
loadSections,
} from '../../scripts/aem.js';

/**
Expand All @@ -36,7 +36,7 @@ export async function loadFragment(path) {
resetAttributeBase('source', 'srcset');

decorateMain(main);
await loadBlocks(main);
await loadSections(main);
return main;
}
}
Expand Down
35 changes: 14 additions & 21 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 2em;
gap: 0 24px;
margin: auto;
max-width: 1264px;
max-width: 1248px;
height: var(--nav-height);
padding: 0 1rem;
padding: 0 24px;
font-family: var(--body-font-family);
}

Expand All @@ -27,19 +27,16 @@ header nav[aria-expanded='true'] {
'sections sections' 1fr
'tools tools' var(--nav-height) / auto 1fr;
overflow-y: auto;
min-height: 100vh;
}

@media (width >= 600px) {
header nav {
padding: 0 2rem;
}
min-height: 100dvh;
}

@media (width >= 900px) {
header nav {
display: flex;
justify-content: space-between;
gap: 0 32px;
max-width: 1264px;
padding: 0 32px;
}

header nav[aria-expanded='true'] {
Expand Down Expand Up @@ -158,7 +155,6 @@ header nav .nav-sections {
flex: 1 1 auto;
display: none;
visibility: hidden;
background-color: var(--overlay-color);
}

header nav[aria-expanded='true'] .nav-sections {
Expand All @@ -171,19 +167,18 @@ header nav .nav-sections ul {
list-style: none;
padding-left: 0;
font-size: var(--body-font-size-s);
font-weight: 500;
}

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

header nav .nav-sections ul > li > ul {
margin-top: 0;
}

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

@media (width >= 900px) {
Expand Down Expand Up @@ -225,15 +220,13 @@ header nav .nav-sections ul > li > ul > li {

header nav .nav-sections ul {
display: flex;
gap: 2em;
gap: 24px;
margin: 0;
font-size: var(--body-font-size-xs);
}

header nav .nav-sections .default-content-wrapper > ul > li {
flex: 0 1 auto;
position: relative;
font-weight: 500;
}

header nav .nav-sections .default-content-wrapper > ul > li > ul {
Expand All @@ -244,10 +237,10 @@ 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;
left: -1em;
left: -24px;
width: 200px;
margin-top: 12px;
padding: 1em;
top: 150%;
padding: 16px;
background-color: var(--light-color);
white-space: initial;
}
Expand All @@ -256,7 +249,7 @@ header nav .nav-sections ul > li > ul > li {
content: '';
position: absolute;
top: -8px;
left: 8px;
left: 16px;
width: 0;
height: 0;
border-left: 8px solid transparent;
Expand Down
21 changes: 19 additions & 2 deletions blocks/header/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,21 @@ function closeOnEscape(e) {
}
}

function closeOnFocusLost(e) {
const nav = e.currentTarget;
if (!nav.contains(e.relatedTarget)) {
const navSections = nav.querySelector('.nav-sections');
const navSectionExpanded = navSections.querySelector('[aria-expanded="true"]');
if (navSectionExpanded && isDesktop.matches) {
// eslint-disable-next-line no-use-before-define
toggleAllNavSections(navSections, false);
} else if (!isDesktop.matches) {
// eslint-disable-next-line no-use-before-define
toggleMenu(nav, navSections, false);
}
}
}

function openOnKeydown(e) {
const focused = document.activeElement;
const isNavDrop = focused.className === 'nav-drop';
Expand Down Expand Up @@ -65,24 +80,26 @@ function toggleMenu(nav, navSections, forceExpanded = null) {
if (isDesktop.matches) {
navDrops.forEach((drop) => {
if (!drop.hasAttribute('tabindex')) {
drop.setAttribute('role', 'button');
drop.setAttribute('tabindex', 0);
drop.addEventListener('focus', focusNavSection);
}
});
} else {
navDrops.forEach((drop) => {
drop.removeAttribute('role');
drop.removeAttribute('tabindex');
drop.removeEventListener('focus', focusNavSection);
});
}

// enable menu collapse on escape keypress
if (!expanded || isDesktop.matches) {
// collapse menu on escape press
window.addEventListener('keydown', closeOnEscape);
// collapse menu on focus lost
nav.addEventListener('focusout', closeOnFocusLost);
} else {
window.removeEventListener('keydown', closeOnEscape);
nav.removeEventListener('focusout', closeOnFocusLost);
}
}

Expand Down
15 changes: 9 additions & 6 deletions blocks/hero/hero.css
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
main .hero-container > div {
.hero-container .hero-wrapper {
max-width: unset;
}

main .hero-container {
padding: 0;
}

.hero {
position: relative;
padding: 32px;
padding: 40px 24px;
min-height: 300px;
}

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

.hero picture {
Expand All @@ -32,3 +29,9 @@ main .hero-container {
width: 100%;
height: 100%;
}

@media (width >= 900px) {
.hero {
padding: 40px 32px;
}
}
Binary file added fonts/roboto-condensed-bold.woff2
Binary file not shown.
Binary file added fonts/roboto-medium.woff2
Binary file not shown.
Loading