epubjs-reader
epubjs-reader copied to clipboard
default style does not work immediately
I set a custom style through this code:
rendition.themes.default({
'html': {
'background-color': '#$backgroundColor',
'color': '#$textColor',
},
'body': {
'padding-top': '${style.topMargin}px !important',
'padding-bottom': '${style.bottomMargin}px !important',
'line-height': '${style.lineHeight} !important',
'letter-spacing': '${style.letterSpacing}px !important',
},
'p': {
'padding-top': '${style.paragraphSpacing}px !important',
'line-height': '${style.lineHeight} !important',
},
'pre':{
'white-space': 'pre-wrap',
},
'img':{
'max-width':'-webkit-fill-available !important',
}
});
This can work normally. However, when switching chapters, there is a brief moment (about 100ms) where it does not use my set style, and then it uses my style, which will cause the interface to flicker. How can I solve this problem?