Bring Drag & Drop to Dash with Dashboard Engine. 💫 Learn how at our next webinar!

External stylesheet doesn't seem to have any effects

Hi, I’m following this guide to use an external stylesheet, but it doesn’t seem to have any effects. For example setting the background color or text color to red to see that it works, but nothing changes.

I have external_stylesheets = [ link to a css file on github... ] , and app = dash.Dash(__name__, external_stylesheets=external_stylesheets).

Not sure where could have gone wrong. Any suggestions are useful!

Could you share with us the link you are trying to add?

Yes of course, it’s essentially the same file from the guide (https://codepen.io/chriddyp/pen/bWLwgP.css) and just put it on github that’s all. You can find the file here dashcss/bWLwgP.css at main · peilinUWU/dashcss · GitHub. I just added

* {
  background-color: red;
}

to see if it takes effect.

Are there any errors on the browser console? I suspect that it could be something related to the mime type, so perhaps setting type="text/css" explicitly in the external_stylesheets could fix this problem (if that’s actually the issue).

I gave it a try but nothing has changed. I added the following:

external_stylesheets = [
    'https://github.com/peilinUWU/dashcss/blob/4c6874d18431119cb9e2e5e5b116be42796a77c2/bWLwgP.css',
    {
        'type': "text/css"
    }
]

Ok… is there an error in the browser console?