@animuz/embed

0.0.20 • Public • Published

Animuz Embed

React + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

Viewing Bundle Size

npx vite-bundle-visualizer

TODO

CSS Flash of Unstyled Content (FOUC)

Currently we are having problems with CSS Flickering. So I need to move some of the code to styles instead so it loads first.

Our CSS Flickers because of dynamic imports. However, I don't think that it should be dynamic because we're already know the name of the css to import. I just don't know how to inject the css to the js.

Relative references:

But, since you import your CSS dynamically, there is no way to avoid FOUC. Because the CSS is loaded after JS and after the DOM loaded

Currently we're building with vite as js and css file, but I don't know enough configurations to work around it. vite - How to bundle as a single JS and a single CSS file

One hack to do is SO - Eliminate flash of unstyled content

<style>
  html {
    visibility: hidden;
    opacity: 0;
  }
</style>

Then, at the end of your last .css stylesheet file, set the visibility and opacity styles to 'visible' and '1', respectively:

html {
  visibility: visible;
  opacity: 1;
}

Dev Problems

VIVO Android viewport height is half

Some SO questions also face the same problem

Readme

Keywords

none

Package Sidebar

Install

npm i @animuz/embed

Weekly Downloads

12

Version

0.0.20

License

none

Unpacked Size

355 kB

Total Files

4

Last publish

Collaborators

  • knighth