Currently, I am in the process of converting a website from Polymer to Lit. I have made good progress with it, but I have encountered a roadblock when it comes to styling. In order to simplify development and focus on functionality, I have been following this approach:
export class StyledElement extends LitElement {
// This method removes shadowroots to apply styles and allow script tags on
// index.html to function
createRenderRoot() {
return this;
}
}
With this setup, every element inherits this styling method and can make use of:
<link rel="stylesheet" href="/node_modules/bootstrap/dist/css/bootstrap.min.css" />
...
<script src="/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js" crossOrigin="anonymous"></script>
<script src="/node_modules/masonry-layout/dist/masonry.pkgd.min.js" crossOrigin="anonymous"></script>
Although this approach somewhat resolves the styling issues, it raises concerns about proper practices. Before addressing these problems, I am wondering if there is a correct method to integrate Masonry and Bootstrap, or if there is a better alternative available?