V2 Headline Accent -> Class

I found the following to add to the site CSS to add an accent to the V2 Headline. How do I turn that into a class so I can selectively use it on some headlines and not others?

.x-text-headline {
    overflow: hidden;
}

.x-text-headline .x-text-content-text-primary {
    display: inline-block;
    width: auto !important;
    position: relative;
}

.x-text-headline .x-text-content-text-primary:before, 
.x-text-headline .x-text-content-text-primary::after {
    content: "";
    position: absolute;
    top: 50%;
    height: 2px;
    width: 9999px;
    display: block;
    margin-top: -1px;
    background-color: #e5e5e5;
}

.x-text-headline .x-text-content-text-primary:before {
    right: 100%;
    margin-right: 0.5em;
}

.x-text-headline .x-text-content-text-primary::after {
    left: 100%;
    margin-left: 0.5em;
}

Hello @mikewolf1127,

Thanks for posting in!

To resolve your issue, please update your custom css into this:

.x-text-headline.width-accent {
    overflow: hidden;
}

.x-text-headline.width-accent .x-text-content-text-primary {
    display: inline-block;
    width: auto !important;
    position: relative;
}

.x-text-headline.width-accent .x-text-content-text-primary:before, 
.x-text-headline.width-accent .x-text-content-text-primary::after {
    content: "";
    position: absolute;
    top: 50%;
    height: 2px;
    width: 9999px;
    display: block;
    margin-top: -1px;
    background-color: #e5e5e5;
}

.x-text-headline.width-accent .x-text-content-text-primary:before {
    right: 100%;
    margin-right: 0.5em;
}

.x-text-headline.width-accent .x-text-content-text-primary::after {
    left: 100%;
    margin-left: 0.5em;
}

And then if you want to add accent to your v2 headline element, simply add a custom with-accent class in the v2 element’s “Customize” tab.

We would loved to know if this has work for you. Thank you.

Maybe I wasn’t totally clear…

I added that CSS in Theme Options, however that effects all the headlines globally.

I do not have it as a class. How do I do that?

Oh, I see. Yes you answered the question.

Glad to hear that, cheers!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.