Skip to content

Commit

Permalink
Merge pull request #41 from adobecom/blog
Browse files Browse the repository at this point in the history
MWPW-141918 Blog Template & Blog Posts
  • Loading branch information
vhargrave committed Aug 7, 2024
2 parents f8f8497 + d1279bc commit ce00c46
Show file tree
Hide file tree
Showing 13 changed files with 1,194 additions and 188 deletions.
297 changes: 297 additions & 0 deletions express/blocks/blog-posts/blog-posts.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,297 @@
.blog main .section:has(.blog-posts-wrapper) > div:first-child {
padding: 0;
margin-top: 64px;
}

main .section:has(.blog-posts-wrapper) > div {
max-width: 375px;
margin: auto;
padding: 0;
}

main .section:has(.blog-posts-wrapper) > .content:first-child, main .section > .blog-posts-wrapper:first-child {
padding-top: 60px
}

.blog main .section:has(.blog-posts-wrapper) > div > h2, main .section:has(.blog-posts) div.blog-posts-decoration {
max-width: 280px;
}

main .section:has(.blog-posts-wrapper) div.blog-posts-decoration {
display: flex;
justify-content: space-between;
}

main .section:has(.blog-posts) div.blog-posts-decoration p {
margin: 0;
font-family: var(--body-serif-font-family);
}

main .section:has(.blog-posts) div.blog-posts-decoration p a {
margin: 0;
font-family: var(--body-font-family);
}

main .blog-posts .blog-cards {
display: flex;
flex-wrap: wrap;
justify-content: center;
margin: 0 16px 64px 16px;
width: unset;
}

main .blog-posts {
text-align: center;
}

main .blog-posts .blog-card, main .blog-posts .blog-hero-card {
cursor: pointer;
text-decoration: unset;
color: unset;
text-align: left;
}

main .blog-posts .blog-card {
display: grid;
grid-template-areas: 'title title' 'teaser image' 'date image';
width: 350px;
margin: 28px;
}

main .blog-posts .blog-hero-card {
display: flex;
flex-direction: column-reverse;
width: 100%;
max-width: 530px;
margin: 80px auto;
}

main .blog-posts .blog-card > p, main .blog-posts .blog-hero-card > p {
margin: 0;
}

main .blog-posts .blog-card .blog-card-image {
line-height: 0;
grid-area: image;
margin: 0;
margin-left: 16px;
height: 92px;
width: 126px;
}

main .blog-posts .blog-hero-card .blog-card-image {
line-height: 0;
grid-area: image;
margin: 0;
height: 276px;
}

main .blog-posts .blog-card .blog-card-image img {
object-fit: cover;
height: 100%;
width: 100%;
border-radius: 6px;
}

main .blog-posts .blog-hero-card .blog-card-image img {
height: 100%;
width: 100%;
margin: auto;
display: block;
object-fit: cover;
}

main .blog-posts .blog-card h3.blog-card-title {
font-size: var(--heading-font-size-s);
line-height: var(--heading-line-height);
text-align: left;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
grid-area: title;
margin-bottom: 16px;
margin-top: 0;
}

main .blog-posts .blog-hero-card h3.blog-card-title {
font-size: var(--heading-font-size-xl);
line-height: var(--heading-line-height);
text-align: left;
grid-area: title;
margin: 0 24px;
}

main .blog-posts .blog-card p.blog-card-teaser {
font-size: var(--body-font-size-m);
line-height: var(--body-line-height);
font-weight: normal;
font-family: var(--body-serif-font-family);
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
grid-area: teaser;
}


main .blog-posts .blog-hero-card p.blog-card-teaser {
font-family: var(--body-serif-font-family);
font-size: var(--body-font-size-l);
text-align: left;
grid-area: teaser;
font-weight: normal;
margin: 24px;
}

main .blog-posts p.blog-card-date {
font-size: var(--body-font-size-s);
line-height: var(--body-line-height);
font-family: var(--body-serif-font-family);
font-weight: var(--heading-font-weight);
grid-area: date;
}

main .blog-posts .blog-hero-card p.blog-card-date {
margin: 32px 0 32px 24px;
}

main .blog-posts .blog-hero-card p.blog-card-cta {
grid-area: cta;
text-align: left;
margin-top: 14px;
margin-bottom: 30px;
margin-left: 24px;
}

main .blog-posts .blog-hero-card p.blog-card-cta a {
margin-left: 0;
}

main .blog-posts .card {
display: flex;
flex-direction: column;
width: 290px;
margin: 10px;
text-align: left;
cursor: pointer;
}
main .blog-posts .card .card-image {
line-height: 0;
}

main .blog-posts .card .card-image img {
height: 200px;
object-fit: cover;
width: 100%;
}

main .blog-posts .card .card-body {
padding: 20px;
border: 1px solid lightgrey;
border-radius: 0 0 5px 5px;
border-top: none;
height: 300px;
}

main .blog-posts .card .card-body p {
font-size: 1rem;
}

main .section:has(.blog-posts) > .content >h2 {
margin-top: 80px;
}

main .section:has(.blog-posts) > .content >h3 {
margin-top: 64px;
}

main .section:has(.blog-posts) > .content {
padding: 0;
}

@media (min-width: 900px) {
main .blog-posts .blog-card .blog-card-image {
margin: 0 0 24px 0;
border-radius: 10px;
height: 235px;
width: 325px;
}

main .blog-posts .blog-hero-card .blog-card-image {
min-width: 488px;
max-width: 488px;
height: 274px;
}

main .blog-posts .blog-card {
grid-template-areas: 'image' 'title' 'teaser' 'date';
width: 325px;
}

main .blog-posts .blog-hero-card {
flex-direction: unset;
max-width: 1200px;
align-items: center;
margin: 56px auto;
}

main .blog-posts .blog-card h3.blog-card-title {
font-size: var(--heading-font-size-m);
margin: 0 0 24px 0;
}

main .blog-posts .blog-hero-card p.blog-card-cta {
margin-bottom: 0px;
}

main .blog-posts .blog-hero-card p.blog-card-cta a {
margin-bottom: 0px;
}

main .section:has(.blog-posts) > div, main .section:has(.blog-posts) > .content {
max-width: 900px;
}

.blog main .section:has(.blog-posts) > div > h2, main .section:has(.blog-posts) div.blog-posts-decoration {
max-width: 700px;
}
}

@media (min-width: 1200px) {
main .section:has(.blog-posts) > div, main .section:has(.blog-posts) > .content {
max-width: 1200px;
}

main .blog-posts .blog-hero-card .blog-card-image {
min-width: 600px;
max-width: 600px;
height: 338px;
}

.blog main .section:has(.blog-posts) > div > h2, main .section:has(.blog-posts) div.blog-posts-decoration {
max-width: 1088px;
}
}

/* Japanese font styles */
:lang(ja) main .section:has(.blog-posts) div.blog-posts-decoration p {
font-family: var(--body-font-family);
}

:lang(ja) main .blog-posts .blog-card p.blog-card-teaser {
font-family: var(--body-font-family);
}

:lang(ja) main .blog-posts .blog-hero-card p.blog-card-teaser {
font-family: var(--body-font-family);
}

:lang(ja) main .blog-posts p.blog-card-date {
font-family: var(--body-font-family);
font-weight: var(--body-font-weight);
}

:lang(ja) main .blog-posts-container div.blog-posts-decoration p {
font-family: var(--body-font-family);
}
Loading

0 comments on commit ce00c46

Please sign in to comment.