Custom Note Formats in PDF via HTML/CSS
Posted: Tue Oct 18, 2022 7:33 pm
I'm trying to update my CSS style sheet to customize different note types with varied background colors and icons. The ultimate output is a DITA PDF based on HTML5 & CSS.
In addition to the standard note types in Oxygen DITA, I've created note elements with a type attribute of other and an othertype attribute of Quality or Safety.
When I generate the output, these special notes generate correctly with a heading that reads Quality or Safety rather than Notes. So far, so good.
Now I'm modifying the notes.css file in an attempt to have different background colors for the different note types. The notes.css file already does this for warnings and such. For example:
generates a pink Restriction note.
However, I cannot successfully select my custom note types.
Adding the following does nothing to change the background color of the other note type.
The following doesn't do anything either:
Ultimately, I'd like each othertype value to generate a note with a unique color and icon. So if the othertype is Quality I'd get a note with a blue background and a trophy icon; Safety might have an orange background and a life-preserver icon, etc.
Does anyone know how to do this?
In addition to the standard note types in Oxygen DITA, I've created note elements with a type attribute of other and an othertype attribute of Quality or Safety.
When I generate the output, these special notes generate correctly with a heading that reads Quality or Safety rather than Notes. So far, so good.
Now I'm modifying the notes.css file in an attempt to have different background colors for the different note types. The notes.css file already does this for warnings and such. For example:
Code: Select all
*[class~="topic/note"].note_restriction {
background-color: #ff3399;
}
However, I cannot successfully select my custom note types.
Adding the following does nothing to change the background color of the other note type.
Code: Select all
*[class~="topic/note"].note_other {
background-color: #00ccff;
}
Code: Select all
*[othertype=Quality] {
background-color: #00ccff;
}
Does anyone know how to do this?