I was given the task to develop sliders/pop-ups for customers of the company I work for. This works a bit like chatbots (ie. Intercom). The user sees a small bubble on the bottom-right corner, clicks on it and it shows some information from our (Rails) app.
I’ve tried to do so, but it looks like the script doesn’t link to my CSS files, so styles are broken. So I am not sure if it’s the best way to go.
You’re using the right approach.
To fix your missing CSS you could adjust your script to add the required CSS references to the
head of the page.
let externalCssLink = document.createElement('link') externalCssLink.rel = 'stylesheet' externalCssLink.href = 'https://some-external-domain.com/some-css.css' document.head.appendChild(externalCssLink)