Page 1 of 1

Removal of generated text in particular element

Posted: Thu Feb 02, 2017 10:35 am
by Raga Mounika
Hi Team,

When <steps> is used I am getting "Steps" generated text. Now according to my customization
I dont need "Steps" generated text when <steps> is inserted in <remedy> element.
The code I used here is

Code: Select all

*[class~="task/steps"]:before(10) {
content:"Steps ";
font-weight:bold;
}
*[class~='troubleshooting/remedy']{
-oxy-foldable: false;
content:"Remedy ";
}
remedy:not(title){
content:"Remedy ";
font-weight: bold;
}
remedy > *{
font-weight:normal;
}
*[class~='troubleshooting/remedy']! > [class~='topic/title'] {
content:"Remedy: ";
}
I already tried using the not selector. But it is not working

Code: Select all

*[class~="task/steps"]:not(remedy):before(10) {
content:"Steps ";
font-weight:bold;
}
Please help me to remove the "Steps" text when <steps> is inserted in <remedy>.

Thank you!

BR
Mounika

Re: Removal of generated text in particular element

Posted: Thu Feb 02, 2017 10:51 am
by Radu
Hi Mounika,

You do not need the has() selector to solve this.
This CSS selector you tried *[class~="task/steps"]:not(remedy) means something like "the steps element which does not have the remedy element inside it" and you want to express "the steps element which is not inside the remedy".
So if the CSS selector which adds the "Steps" looks like this:

Code: Select all

*[class~="task/steps"]:before(10) {
content:"Steps ";
font-weight:bold;
}
the extra added CSS selector which avoids adding the "Steps" when the <steps> is inside a <remedy> would look like this:

Code: Select all

remedy > *[class~="task/steps"]:before(10) {
content:"";
}
Regards,
Radu

Re: Removal of generated text in particular element

Posted: Thu Feb 02, 2017 1:11 pm
by Raga Mounika
Hi Radu,

Thanks for the reply . It works :)

BR,
Mounika