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.
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
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 = [
Ok… is there an error in the browser console?
Ok yes there was one.
Warning: Each child in firstname.lastname@example.org_0_0m1637145051.14.0.js:82 a list should have a unique "key" prop. See https://fb.me/react-warning-keys for more information.
in th (created by s)
in tr (created by s)
And there are two warnings about
componentWillMount has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details.
componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details.
I can post more details about the warning if needed.
It’s ok, those warnings are expected and not what I was hoping for.