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

Version 0.1.5 #48

Merged
merged 10 commits into from
May 22, 2024
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
26 changes: 21 additions & 5 deletions assets/js/accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@ const closeAccordion = (accordion) => {
content.style.maxHeight = null;
};

// If sticky_header add not small screen size, offset of 80/100 based on device width.
const getScrollOffset = () => {
// Based on .header.stick media breakpoints.
const isSmallCategory = window.innerWidth >= 515 && window.innerHeight <= 615;

if (isSmallCategory) {
return 0;
} else if (window.innerWidth < 1000) {
return stickyHeader ? 80 : 0;
} else {
return stickyHeader ? 100 : 0;
}
};

accordions.forEach((accordion) => {
const title = accordion.querySelector(".accordion__title");
const content = accordion.querySelector(".accordion__content");
Expand All @@ -23,13 +37,15 @@ accordions.forEach((accordion) => {
accordions.forEach((accordion) => closeAccordion(accordion));
openAccordion(accordion);

// Use setTimeout to wait a moment before scrolling into view
// Use setTimeout to wait a moment before scrolling into view.
setTimeout(() => {
accordion.scrollIntoView({
behavior: 'smooth',
block: 'start'
const offset = getScrollOffset();
const elementTop = accordion.getBoundingClientRect().top;
window.scrollBy({
top: elementTop - offset,
behavior: 'smooth'
});
}, 500);
}, 250);
}
};
});
2 changes: 1 addition & 1 deletion assets/scss/_blog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
margin-block-start: 0;
margin-block-end: 0;
color: #000;
font-family: Nunito;
font-family: var(--rounded-font-family);
font-size: 14px;
@media (min-width: 600px) {
font-size: 16px;
Expand Down
33 changes: 26 additions & 7 deletions assets/scss/_breadcrumb.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
.breadcrumb {
.breadcrumbs {
margin-block-start: 70px;
margin-block-end: 0;
@media (min-width: $desktop-width) {
margin-block-start: 100px;
margin-block-end: 0;
}
font-family: Nunito;
font-family: var(--rounded-font-family);
}

.breadcrumbs-list {
list-style-image: none;
display: flex;
align-items: baseline;
gap: 10px;
flex-wrap: wrap;
list-style: none;
padding-inline-start: 0;
}

.breadcrumb {
font-size: 14px;
@media (min-width: 600px) {
font-size: 16px;
Expand All @@ -21,13 +34,19 @@
}
}

.breadcrumb + .title,
.breadcrumb + h1,
.breadcrumb + .h1 {
margin-block-start: 30px;
.breadcrumb + .breadcrumb::before {
content: "»";
margin-right: 5px;
color: var(--gray-600);
}

.breadcrumbs + .title,
.breadcrumbs + h1,
.breadcrumbs + .h1 {
margin-block-start: 20px;
margin-block-end: 50px;
@media (min-width: $desktop-width) {
margin-block-start: 60px;
margin-block-start: 50px;
margin-block-end: 80px;
}
}
2 changes: 1 addition & 1 deletion assets/scss/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
display: block;
color: var(--menu-link-color);
text-decoration: none;
font-family: Nunito;
font-family: var(--rounded-font-family);
font-size: 16px;
font-style: normal;
font-weight: 700;
Expand Down
5 changes: 3 additions & 2 deletions exampleSite/config/_default/languages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ en:
### copyright (markdown can be used) ###
copyright: "Copyright &copy; {{< current_year >}} Company Name. All Rights Reserved. [Dot Org Theme](https://github.com/cncf/dot-org-hugo-theme) for Hugo by [CNCF](https://www.cncf.io)."
title: "Site Title"
description: "Site Description"
params:
description: "Site Description"
### accessibility ###
accessibility:
skip_text: "Skip to content"
Expand Down Expand Up @@ -83,7 +83,8 @@ es:
contentDir: content/es
weight: 2
title: "Título del Sitio"
description: "Descripción del Sitio"
params:
description: "Descripción del Sitio"
menu:
main:
- identifier: "about"
Expand Down
Loading