Skip to content

Commit

Permalink
Merge branch 'main' into KAW-7682-heading-marker
Browse files Browse the repository at this point in the history
  • Loading branch information
TomaszDziezykNetcentric committed Jul 25, 2024
2 parents 0276ef0 + 591cd07 commit 7158c4e
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 5 deletions.
8 changes: 8 additions & 0 deletions blocks/image/image.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.block.image picture {
display: flex;
}

.block.image img {
width: 100%;
object-fit: cover;
}
3 changes: 3 additions & 0 deletions blocks/image/image.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default async function decorate() {
// JS code
}
9 changes: 9 additions & 0 deletions scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ function customDecorateSections(main) {
});
}

function customDecorateBlocks(main) {
main.querySelectorAll('div.section > div > div').forEach((block) => {
if (block.classList.contains('full-width')) {
block.parentElement.classList.add('wrapper-full-width');
}
});
}

/**
* Decorates the main element.
* @param {Element} main The main element
Expand All @@ -78,6 +86,7 @@ export function decorateMain(main) {
decorateSections(main);
customDecorateSections(main);
decorateBlocks(main);
customDecorateBlocks(main);
}

/**
Expand Down
32 changes: 27 additions & 5 deletions styles/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@

/* nav height */
--nav-height: 64px;

/* section paddings */
--section-y-padding: 15px;
--section-x-padding: 40px;
}

body {
Expand Down Expand Up @@ -217,18 +221,24 @@ div[class$="-wrapper"]:not(:first-child) {

/* sections */
main .section {
padding: 40px 15px;
padding: var(--section-y-padding) var(--section-x-padding);
}

main .section:last-child {
padding-bottom: 0;
}

@media (width >= 768px) {
main .section {
padding: 40px 30px;
:root {
--section-y-padding: 40px;
--section-x-padding: 30px;
}
}

@media (width >= 960px) {
main .section {
padding: 70px 40px;
:root {
--section-y-padding: 70px;
--section-x-padding: 40px;
}

.section > div {
Expand All @@ -251,6 +261,18 @@ main .section {
}
}

/* full width styles */
.section .wrapper-full-width {
margin: 0;
width: 100%;
max-width: 100vw;
}

.block.full-width {
margin-left: calc(-1 * var(--section-x-padding));
margin-right: calc(-1 * var(--section-x-padding));
}

/* section metadata */
main .section.light,
main .section.highlight {
Expand Down

0 comments on commit 7158c4e

Please sign in to comment.