WebHelp: topic.css breaks zebra striping

Post here questions and problems related to editing and publishing DITA content.
Frank Ralf
Posts: 515
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

WebHelp: topic.css breaks zebra striping

Post by Frank Ralf »

Hi,

We use CSS zebra striping with a custom WebHelp Publishing Template, initially created for Oxygen 26.1. With Oxygen 28.1 this does not work any longer. A look under the hood reveals that the following CSS from topic.css is the culprit:

Code: Select all

.simpletable>:not(caption)>*>*,
.table>:not(caption)>*>* {
    background-color: var(--wh-primary-bg,#fff);
    color: var(--wh-primary-color,#000)
}
I think this rule is a bit too broad and should be more precise in targeting the HTML elements to which it should be applied.

Best regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com
julien_lacour
Posts: 802
Joined: Wed Oct 16, 2019 3:47 pm

Re: WebHelp: topic.css breaks zebra striping

Post by julien_lacour »

Hi Frank,

These new default rules are coming from newer Bootstrap versions, you can easily override it by targeting the cell instead of the row:

Code: Select all

tr:nth-child(even) > td {
  background-color: #f2f2f2;
}
Regards,
Julien
Frank Ralf
Posts: 515
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Re: WebHelp: topic.css breaks zebra striping

Post by Frank Ralf »

Hi Julien,

Thanks for the background information and the pointer. I just reset the rule by putting the following code before my customization, because it also affected the styling of the table header:

Code: Select all

.simpletable>:not(caption)>*>*,
.table>:not(caption)>*>* {
    background-color: inherit;
    color: inherit;
}
Best regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com
Post Reply