geneontology / wc-gocam-viz

Web component to visualize GO-CAMs
BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

Remove hard dependency on Bootstrap 5 #16

Closed pkalita-lbl closed 9 months ago

pkalita-lbl commented 1 year ago

The hard dependency on Bootstrap 5 makes this challenging to integrate the widget into downstream projects. Some scenarios:

  1. Host application doesn't use Bootstrap at all. Once the widget is loaded, Bootstrap styles are injected. Even though the host application doesn't use any Bootstrap CSS classes its global styling could alter the appearance of the host application.
  2. Host application uses an older version of the Bootstrap. This is the case with AmiGO and the Alliance site, which both use Bootstrap 4. Once the widget is loaded the existing Bootstrap 4 style definitions are overridden with Bootstrap 5 definitions. This has all sorts of unpredictable side effects. For example, before loading the widget:

Image

And after:

Image

  1. Host application also uses Bootstrap 5. This is the best case scenario because there won't be any style conflicts. But in this case the application still ends up with two copies of Bootstrap 5, increasing the size of the host application bundle.

At the very least it seems like Bootstrap should be a peer dependency. This would fix the third scenario, but not the first two. To help the first two scenarios I'd suggest seeing if:

kltm commented 10 months ago

From @tmushayahama: frankly, BS could even be removed.