Uh oh!
There was an error while loading. Please reload this page.
Insert style-loader loaded CSS at top of <head/> - #382
Conversation
chriddyp
commented
Nov 15, 2018
Could we add an integration test with percy here? Something that mimics the user code by supplying some CSS in the |
@chriddyp Good point - I've added one. I tried to do some assertions on the CSS being set, but couldn't get it to work. The suggested Edit: Ok, seems the Percy snapshot isn't picking up the CSS changes either - even though running the test locally you can see them be set. |
chriddyp
commented
Nov 19, 2018
With percy, you need to explicitly set the CSS folder and CSS URL. From #312:
See the percy Setup docs here: https://docs.percy.io/docs/python-selenium You can also reach out to the percy team if you can't get those settings to work. |
valentijnnieman
commented
Nov 19, 2018
@chriddyp Is it working in the main |
chriddyp
commented
Nov 19, 2018
Not sure off the top of my head. You might be able to check out the Percy snapshots in that repo and see they look like they have custom css applied. |
chriddyp
commented
Nov 19, 2018
Also, looking at |
T4rk1n
commented
Nov 19, 2018
Just tested and it doesn't load the assets in the dash tests percy snapshots. |
valentijnnieman
commented
Nov 19, 2018
Ah too bad. Thanks for taking a look! |
T4rk1n
commented
Nov 19, 2018
But I got them to load with this config: |
valentijnnieman
commented
Nov 19, 2018
@T4rk1n Anything else you've changed? I still can't get them to load. |
T4rk1n
commented
Nov 19, 2018
No only thing I see different is the root_dir is relative |
T4rk1n
commented
Nov 19, 2018
Here you can see the whole changes: |
valentijnnieman
commented
Nov 19, 2018
@T4rk1n That was it - removing the root_static_dir suggested by the Percy docs and having the root_dir relative fixed it. Thanks for your help! |
T4rk1n
commented
Nov 19, 2018
Great, look like it worked 💃 You can review plotly/dash#461 while you are at it ? |
… into hotfix-style-loader
This fixes and closes#380 by inserting the default CSS loaded by
style-loaderat the top of<head/>, so that user loaded CSS will be below it, allowing users to overwrite the default CSS.