Hi everyone,
I’m using the Atelier theme and I added a “Read More” collapse button on the collection page.
The fade gradient works on the collection description, but it also affects homepage and footer titles because my CSS includes .rte, which is global.
Here is my CSS:
/* BUTTON CENTER */
.read-more-btn {
user-select: none;
-webkit-tap-highlight-color: transparent;
outline: none;
background: transparent;
display: block;
margin: -20px auto 20px auto;
color: #000;
border: none;
text-transform: uppercase;
padding: 8px 15px;
cursor: pointer;
border-radius: 5px;
transition: background 0.3s;
text-decoration: underline;
text-underline-offset: 4px;
text-align: center;
width: fit-content;
z-index: 10;
position: relative;
}
/* APPLY BLUR EFFECT ON EXISTING DESCRIPTION */
.collection-hero__description,
.collection__description,
.collection-meta__description,
.rte {
position: relative;
overflow: hidden;
max-height: 4.2em;
line-height: 1.4em;
transition: max-height 0.5s ease-in-out;
}
.collection-hero__description::after,
.collection__description::after,
.collection-meta__description::after,
.rte::after {
content: “”;
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 3.2em;
background: linear-gradient(
to bottom,
rgba(255,255,255,0) 0%,
rgba(255,255,255,0.3) 35%,
rgba(255,255,255,0.7) 65%,
rgba(255,255,255,1) 100%
);
pointer-events: none;
transition: opacity 0.3s ease-in-out;
}
/* REMOVE FADE WHEN EXPANDED */
.collection-hero__description.full::after,
.collection__description.full::after,
.collection-meta__description.full::after,
.rte.full::after {
opacity: 0;
}
.collection-description-wrapper,
.collection-description {
position: relative;
z-index: 1;
}
/* Push product grid down */
.collection-wrapper {
margin-top: 40px;
}
My JS (main-collection.liquid)
The button in main-collection.liquid line 24:
{% if collection.description != blank %}
Read More
{% endif %}
The issue:
Because my JS uses .rte as a fallback selector, the fade CSS also applies to all .rte elements sitewide, including homepage and footer titles.
If I remove .rte from the CSS, the fade gradient disappears from the collection banner description.
What I need:
A way to scope the fade effect only to collection page descriptions, without affecting homepage/footer.
Is there a correct selector or method in Atelier theme to target the collection description container only?
URL: run-official
Thanks in advance for your help!