kollapsminoriteten/wp-content/plugins/jetpack/modules/related-posts/related-posts.css

348 lines
7.3 KiB
CSS
Raw Normal View History

2019-11-15 23:26:29 +01:00
/**
* Jetpack related posts
*/
/**
* The Gutenberg block
*/
2024-02-16 11:03:01 +01:00
.jp-related-posts-i2 {
2019-11-15 23:26:29 +01:00
margin-top: 1.5rem;
}
2024-02-16 11:03:01 +01:00
.jp-related-posts-i2__list {
--hgap: 1rem;
display: flex;
flex-wrap: wrap;
column-gap: var(--hgap);
row-gap: 2rem;
margin: 0;
padding: 0;
list-style-type: none;
2019-11-15 23:26:29 +01:00
}
.jp-related-posts-i2__post {
display: flex;
flex-direction: column;
2025-05-07 06:48:41 +02:00
2024-02-16 11:03:01 +01:00
/* Default: 2 items by row */
2025-08-27 08:44:30 +02:00
flex-basis: calc(( 100% - var(--hgap) ) / 2);
2019-11-15 23:26:29 +01:00
}
2024-02-16 11:03:01 +01:00
/* Quantity qeuries: see https://alistapart.com/article/quantity-queries-for-css/ */
.jp-related-posts-i2__post:nth-last-child(n+3):first-child,
.jp-related-posts-i2__post:nth-last-child(n+3):first-child ~ * {
2025-05-07 06:48:41 +02:00
2024-02-16 11:03:01 +01:00
/* From 3 total items on, 3 items by row */
2025-08-27 08:44:30 +02:00
flex-basis: calc(( 100% - var(--hgap) * 2 ) / 3);
2019-11-15 23:26:29 +01:00
}
2024-02-16 11:03:01 +01:00
.jp-related-posts-i2__post:nth-last-child(4):first-child,
.jp-related-posts-i2__post:nth-last-child(4):first-child ~ * {
2025-05-07 06:48:41 +02:00
2024-02-16 11:03:01 +01:00
/* Exception for 4 total items: 2 items by row */
2025-08-27 08:44:30 +02:00
flex-basis: calc(( 100% - var(--hgap) ) / 2);
2019-11-15 23:26:29 +01:00
}
2024-02-16 11:03:01 +01:00
.jp-related-posts-i2__post-link {
display: flex;
flex-direction: column;
row-gap: 0.5rem;
2019-11-15 23:26:29 +01:00
2024-02-16 11:03:01 +01:00
width: 100%;
margin-bottom: 1rem;
2025-08-27 08:44:30 +02:00
2024-02-16 11:03:01 +01:00
line-height: 1.2;
2019-11-15 23:26:29 +01:00
}
2024-02-16 11:03:01 +01:00
.jp-related-posts-i2__post-link:focus-visible {
outline-offset: 2px;
2019-11-15 23:26:29 +01:00
}
2024-02-16 11:03:01 +01:00
.jp-related-posts-i2__post-img {
2019-11-15 23:26:29 +01:00
order: -1;
2024-02-16 11:03:01 +01:00
max-width: 100%;
2019-11-15 23:26:29 +01:00
}
2024-02-16 11:03:01 +01:00
.jp-related-posts-i2__post-defs {
margin: 0;
list-style-type: unset;
}
/* Hide, except from screen readers */
.jp-related-posts-i2__post-defs dt {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
2025-08-27 08:44:30 +02:00
clip: rect(1px, 1px, 1px, 1px);
white-space: nowrap;
2024-02-16 11:03:01 +01:00
}
.jp-related-posts-i2__post-defs dd {
margin: 0;
2019-11-15 23:26:29 +01:00
}
/* List view */
2024-02-16 11:03:01 +01:00
.jp-relatedposts-i2[data-layout="list"] .jp-related-posts-i2__list {
2019-11-15 23:26:29 +01:00
display: block;
}
.jp-relatedposts-i2[data-layout="list"] .jp-related-posts-i2__post {
2024-02-16 11:03:01 +01:00
margin-bottom: 2rem;
2019-11-15 23:26:29 +01:00
}
/* Breakpoints */
2024-02-16 11:03:01 +01:00
2019-11-15 23:26:29 +01:00
@media only screen and (max-width: 640px) {
2025-05-07 06:48:41 +02:00
2024-02-16 11:03:01 +01:00
.jp-related-posts-i2__list {
2019-11-15 23:26:29 +01:00
display: block;
}
2024-02-16 11:03:01 +01:00
.jp-related-posts-i2__post {
margin-bottom: 2rem;
2019-11-15 23:26:29 +01:00
}
}
/* Container */
#jp-relatedposts {
display: none;
padding-top: 1em;
margin: 1em 0;
position: relative;
clear: both;
}
2025-05-07 06:48:41 +02:00
.jp-relatedposts::after {
2025-08-27 08:44:30 +02:00
content: "";
2019-11-15 23:26:29 +01:00
display: block;
clear: both;
}
/* Headline above related posts section, labeled "Related" */
#jp-relatedposts h3.jp-relatedposts-headline {
margin: 0 0 1em 0;
display: inline-block;
float: left;
font-size: 9pt;
2025-05-07 06:48:41 +02:00
font-weight: 700;
2019-11-15 23:26:29 +01:00
font-family: inherit;
}
2025-05-07 06:48:41 +02:00
#jp-relatedposts h3.jp-relatedposts-headline em::before {
2019-11-15 23:26:29 +01:00
content: "";
display: block;
width: 100%;
min-width: 30px;
2025-08-27 08:44:30 +02:00
border-top: 1px solid rgba(0, 0, 0, 0.2);
2019-11-15 23:26:29 +01:00
margin-bottom: 1em;
}
#jp-relatedposts h3.jp-relatedposts-headline em {
font-style: normal;
2025-05-07 06:48:41 +02:00
font-weight: 700;
2019-11-15 23:26:29 +01:00
}
/* Related posts items (wrapping items) */
#jp-relatedposts .jp-relatedposts-items {
clear: left;
}
#jp-relatedposts .jp-relatedposts-items-visual {
margin-right: -20px;
}
/* Related posts item */
#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post {
float: left;
width: 33%;
margin: 0 0 1em; /* Needs to be same as the main outer wrapper for Related Posts */
box-sizing: border-box;
}
#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post {
padding-right: 20px;
filter: alpha(opacity=80);
2025-08-27 08:44:30 +02:00
-moz-opacity: 0.8;
opacity: 0.8;
2019-11-15 23:26:29 +01:00
}
#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post:nth-child(3n+4),
#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post:nth-child(3n+4) {
clear: both;
}
#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post:hover .jp-relatedposts-post-title a {
text-decoration: underline;
}
#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post:hover {
filter: alpha(opacity=100);
-moz-opacity: 1;
opacity: 1;
}
/* Related posts item content */
#jp-relatedposts .jp-relatedposts-items-visual h4.jp-relatedposts-post-title,
2021-04-27 08:32:47 +02:00
#jp-relatedposts .jp-relatedposts-items p,
#jp-relatedposts .jp-relatedposts-items time {
2019-11-15 23:26:29 +01:00
font-size: 14px;
line-height: 20px;
margin: 0;
}
2025-05-07 06:48:41 +02:00
2019-11-15 23:26:29 +01:00
#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post-nothumbs {
2025-08-27 08:44:30 +02:00
position: relative;
2019-11-15 23:26:29 +01:00
}
2025-05-07 06:48:41 +02:00
2019-11-15 23:26:29 +01:00
#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post-nothumbs a.jp-relatedposts-post-aoverlay {
2025-08-27 08:44:30 +02:00
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
display: block;
2019-11-15 23:26:29 +01:00
border-bottom: 0;
}
2021-04-27 08:32:47 +02:00
#jp-relatedposts .jp-relatedposts-items p,
#jp-relatedposts .jp-relatedposts-items time {
2019-11-15 23:26:29 +01:00
margin-bottom: 0;
}
#jp-relatedposts .jp-relatedposts-items-visual h4.jp-relatedposts-post-title {
text-transform: none;
margin: 0;
font-family: inherit;
display: block;
max-width: 100%;
}
#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-title a {
font-size: inherit;
2025-05-07 06:48:41 +02:00
font-weight: 400;
2019-11-15 23:26:29 +01:00
text-decoration: none;
filter: alpha(opacity=100);
-moz-opacity: 1;
opacity: 1;
}
#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-title a:hover {
text-decoration: underline;
}
#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post img.jp-relatedposts-post-img,
#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post span {
display: block;
max-width: 90%;
overflow: hidden;
text-overflow: ellipsis;
}
#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post img.jp-relatedposts-post-img,
#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post span {
2021-07-23 11:58:50 +02:00
height: auto;
2019-11-15 23:26:29 +01:00
max-width: 100%;
}
#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-date,
#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-context {
2025-08-27 08:44:30 +02:00
opacity: 0.6;
2019-11-15 23:26:29 +01:00
}
2025-08-27 08:44:30 +02:00
/* Hide the date by default, but leave the element there if
* a theme wants to use css to make it visible. */
2019-11-15 23:26:29 +01:00
.jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-date {
display: none;
}
/* Behavior when there are thumbnails in visual mode */
#jp-relatedposts .jp-relatedposts-items-visual div.jp-relatedposts-post-thumbs p.jp-relatedposts-post-excerpt {
display: none;
}
/* Behavior when there are no thumbnails in visual mode */
#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post-nothumbs p.jp-relatedposts-post-excerpt {
overflow: hidden;
}
2025-05-07 06:48:41 +02:00
2019-11-15 23:26:29 +01:00
#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post-nothumbs span {
margin-bottom: 1em;
}
/* List Layout */
#jp-relatedposts .jp-relatedposts-list .jp-relatedposts-post {
clear: both;
width: 100%;
}
#jp-relatedposts .jp-relatedposts-list .jp-relatedposts-post img.jp-relatedposts-post-img {
float: left;
overflow: hidden;
max-width: 33%;
margin-right: 3%;
}
#jp-relatedposts .jp-relatedposts-list h4.jp-relatedposts-post-title {
display: inline-block;
max-width: 63%;
}
/*
* Responsive
*/
@media only screen and (max-width: 640px) {
#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post {
width: 50%;
}
#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post:nth-child(3n) {
clear: left;
}
#jp-relatedposts .jp-relatedposts-items-visual {
margin-right: 20px;
}
}
@media only screen and (max-width: 320px) {
#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post {
width: 100%;
clear: both;
margin: 0 0 1em;
}
#jp-relatedposts .jp-relatedposts-list .jp-relatedposts-post img.jp-relatedposts-post-img,
#jp-relatedposts .jp-relatedposts-list h4.jp-relatedposts-post-title {
float: none;
max-width: 100%;
margin-right: 0;
}
}
2022-04-02 10:26:41 +02:00
/*
* Hide the related post section in the print view of a post
*/
@media print {
2025-05-07 06:48:41 +02:00
2022-04-02 10:26:41 +02:00
.jp-relatedposts {
2025-08-27 08:44:30 +02:00
display: none !important;
2022-04-02 10:26:41 +02:00
}
2025-08-27 08:44:30 +02:00
}