epubjs-reader icon indicating copy to clipboard operation
epubjs-reader copied to clipboard

default style does not work immediately

Open Anxcye opened this issue 10 months ago • 0 comments

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? 2024-04-29-16-23-22

Anxcye avatar Apr 29 '24 08:04 Anxcye