Open atykhan-amplify opened 3 years ago
The annotations (which can be underlines or highlights) are just elements within an SVG that lives on your webpage. You can style them with CSS.
Styling highlights (make them gray):
.epubjs-hl,
.epubjs-hl g {
fill: #aaa;
}
Styling underlines (make them gray, change line width):
.epubjs-ul line {
stroke: #aaa;
stroke-width: 2;
}
The simplest way to update an annotation is probably just removing it and adding a new annotation. Both the old and new annotation have the same CFI, so the result is effectively an update.
@sbatson5 Where to use this code
While working with epub.js I've faced the necessity to update the annotation color. I haven't find the possibility of doing it within the Annotations class or other epub.js components. So I have to build my own workaround. Is there any possibility of doing it with the epub.js library?