Skip to content

Commit

Permalink
Solo theme improvements (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
minimaluminium authored Nov 11, 2022
1 parent 3357783 commit 794a89b
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 10 deletions.
53 changes: 44 additions & 9 deletions assets/css/screen.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@ figcaption {
padding: 0;
}

hr {
background-color: var(--color-border);
}

.gh-content h2 {
font-size: 2.25em;
letter-spacing: -0.03em;
}

.gh-content h3 {
font-size: 1.6em;
}

.gh-canvas {
grid-template-columns: repeat(12, minmax(0, 1fr));
}
Expand Down Expand Up @@ -151,6 +164,7 @@ figcaption {
max-width: 840px;
font-size: clamp(2.4rem, 0.54vw + 2.14rem, 3rem);
font-weight: 500;
letter-spacing: -0.008em;
}

.has-serif-font .gh-about-secondary {
Expand Down Expand Up @@ -351,25 +365,46 @@ figcaption {
align-items: center;
}

.gh-card-meta > * + *:not(script)::before {
.gh-card-meta > * + *:not(script):not(.gh-card-access)::before {
width: 2px;
height: 2px;
content: "";
background-color: currentColor;
border-radius: 50%;
}

.gh-card-access {
padding: 0 10px 0 8px;
margin-left: 4px;
background-color: var(--color-border);
border-radius: 40px;
}

.has-parallax-feed .gh-card-access {
color: var(--color-darker-gray);
background-color: var(--color-white);
}

.gh-card-access svg {
margin-right: -5px;
}

/* Classic feed
/* ---------------------------------------------------------- */

.has-classic-feed .gh-card.no-image {
max-width: 1200px;
}

.has-classic-feed .gh-card + .gh-card {
margin-top: clamp(4.8rem, 4rem + 2.5vw, 8rem);
}

.has-classic-feed .gh-card + .gh-card.no-image,
.has-classic-feed .gh-card.no-image + .gh-card {
margin-top: clamp(8rem, 7.14vw + 4.57rem, 16rem);
}

.has-classic-feed .gh-card-link {
display: flex;
flex-direction: row-reverse;
Expand All @@ -388,7 +423,7 @@ figcaption {
}

.has-classic-feed .no-image .gh-card-image {
background-color: var(--tag-color, var(--color-lighter-gray));
display: none;
}

.has-classic-feed .gh-card-image img {
Expand Down Expand Up @@ -626,6 +661,10 @@ figcaption {
line-height: 1.45;
}

.page-template .no-image .gh-article-excerpt {
grid-column: 4 / span 6;
}

.has-serif-font .gh-article-excerpt {
font-family: var(--font-serif);
}
Expand All @@ -651,11 +690,7 @@ figcaption {
line-height: 1.7;
}

.post-template .no-image .gh-content {
margin-top: 0;
}

.page-template .no-image .gh-content {
:is(.post-template, .page-template) .no-image .gh-content {
margin-top: clamp(4rem, 2.14vw + 2.97rem, 6.4rem);
}

Expand Down Expand Up @@ -740,14 +775,14 @@ figcaption {
z-index: 20;
grid-column: 1 / span 12 !important;
padding: clamp(8rem, 10.71vw + 2.86rem, 20rem) clamp(4.8rem, 4.64vw + 2.57rem, 10rem);
margin-top: clamp(6.4rem, 5vw + 4rem, 12rem);
margin-top: clamp(8rem, 7.14vw + 4.57rem, 16rem);
background-color: var(--color-lighter-gray);
transform: translate3d(0, 0, 0);
}

.gh-cta-title {
margin-bottom: 24px;
font-size: clamp(3.6rem, 1.79vw + 2.74rem, 5.6rem);
font-size: clamp(3rem, 0.71vw + 2.66rem, 3.8rem);
font-weight: 800;
letter-spacing: -0.03em;
}
Expand Down
15 changes: 15 additions & 0 deletions assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,21 @@ function pagination(isInfinite = true, done) {
observer.observe(target);
}

(function () {
if (!document.body.classList.contains('has-background-about')) return;

const about = document.querySelector('.gh-about');
if (!about) return;

const image = about.querySelector('.gh-about-image');

if (!image.naturalWidth) {
imagesLoaded(image, function () {
about.style.setProperty('--about-height', image.clientWidth * image.naturalHeight / image.naturalWidth + 'px');
});
}
})();

(function () {
initParallax();
})();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"header_section_layout": {
"type": "select",
"options": ["Side by side", "Large background", "Typographic profile"],
"default": "Side by side",
"default": "Large background",
"group": "homepage"
},
"primary_header": {
Expand Down

0 comments on commit 794a89b

Please sign in to comment.