Skip to content

AndyOGo/custom-elements-defouc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lerna

Custom Elements de-FOUC

Mitigate intrinsic Flash of Unstyled Content (FOUC) of Custom Elements V1, by delaying their visibility upon connection.

Unfortunately one rather intriguing problem with Custom Elements is performance and it's intrinsic problem of Flash of Unstyled Content (FOUC).

This monorepo is here to help you mitigate this annoying FOUC-issue, by providing you with:

Note: Depending at your targeted audience the CSS :defined pseudo-class may is a better solution. Of course if you need to support any user with non-capable browsers :defined won't help you there.

You could handle all undefined custom elements FOUC just by these lines defined within your <head> section:

:not(:defined) {
    display: none;
    // or
    visibility: hidden;
    // or whatever you came up with
}

License MIT

Proudly brought to you by <scale-unlimited>

About

Mitigate intrinsic FOUC of custom elements

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •