Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default style does not work immediately #71

Open
Anxcye opened this issue Apr 29, 2024 · 0 comments
Open

default style does not work immediately #71

Anxcye opened this issue Apr 29, 2024 · 0 comments

Comments

@Anxcye
Copy link

Anxcye commented Apr 29, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant