dascritch / cpu-audio

An audio WebComponent to provide timecoded links and other features to an audio tag
https://dascritch.github.io/cpu-audio/
GNU Lesser General Public License v3.0
24 stars 2 forks source link

Use css contain to help browser perfs #85

Closed dascritch closed 3 years ago

dascritch commented 5 years ago

References :

This should be suggestion for users for integrating web component.

Suggested in first link :

:host {
  display: block;
  contain: content; /* Boom. CSS containment FTW. */
}

also

:host {
   all: initial; /* 1st rule so subsequent properties are reset. */
}

so we can remove reset styles (see https://developer.mozilla.org/fr/docs/Web/CSS/all )

dascritch commented 5 years ago

:host properties added (due to another bug https://github.com/dascritch/cpu-15/issues/20 ). We just need some cleanse in css.