I have never been a fan of the Avada pagination feature for posts because the controls are just too limited, but after doing some work creating a skewed version, I realized that CSS could be used to give it a look that might be more interesting to readers. This applies to the Text + Preview option in the pagination element.
The Wrapper
The first step was to give the preview card the look I wanted. This was fairly simple. I did assign an ID to the element so that the default would be available where necessary.
The Title (.fusion-item-title)
By default, the title is set not to wrap, which is not useful in many cases. These styles allow the title text to wrap and limit the width of the space available. The text color is based on the background color in the previous step to maintain the color contrast.
The Featured Image (.fusion-item-media img)
These styles give it a 1/1 aspect ratio (square), set to size to cover, and the border-radius gives it a round appearance. I also reversed the row-reverse on the “Next” article so that the image is on the left.
Previous and Next
The styles add text after and remove the arrows. This is not ideal, and hopefully, a future release will give these better structure and styling options.
The CSS
Here is the complete CSS for this implementation.
#paginator .fusion-pagination-preview-wrapper {
background-image: linear-gradient(45deg,var(--awb-color8),var(--awb-color4));
padding:1.5rem;
width: 400px;
border-radius: 8px;
box-shadow: 0px 10px 20px -10px rgba(31,31,31,0.3);
}
#paginator .fusion-item-title {
padding: .5em .75em;
white-space:unset!important;
overflow: hidden;
text-overflow:unset;
max-width: 300px;
display: block;
text-align: left;
color:var(--awb-color2)!important;
}
#paginator .fusion-item-media img{
max-width: 80px;
object-fit: cover;
aspect-ratio: 1;
border-radius: 50%;
}
#paginator .fusion-tb-previous a,#paginator .fusion-tb-next a{
text-transform: uppercase;
font-weight: 600!important;
padding: .6rem .4rem;
width: max-content;
border-bottom: 1px solid #313131 ;
}
#paginator .fusion-tb-next a::after{
position: unset;
transform: none;
}
#paginator .fusion-tb-previous a::before{
content: "";
position: unset;
transform: none;
}
#paginator .fusion-tb-previous a::after,#paginator .fusion-tb-next a::after{
content: "Article";
font-family: tenon;
margin-left:.8ex;
display: inline-block;
}
#paginator .fusion-tb-next .fusion-pagination-preview-wrapper{
flex-direction: row;
}
Originally published on Feb. 20, 2023
In this story